Skip to content

Wallet

Image: ghcr.io/parlesec/protocolsoup-wallet

Use the wallet service to run wallet-side OID4VCI issuance (bootstrap or external offer import) and OID4VP presentation submission against a VC issuer/verifier target.

Property Value
Internal port 8080 (commonly mapped to host 8081)
Health GET /health
Authorize GET /authorize (OID4VP wallet authorization endpoint → SPA consent; auto-issues the request-inferred credential when the store has no DCQL match)
Submit POST /submit
Issue / import POST /api/issue, POST /api/import
OID4VCI callback GET /api/oid4vci/callback (answers JSON, with _protocol_exchanges, when Accept asks for application/json and not text/html)
Variable Required Default Description
WALLET_TARGET_BASE_URL No https://protocolsoup.com VC verifier/issuer service URL for OID4VP submissions and default OID4VCI target
WALLET_ALLOWED_CORS_ORIGINS No https://protocolsoup.com,https://www.protocolsoup.com,https://protocolsoup.fly.dev Comma-separated allowed browser origins
WALLET_DEFAULT_CREDENTIAL_FORMAT No mso_mdoc Default stored and presented credential format when a request omits a format/configuration. mso_mdoc (mDL) is the default; dc+sd-jwt and the W3C formats remain selectable
WALLET_DID_METHOD No key DID method of the wallet’s holder DID: key, jwk or web. Each session’s wallet derives its DID from its own key (for web, from the wallet’s own origin and session); no request or setting can give it another identifier
WALLET_DEFAULT_SIGNING_ALG No ES256 Default holder-binding signing algorithm; ES256 (EC P-256) matches the mso_mdoc default
WALLET_SESSION_TTL No 20m Session lifetime for in-memory wallet material
WALLET_STRICT_SESSION_ISOLATION No true Enforce strict session boundaries between demo runs
WALLET_ALLOW_EXTERNAL_VERIFIERS No true Allow fetches of OID4VP request_uri and OID4VCI endpoints outside the configured target/issuer origin. External URLs must be HTTPS; DNS-resolved and redirect destinations that are private, loopback, link-local, multicast, or shared-address are rejected.
WALLET_TRUSTED_VERIFIER_ATTESTATION_ISSUERS No (empty) Comma-separated issuer URLs the wallet trusts for verifier_attestation request validation
WALLET_DEVICE_KEY_PATH No (empty) File path for the persistent mso_mdoc holder device key (EC P-256). Empty uses an ephemeral key; set a durable path so the device binding of stored mdoc credentials survives restarts
WALLET_VERIFIER_X509_TRUST_ANCHOR_PEM No System roots only Additional PEM CA roots trusted for x509_san_dns / x509_hash request objects; roots carried in x5c are never self-trusted
WALLET_MDOC_IACA_ROOT_PEM Required for mdoc storage (empty) PEM IACA root(s) used to verify IssuerAuth before storing an issued mso_mdoc. Multiple PEMs are additive.
WALLET_CLIENT_ATTESTATION_ATTESTER_JWK_JSON No (empty) Attester private JWK (+ x5c) that mints OAuth-Client-Attestation JWTs. Required with the key-attestation attester JWK to enable HAIP issuance
WALLET_CLIENT_ATTESTATION_KEY_ATTESTATION_JWK_JSON No (empty) Attester private JWK (+ x5c) that mints Appendix D key_attestation JWTs for HAIP proofs
WALLET_OID4VCI_ATTESTED_CLIENT_ID No protocolsoup-wallet Attested client_id / client attestation JWT sub / client attestation PoP JWT iss when HAIP attestation material is configured
WALLET_CLIENT_ATTESTATION_ISSUER No https://wallet.protocolsoup.com/attester iss on client attestation JWTs

fly.wallet.toml sets WALLET_DEVICE_KEY_PATH=/data/device-key.pem on the protocolsoup_wallet_data volume. WALLET_MDOC_IACA_ROOT_PEM is staged as a Fly secret from the live issuer IACA, not baked into the toml.

Terminal window
docker run -p 8081:8080 \
-e WALLET_TARGET_BASE_URL=http://host.docker.internal:8080 \
-e WALLET_ALLOWED_CORS_ORIGINS=http://localhost:3000 \
ghcr.io/parlesec/protocolsoup-wallet:latest

The default docker/docker-compose.yml runs this wallet alongside the stack, sharing the gateway’s network so it reaches the issuer at the same http://localhost:8080 origin the issuer advertises. It loads the issuer’s public IACA root from a volume that holds only that certificate.

Looking Glass reaches the wallet through the frontend’s same-origin /wallet-harness/* path, which the frontend forwards server-side to WALLET_BACKEND_ORIGIN. To use a wallet harness you host yourself:

  1. Point the frontend at it. The value is read at runtime, so the published frontend image needs no rebuild. With the default compose file, set it in docker/.env and skip the local wallet:

    Terminal window
    echo 'WALLET_BACKEND_ORIGIN=https://wallet.example.com' >> docker/.env
    docker compose up -d --build --scale wallet=0 --scale mdoc-trust-anchor=0
  2. Make the stack’s issuer and verifier reachable from the wallet at the exact origin they advertise. Set WALLET_TARGET_BASE_URL on the wallet to the stack’s SHOWCASE_BASE_URL. Outside that origin, the wallet only fetches public HTTPS hosts, so a wallet that is not on the stack’s network needs SHOWCASE_BASE_URL to be a public HTTPS origin.

  3. Give the wallet the issuer’s IACA root out of band. Copy only the public certificate (the PKI directory next to it also holds the issuer’s private keys) and set it as WALLET_MDOC_IACA_ROOT_PEM:

    Terminal window
    cd docker && docker compose cp federation-service:/app/mdoc-pki/iaca_root.pem ./iaca_root.pem

The hosted https://wallet.protocolsoup.com trusts only the ProtocolSoup issuer’s IACA root, so it rejects mso_mdoc credentials from a self-hosted issuer. Use your own wallet deployment for that.

CORS settings on the wallet do not apply to this path: the browser only talks to the frontend’s origin.

The wallet’s metadata-driven OID4VCI client supports:

  • Pre-authorized and authorization_code grants (PAR + PKCE S256 when the AS requires/advertises PAR; client attestation + DPoP when HAIP attestation material is configured). After PAR, authorize redirects use only client_id + request_uri; token uses the same client attestation as PAR. When AS metadata includes challenge_endpoint, the wallet fetches attestation_challenge and puts it in the Client Attestation PoP JWT challenge claim. The wallet UI opens AS authorization in a popup so the offer stays in the current tab (same-tab + sessionStorage restore if popups are blocked). DPoP use_dpop_nonce retries cover AS HTTP 400 and RS HTTP 401 challenges and mint a fresh client attestation PoP jti when attestation headers are present. The same client can authorize for a protected resource via POST /api/import (discovery_url, resource_endpoint, scope) and GET that resource with DPoP after token exchange. Discovery documents are rejected when issuer does not match the Issuer URL implied by the discovery URL (OIDC Discovery §4.3 / RFC 8414 §3.3); the wallet stops and does not call PAR or another well-known path. FAPI2 OIDC discovery uses openid-configuration; {issuer}/.well-known/oauth-authorization-server is not fetched.
  • When issuer metadata advertises batch_credential_issuance, the wallet requests multiple pairwise-distinct JWT proofs (capped by batch_size) and matches returned credentials by holder-key binding rather than array order. For a Credential Configuration bound to a DID (cryptographic_binding_methods_supported lists DID methods and neither jwk nor cose_key), each proof names its key with a kid that is a DID URL in place of the jwk header (OID4VCI 1.0 Appendix F.1): the wallet’s own did:key or did:jwk when the issuer lists that method and the DID holds the active key, otherwise a did:jwk or did:key of the key. HAIP batch proofs share one Key Attestation JWT whose attested_keys lists every proof key (HAIP 1.0 Section 4.5.1). For mso_mdoc, batch secondaries bound to ephemeral proof keys are stored after IACA checks but are not activated; the wallet device-key-bound credential remains presentable.
  • Credential and deferred requests are sent as compact JWE (Content-Type: application/jwt, ECDH-ES) when metadata sets credential_request_encryption.encryption_required or the wallet includes credential_response_encryption (OID4VCI 1.0 §8.2 / §9). Advertising request-encryption JWKs with encryption_required false does not by itself force encryption.
  • Credential response encryption (ECDH-ES / A128GCM|A256GCM) when required by issuer metadata or requested on the HAIP path
  • Deferred credential polling (HTTP 202 + transaction_id / interval, with DPoP nonce retry on deferred, credential, and notification endpoints), notifications (credential_accepted with DPoP + x-fapi-interaction-id, HTTP 204), and token-response credential_identifiers
  • Fail-closed issuer metadata trust (credential_issuer must match the offer)
  • mdoc IACA verification via WALLET_MDOC_IACA_ROOT_PEM before storage
  • Credentials and session key material are in-memory (WALLET_SESSION_TTL). Durable encrypted at-rest storage (OID4VCI 1.0 §15.3 SHOULD) is deferred until the platform vault initiative; only the mdoc device key at WALLET_DEVICE_KEY_PATH persists across restarts.
  • WALLET_TARGET_BASE_URL must point to the VC service or federation service running OID4VP (and typically OID4VCI).
  • During automatic OID4VCI bootstrap, the wallet leaves identity selection to the issuer’s designated default record. The Mock IdP user id the issuer names in its offer-creation response (wallet_user_id), and puts in an SD-JWT VC’s sub, is separate from the wallet’s holder DID.
  • A session has one wallet, and its holder DID (wallet_subject in responses) is derived from the wallet’s own key by WALLET_DID_METHOD. wallet_subject is no longer a request field: the /api/* endpoints refuse unknown fields, so a body that still sends it is answered 400 invalid_request.
  • The wallet must independently trust the issuer’s mdoc IACA root through WALLET_MDOC_IACA_ROOT_PEM. Copy the issuer’s public iaca_root.pem (for example from the issuer data volume at /data/mdoc/iaca_root.pem) into that wallet env var or secret before issuing or storing mso_mdoc credentials.
  • Hosted ProtocolSoup CI copies the showcase verifier request-signer CA into WALLET_VERIFIER_X509_TRUST_ANCHOR_PEM so Looking Glass x509_hash / x509_san_dns presentations can validate the live x5c chain.
  • Keep strict session isolation enabled in shared environments.
  • Use narrow CORS origin allow-lists outside local development.
  • External request_uri and issuer fetches resolve DNS and refuse non-public destinations, including redirect hops. Failed fetches do not reflect upstream response bodies. Pre-patch wallet tags v2.0.0–v4.1.0 are GHSA-q7jr-2q6f-gw44.
  • When the browser-based Looking Glass uses a separately hosted wallet, keep at least one wallet instance warm. Looking Glass calls the wallet through the same-origin /wallet-harness/* path on protocolsoup.com (see frontend WALLET_BACKEND_ORIGIN), so a cold-start failure surfaces as a normal HTTP error instead of a CORS-stripped edge 502.
  • Add each trusted verifier attestation issuer URL to WALLET_TRUSTED_VERIFIER_ATTESTATION_ISSUERS; otherwise the wallet will reject verifier_attestation request objects even when the JWT signature is valid.
  • Set WALLET_DEVICE_KEY_PATH to a durable file for mso_mdoc (ISO/IEC 18013-5) credentials: the device key bound at issuance must be reused to sign the DeviceResponse, so regenerating it silently breaks every stored mdoc credential’s device binding.
  • Set WALLET_MDOC_IACA_ROOT_PEM to an independently obtained IACA root. The wallet rejects mdoc issuance when no root is configured or when the credential’s document-signer chain, signature, digests, or validity fail verification.
  • Looking Glass pre-authorized OID4VCI executors create the issuer offer (preferring by-value), then redeem it through this wallet via POST /api/import (proxied as POST /wallet-harness/api/import). The wallet returns _protocol_exchanges — the real wallet→issuer hops Looking Glass renders as glass-box steps — plus _looking_glass_events for proof JWT construction. Issuer-initiated Looking Glass creates/delivers an offer and observes status_uri milestones, and the issuer records this wallet’s pushed authorization, Token and Credential Requests for that offer in the Looking Glass session the offer was created from, in full; the wallet (when used as the offer endpoint / import client) drives PAR, token, and credential exchange — including HAIP attestation+DPoP+encryption when the attestation env vars are configured.
  • POST /api/resolve, /api/preview, /api/present, and /submit also return _protocol_exchanges, on error responses as well as successes. They hold the wallet→verifier hops (request object retrieval under RFC 9101 Section 5.2.3, or OpenID4VP 1.0 Section 5.10 for request_uri_method=post; DID and verifier attestation issuer lookups; and the Authorization Response under OpenID4VP 1.0 Section 8.2 or 8.3.1), plus any wallet→issuer issuance the call ran. A body larger than 1 MiB is not recorded, and the hop’s extra says so. When the wallet sends a Credential Request as a JWE, or receives an encrypted Credential Response, the hop keeps the JWE as its body and adds request_plaintext or response_plaintext: the exact bytes the wallet encrypted or decrypted. The Authorization Response of a direct_post.jwt request is recorded the same way: the body is the form whose response is the JWE, and request_plaintext is the JSON the wallet encrypted, with the vp_token object in it.
  • Wallet-initiated issuance: paste a Credential Issuer identifier (or /.well-known/openid-credential-issuer metadata URL). The wallet fetches metadata, lists credential_configurations_supported, and starts authorization_code only after the holder selects a configuration. Do not paste Authorization Server openid-configuration / oauth-authorization-server URLs as a credential issuer. Before PAR, the UI shows issuer identifier, format/vct, and requirements advertised in metadata (PAR, DPoP, client attestation, encryption, holder binding). After Discover, the configuration picker stays available so Request again can start a new PAR without rediscovering (request_uri is single-use). Used Issue steps collapse; Request again and Continue to Issuer stay on the collapsed headers.
  • After an issued Data Integrity ldp_vc is received, the wallet verifies its proof under the issuer’s jwks_uri keys and under the key of the proof’s verificationMethod when the credential’s issuer controls that method (VC Data Integrity 1.0 Section 2.6). It retrieves that key with the Controlled Identifiers v1.0 Section 3.3 algorithm, which checks the document id, the method id, the method’s controller and its assertionMethod relationship, and refuses a revoked or expired method. A did:web or https method is retrieved through the wallet’s outbound client, which reaches public addresses only. The proof is checked with local copies of the published JSON-LD contexts and no context is loaded from the network, so a credential that names any other context, or carries a term its contexts do not define, is refused (VC Data Integrity 1.0 Sections 2.4.1 and 2.4.3).
  • After an issued JWT or SD-JWT credential is received, the wallet verifies the issuer signature against jwks_uri from Credential Issuer Metadata and RFC 8414 Authorization Server metadata. ProtocolSoup OID4VCI advertises jwks_uri as {issuer}/.well-known/jwks.json. It does not GET /.well-known/jwt-vc-issuer (SD-JWT VC Issuer Metadata is not a JWK Set). HAIP dc+sd-jwt holder binding is RFC 7800 cnf (typically cnf.jwk); a missing JWT sub is not a bind failure.
  • A W3C credential (jwt_vc_json, jwt_vc_json-ld, ldp_vc) names its holder in credentialSubject.id. The wallet stores it in the format the Credential Configuration named, and presents a jwt_vc_json or ldp_vc credential as that DID only when the DID is the wallet’s own subject or a did:jwk or did:key of the wallet’s active key; otherwise it refuses, because the verifier retrieves the presentation key from the DID. The vp_token is the JSON object keyed by Credential Query id (OpenID4VP 1.0 Section 8.1): a jwt_vc_json Presentation is a JWT string with typ JWT, iss the holder DID, and the request nonce and Client Identifier as nonce and aud (Appendix B.1.3.1.5); an ldp_vc Presentation is a JSON object whose proof carries them as challenge and domain (Appendix B.1.3.2.5). The wallet sends neither when the presentation’s alg, proof type or cryptosuite is not in the Verifier’s vp_formats_supported (Appendix B.1.3.1.3, B.1.3.2.3). A jwt_vc_json-ld credential cannot be presented: Appendix B defines no Credential Format Identifier for it.
  • The wallet reads a W3C credential only when it has what VC Data Model 1.1 says a verifiable credential MUST have: the credentials v1 context first (Section 4.1), credentialSubject (4.4), an issuer (4.5) and an issuance date (4.6), with identifiers that are URIs (4.2). For ldp_vc those are the issuer and issuanceDate properties. In the JWT encoding they are iss and nbf, and sub, jti and exp have to be present and equal whenever the vc claim carries credentialSubject.id, id or expirationDate (Section 6.3.1: the registered claim names “MUST be used, instead of or in addition to, their respective standard verifiable credential counterparts”). A credential that breaks one of these is refused with the reason.
  • A request made with scope in place of dcql_query is answered as the DCQL query the value is an alias for (OpenID4VP 1.0 Section 5.5), with vp_token keyed by that query’s Credential Query ids. The wallet knows the four scope values the ProtocolSoup verifier defines (com.protocolsoup.mobile_driving_licence_presentation, com.protocolsoup.university_degree_sd_jwt_presentation, com.protocolsoup.university_degree_jwt_vc_json_presentation, com.protocolsoup.university_degree_ldp_vc_presentation) and answers any other with a 400 whose error is invalid_scope.
  • When several stored credentials satisfy a request, the wallet presents the one that is active and only changes it when the request names another configuration or format, so a batch copy that is bound to another proof key is not presented in its place.
  • The harness presents to response_mode=direct_post.jwt requests by reading the verifier’s ephemeral ECDH-ES response-encryption key from client_metadata.jwks, binding its RFC 7638 thumbprint into the OpenID4VPHandover for mdoc, and returning an ECDH-ES JWE (A256GCM when the verifier advertises it, else A128GCM). For x509_hash, the request object’s x5c chain must validate to system roots or a root configured in WALLET_VERIFIER_X509_TRUST_ANCHOR_PEM; the chain cannot establish its own trust. Looking Glass OID4VP /submit issues the selected HAIP key-attested configuration, then presents. Missing attestation or key_storage that does not meet key_attestations_required is the issuer’s HTTP 400.
  • Key attestations: the wallet’s key attestations assert no key_storage or user_authentication. OpenID4VCI 1.0 Appendix D.2 defines each value as an assertion that key storage or user authentication resists an ISO/IEC 18045 attack potential, and this software wallet’s keys have had no such vulnerability analysis, so it backs no level and no setting makes it claim one. When a configuration’s key_attestations_required names key_storage or user_authentication values, the wallet stops before the Token Request with a 400 that names them. Earlier releases read WALLET_KEY_ATTESTATION_KEY_STORAGE and WALLET_KEY_ATTESTATION_USER_AUTHENTICATION; both are removed and ignored if set.
  • Credential refresh: when a Token Response carries a refresh_token, the wallet keeps it with the Credential and the original client authentication. POST /api/refresh redeems it at the Token Endpoint (RFC 6749 Section 6), requests the Credential again without the End-User, and replaces the old one (OpenID4VCI 1.0 Section 14.5). ProtocolSoup’s issuer returns a refresh_token on the authorization_code grant.
  • After a successful HAIP presentation, the wallet follows a verifier-provided HTTPS redirect_uri when present. The SPA refuses navigation unless the URL is https with no userinfo and no loopback, private, or internal host.

An agent that hits this origin should start at GET /llms.txt (or Accept: text/markdown on /). The process also serves /.well-known/api-catalog, /.well-known/agent-skills/use-wallet-harness/SKILL.md, and RFC 8288 Link headers on the HTML UI. Indexed copies of those URLs live on docs.protocolsoup.com/llms.txt, the GitHub README, and agent discovery.

The HTTP JSON API (POST /api/issue, POST /api/import, POST /api/resolve, POST /api/present, GET /api/session, POST /submit) is the headless interface. QR and deeplinks are human handoffs. This image is not an MCP server; apex /mcp is read-only catalog/decode and does not proxy the wallet. API errors use a stable error token plus error_description, not RFC 9457.