Wallet
Wallet (protocolsoup-wallet)
Section titled “Wallet (protocolsoup-wallet)”Image: ghcr.io/parlesec/protocolsoup-wallet
When To Use
Section titled “When To Use”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.
Runtime Contract
Section titled “Runtime Contract”| 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) |
Configuration
Section titled “Configuration”| 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.
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:latestThe 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.
Using your own wallet deployment
Section titled “Using your own wallet deployment”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:
-
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/.envand skip the local wallet:Terminal window echo 'WALLET_BACKEND_ORIGIN=https://wallet.example.com' >> docker/.envdocker compose up -d --build --scale wallet=0 --scale mdoc-trust-anchor=0 -
Make the stack’s issuer and verifier reachable from the wallet at the exact origin they advertise. Set
WALLET_TARGET_BASE_URLon the wallet to the stack’sSHOWCASE_BASE_URL. Outside that origin, the wallet only fetches public HTTPS hosts, so a wallet that is not on the stack’s network needsSHOWCASE_BASE_URLto be a public HTTPS origin. -
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.
OID4VCI Client
Section titled “OID4VCI Client”The wallet’s metadata-driven OID4VCI client supports:
- Pre-authorized and
authorization_codegrants (PAR + PKCE S256 when the AS requires/advertises PAR; client attestation + DPoP when HAIP attestation material is configured). After PAR, authorize redirects use onlyclient_id+request_uri; token uses the same client attestation as PAR. When AS metadata includeschallenge_endpoint, the wallet fetchesattestation_challengeand puts it in the Client Attestation PoP JWTchallengeclaim. The wallet UI opens AS authorization in a popup so the offer stays in the current tab (same-tab +sessionStoragerestore if popups are blocked). DPoPuse_dpop_nonceretries cover AS HTTP 400 and RS HTTP 401 challenges and mint a fresh client attestation PoPjtiwhen attestation headers are present. The same client can authorize for a protected resource viaPOST /api/import(discovery_url,resource_endpoint,scope) and GET that resource with DPoP after token exchange. Discovery documents are rejected whenissuerdoes 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 usesopenid-configuration;{issuer}/.well-known/oauth-authorization-serveris not fetched. - When issuer metadata advertises
batch_credential_issuance, the wallet requests multiple pairwise-distinct JWT proofs (capped bybatch_size) and matches returned credentials by holder-key binding rather than array order. For a Credential Configuration bound to a DID (cryptographic_binding_methods_supportedlists DID methods and neitherjwknorcose_key), each proof names its key with akidthat is a DID URL in place of thejwkheader (OID4VCI 1.0 Appendix F.1): the wallet’s owndid:keyordid:jwkwhen the issuer lists that method and the DID holds the active key, otherwise adid:jwkordid:keyof the key. HAIP batch proofs share one Key Attestation JWT whoseattested_keyslists every proof key (HAIP 1.0 Section 4.5.1). Formso_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 setscredential_request_encryption.encryption_requiredor the wallet includescredential_response_encryption(OID4VCI 1.0 §8.2 / §9). Advertising request-encryption JWKs withencryption_requiredfalse 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_acceptedwith DPoP +x-fapi-interaction-id, HTTP 204), and token-responsecredential_identifiers - Fail-closed issuer metadata trust (
credential_issuermust match the offer) - mdoc IACA verification via
WALLET_MDOC_IACA_ROOT_PEMbefore storage
Operational Notes
Section titled “Operational Notes”- 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 atWALLET_DEVICE_KEY_PATHpersists across restarts. WALLET_TARGET_BASE_URLmust 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’ssub, is separate from the wallet’s holder DID. - A session has one wallet, and its holder DID (
wallet_subjectin responses) is derived from the wallet’s own key byWALLET_DID_METHOD.wallet_subjectis no longer a request field: the/api/*endpoints refuse unknown fields, so a body that still sends it is answered 400invalid_request. - The wallet must independently trust the issuer’s mdoc IACA root through
WALLET_MDOC_IACA_ROOT_PEM. Copy the issuer’s publiciaca_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 storingmso_mdoccredentials. - Hosted ProtocolSoup CI copies the showcase verifier request-signer CA into
WALLET_VERIFIER_X509_TRUST_ANCHOR_PEMso Looking Glassx509_hash/x509_san_dnspresentations can validate the livex5cchain. - Keep strict session isolation enabled in shared environments.
- Use narrow CORS origin allow-lists outside local development.
- External
request_uriand issuer fetches resolve DNS and refuse non-public destinations, including redirect hops. Failed fetches do not reflect upstream response bodies. Pre-patch wallet tagsv2.0.0–v4.1.0are 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 onprotocolsoup.com(see frontendWALLET_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 rejectverifier_attestationrequest objects even when the JWT signature is valid. - Set
WALLET_DEVICE_KEY_PATHto a durable file formso_mdoc(ISO/IEC 18013-5) credentials: the device key bound at issuance must be reused to sign theDeviceResponse, so regenerating it silently breaks every stored mdoc credential’s device binding. - Set
WALLET_MDOC_IACA_ROOT_PEMto 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 asPOST /wallet-harness/api/import). The wallet returns_protocol_exchanges— the real wallet→issuer hops Looking Glass renders as glass-box steps — plus_looking_glass_eventsfor proof JWT construction. Issuer-initiated Looking Glass creates/delivers an offer and observesstatus_urimilestones, 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/submitalso 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 forrequest_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’sextrasays 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 addsrequest_plaintextorresponse_plaintext: the exact bytes the wallet encrypted or decrypted. The Authorization Response of adirect_post.jwtrequest is recorded the same way: the body is the form whoseresponseis the JWE, andrequest_plaintextis the JSON the wallet encrypted, with thevp_tokenobject in it.- Wallet-initiated issuance: paste a Credential Issuer identifier (or
/.well-known/openid-credential-issuermetadata URL). The wallet fetches metadata, listscredential_configurations_supported, and startsauthorization_codeonly after the holder selects a configuration. Do not paste Authorization Serveropenid-configuration/oauth-authorization-serverURLs 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_uriis single-use). Used Issue steps collapse; Request again and Continue to Issuer stay on the collapsed headers. - After an issued Data Integrity
ldp_vcis received, the wallet verifies its proof under the issuer’sjwks_urikeys and under the key of the proof’sverificationMethodwhen 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’scontrollerand itsassertionMethodrelationship, and refuses a revoked or expired method. Adid:weborhttpsmethod 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_urifrom Credential Issuer Metadata and RFC 8414 Authorization Server metadata. ProtocolSoup OID4VCI advertisesjwks_urias{issuer}/.well-known/jwks.json. It does not GET/.well-known/jwt-vc-issuer(SD-JWT VC Issuer Metadata is not a JWK Set). HAIPdc+sd-jwtholder binding is RFC 7800cnf(typicallycnf.jwk); a missing JWTsubis not a bind failure. - A W3C credential (
jwt_vc_json,jwt_vc_json-ld,ldp_vc) names its holder incredentialSubject.id. The wallet stores it in the format the Credential Configuration named, and presents ajwt_vc_jsonorldp_vccredential as that DID only when the DID is the wallet’s own subject or adid:jwkordid:keyof the wallet’s active key; otherwise it refuses, because the verifier retrieves the presentation key from the DID. Thevp_tokenis the JSON object keyed by Credential Queryid(OpenID4VP 1.0 Section 8.1): ajwt_vc_jsonPresentation is a JWT string withtypJWT,issthe holder DID, and the requestnonceand Client Identifier asnonceandaud(Appendix B.1.3.1.5); anldp_vcPresentation is a JSON object whose proof carries them aschallengeanddomain(Appendix B.1.3.2.5). The wallet sends neither when the presentation’salg, proof type or cryptosuite is not in the Verifier’svp_formats_supported(Appendix B.1.3.1.3, B.1.3.2.3). Ajwt_vc_json-ldcredential 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). Forldp_vcthose are theissuerandissuanceDateproperties. In the JWT encoding they areissandnbf, andsub,jtiandexphave to be present and equal whenever thevcclaim carriescredentialSubject.id,idorexpirationDate(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
scopein place ofdcql_queryis answered as the DCQL query the value is an alias for (OpenID4VP 1.0 Section 5.5), withvp_tokenkeyed 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 whoseerrorisinvalid_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.jwtrequests by reading the verifier’s ephemeral ECDH-ES response-encryption key fromclient_metadata.jwks, binding its RFC 7638 thumbprint into theOpenID4VPHandoverfor mdoc, and returning an ECDH-ES JWE (A256GCM when the verifier advertises it, else A128GCM). Forx509_hash, the request object’sx5cchain must validate to system roots or a root configured inWALLET_VERIFIER_X509_TRUST_ANCHOR_PEM; the chain cannot establish its own trust. Looking Glass OID4VP/submitissues the selected HAIP key-attested configuration, then presents. Missing attestation orkey_storagethat does not meetkey_attestations_requiredis the issuer’s HTTP 400. - Key attestations: the wallet’s key attestations assert no
key_storageoruser_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’skey_attestations_requirednameskey_storageoruser_authenticationvalues, the wallet stops before the Token Request with a 400 that names them. Earlier releases readWALLET_KEY_ATTESTATION_KEY_STORAGEandWALLET_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/refreshredeems 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 arefresh_tokenon the authorization_code grant. - After a successful HAIP presentation, the wallet follows a verifier-provided HTTPS
redirect_uriwhen present. The SPA refuses navigation unless the URL ishttpswith no userinfo and no loopback, private, or internal host.
Agent discovery
Section titled “Agent discovery”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.