Lion Cipher Lab

Present a verifiable credential with OpenID4VP (build the verifier and a wallet from scratch)

Why it matters

A verifiable credential is only useful once someone PRESENTS it to a relying party -- a bar checking age, a bank checking residency, a website checking a licence. OpenID for Verifiable Presentations (OpenID4VP) is the protocol the wallet ecosystem (the EU Digital Identity Wallet among them) standardizes that exchange on. It looks like OAuth, but the roles are inverted: in plain OAuth an authorization server issues a token to a client; in OpenID4VP the WALLET presents a credential it already holds and the relying party is the VERIFIER. The verifier opens the exchange with an Authorization…

What you'll learn

Steps in this lab

  1. The one idea: OpenID4VP is OAuth with the roles inverted
  2. Set up: a clean folder and two packages
  3. The toolkit and the issuer (oid4vp.py, part 1)
  4. The verifier's Authorization Request (presentation_definition + nonce + client_id)
  5. The wallet: match the definition, select disclosures, key-bind
  6. The verifier: the ordered checks, including the over-disclosure policy
  7. Run the happy path: reveal only age_over_18
  8. Break (a) -- replay to a DIFFERENT verifier: aud mismatch
  9. Break (b) -- reuse an old nonce: replay detected
  10. Break (c) -- no KB-JWT, or a KB-JWT the holder never signed
  11. Break (d) -- over-disclose beyond the presentation_definition
  12. Judgment: why holder binding is load-bearing, and OpenID4VP vs plain OAuth
  13. Clean up

Open the full interactive lab →