How should a wallet store the credentials it holds?
Credentials stored only in encrypted form and no longer than neededOID4VCI 1.0 §15.3SHOULDRoles: wallet
Requirement as recorded in the ProtocolSoup registry
Wallets SHOULD store Credentials only in encrypted form, and, wherever possible, use hardware-backed encryption. Wallets SHOULD not store Credentials longer than needed.
Read §15.3 in OID4VCI 1.0Self-test verdict
DeviationCommit 00bac3fEvaluated
This is ProtocolSoup's result against its own implementation at the commit shown. It is not a certification of ProtocolSoup or of any other product.
Captured from production
Captured Commit 00bac3f
Captured from the deployed ProtocolSoup at the commit shown. Every request and response is shown exactly as sent and received.
Passing exchange
Not captured: Credential storage happens inside the wallet process; no protocol message carries it.
Failing exchange
Not captured: Credential storage happens inside the wallet process; no protocol message carries it.
Tests
- TestGetOrCreateWalletPrunesExpiredEntries
./cmd/walletharness
Pass
Implementation
Decision record
Session-scoped in-memory credential storage is retained until the HashiCorp platform vault initiative. Cross-protocol security limitation for OID4VP presentations of the same held credentials; not an OID4VP normative storage deviation. Decision record is docs/packages/wallet.md (no separate ADR file).
Explainer
What this requires
Section 15.3: "Wallets SHOULD store Credentials only in encrypted form, and, wherever possible, use hardware-backed encryption. Wallets SHOULD not store Credentials longer than needed." These are two separate SHOULDs: encryption at rest, with hardware-backed keys where the platform has them, and a retention limit.
Both are recommendations, not requirements. A wallet that does not follow them is expected to have a reason and to state it.
Why it exists
The section opens with its reason: "To prevent a leak of End-User data, especially when it is signed, which risks revealing private data of End-Users to third parties, systems implementing this specification SHOULD be designed to minimize the amount of End-User data that is stored." A signed Credential is portable evidence. Anyone who copies it out of storage can show the claims to a third party with the issuer's signature attached, so stored copies are worth protecting and worth deleting once they are no longer needed.
What non-compliance looks like
Credentials written as plaintext to a database, a file or a browser store, readable by anything with access to that storage. Credentials kept indefinitely after the user stops using them, or copied into logs and backups that outlive the wallet entry.
How ProtocolSoup tests it
The hosted wallet deviates from the encryption recommendation, and records the decision in docs/packages/wallet.md; there is no separate ADR file. Credentials are held in process memory per session scope key, unencrypted, and nothing is written to disk. Wallet sessions expire after WALLET_SESSION_TTL of inactivity (default 20 minutes), and an expired session is removed the next time the store is accessed. Nothing survives a restart except the mdoc device key at WALLET_DEVICE_KEY_PATH, which is a key, not a Credential. The retention recommendation is therefore partly met: Credentials live only for the session. Hardware-backed encryption is not used. The documented reason is that durable encrypted storage is deferred until the platform vault initiative, because a temporary Fly-backed vault would be thrown away once storage moves to HashiCorp. The same in-memory store backs OID4VP presentations, which the registry treats as a cross-protocol limitation, not an OID4VP deviation.
TestGetOrCreateWalletPrunesExpiredEntries asserts that a wallet session past WALLET_SESSION_TTL is removed, with its Credentials, the next time the store is accessed. That covers the retention half. Nothing tests encryption at rest, because the wallet does not encrypt the Credentials it holds.