Skip to content

Secure presentation links (signed/encrypted, not plaintext base64) #39

Description

@DanielCotoJ

Effort: L — Estimate: 10-14 h — Dependencies: #36 (pairs with #35 for signing) — Unlocks: #40 (public verification)

Context

Today a share link is plaintext base64url JSON with no encryption, no signature and no server-side persistence. See apps/credit-history/src/lib/presentation-token.ts and the SEAM in apps/credit-history/src/app/share/page.tsx:

// SEAM: the real ACTA sharing will be wired here (encrypted off-chain payload / ZK).
// Today we only generate a mock token. Missing: encryption, persistence, real expiration.
const payload = { ids: selectedIds, exp: expirationTime };

Anyone can decode or tamper with the token, and expiration is only enforced client-side.

Goal

Share links carry a tamper-evident (signed and/or encrypted) presentation created via ACTA, with expiration that can't be bypassed by editing the token.

Step by step

  1. Replace the PresentationPayload codec with an ACTA-backed presentation: build a verifiable presentation from the selected credential ids, signed by the holder (signTransaction from Integrate a real wallet (Freighter / Stellar Wallets Kit) #35 if the flow requires an on-chain/off-chain signature).
  2. Persist the presentation (ACTA off-chain payload or vault reference) so the verify side fetches it by an opaque token/id instead of trusting the URL contents.
  3. Enforce expiration on the resolving side, not just the client; keep the existing preset UX (1h/1d/7d/30d/custom/never).
  4. Keep the /share UI and result screen intact; only the token generation/resolution changes.

Out of scope

Acceptance criteria

  • The token can't be decoded to raw credential data nor edited to extend expiration.
  • A presentation is created/persisted via ACTA; verify resolves it by opaque reference.
  • Expiration is enforced server/resolver-side.
  • /share UX unchanged; pnpm lint && pnpm typecheck && pnpm build pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions