Skip to content

Add support for di_vp proofs in credential requests as PoP - #257

Merged
TimoGlastra merged 5 commits into
openwallet-foundation-labs:mainfrom
S3bb1:main
Jul 2, 2026
Merged

Add support for di_vp proofs in credential requests as PoP#257
TimoGlastra merged 5 commits into
openwallet-foundation-labs:mainfrom
S3bb1:main

Conversation

@S3bb1

@S3bb1 S3bb1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@openid4vc/openid4vci supports two key proof types for Proof of Possession (PoP) in credential requests: jwt and attestation. The OID4VCI spec also defines a third: di_vp, where the wallet proves key possession by sending a W3C Verifiable Presentation secured with a Data Integrity Proof (e.g. ecdsa-sd-2023, eddsa-2022) instead of a JOSE-signed JWT.

This PR Adds support for the OID4VCI di_vp key proof type used as an alternative Proof of Possession mechanism alongside the existing jwt and attestation proof types.

  • Request side: di_vp is now a recognized proof type in the credential request schemas instead of being silently stripped by Zod.
  • Issuer/verification side: adds Openid4vciIssuer.verifyCredentialRequestDiVpProof(...), mirroring the existing verifyCredentialRequestJwtProof. It performs structural validation of the required Data Integrity fields before delegating actual cryptographic verification to a new optional verifyDataIntegrityProof callback on CallbackContext.

@S3bb1
S3bb1 requested a review from a team as a code owner July 1, 2026 14:02
@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 63d81cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@openid4vc/oauth2 Patch
@openid4vc/openid4vci Patch
@openid4vc/openid4vp Patch
@openid4vc/utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Signed-off-by: Sebastian Dechant <763247+S3bb1@users.noreply.github.com>
S3bb1 added 2 commits July 1, 2026 16:05
Signed-off-by: Sebastian Dechant <763247+S3bb1@users.noreply.github.com>
/**
* The di_vp proof — a W3C Verifiable Presentation
*/
vp: Record<string, unknown>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To align with the current patterns of this library, if we are digging into this structure, we should add a zod schema for this to ensure type safety at runtime

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a zod validator for the vp :)

Comment on lines +7 to +9
// No JSON-LD/VC/DataIntegrity schema exists in this library and it's not this library's job to
// validate that structure — that's the caller's job via its own stack. Loose passthrough is
// intentional.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this kinda makes sense, but verifyCredentialRequestDiVpProof contradicts that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah the check follows the same patterns as the other proof-types, like the jwt is checking just that the string contains "a" compacted jwt string and not the decoded things. I can remove the comment. WDYT?

@TimoGlastra TimoGlastra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! a few small comments

S3bb1 added 2 commits July 2, 2026 07:42
Signed-off-by: Sebastian Dechant <763247+S3bb1@users.noreply.github.com>
Signed-off-by: Sebastian Dechant <763247+S3bb1@users.noreply.github.com>
@S3bb1
S3bb1 requested a review from TimoGlastra July 2, 2026 12:25
@TimoGlastra
TimoGlastra merged commit 9c4c66c into openwallet-foundation-labs:main Jul 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants