❗ Important! Before you proceed, please read the EUDI Wallet Reference Implementation project description
Presentation Exchange v2 is a specification that defines:
- A way for the
Verifierto describe proof requirements in terms ofPresentationDefintionobject - A way for the
Holderto describe submissions of proofs that allign with those requirements in terms of aPresentationSubmission
The use of this specification is mandatory by OpenID4VP
-
As a
Verifierbe able to- produce a valid
PresentationDefinitionin order to be communicated to aHolderusing a protocol likeOpenID4VP - decide whether a given
PresentationSubmissionsatisfies a specificPresentationDefinition
- produce a valid
-
As a
Holder/Walletbe able to- parse/validate a
PresentationDefition - to check if a claim stored in the wallet satisfies a
PresentationDefinition - to produce a
PresentationSubmissiongiven a validPresentationDefintionand a matchingClaim
- parse/validate a
| Feature | Status |
|---|---|
| Submission requirement | ❌ |
| Predicate | ❌ |
| Relational constraint | ❌ |
| Credential status constraint | ❌ |
| JSON-LD framing | ❌ |
| Retention | ❌ |
import PresentationExchange
let matcher = PresentationMatcher()
let presentationDefinition = ...
let claims = ...
let match = matcher.match(
claims: claims,
with: presentationDefinition
)
switch matched {
case .matched(let matches):
...
case .notMatched:
...
}In the resources folder there are several
examples of PresentationDefintion JSON objects taken from directly from the
specification
Precondition:
- Verifier should know the data model of the claim(s) that wants to be presented by the holder
- Verifier should be able to describe which formats (jwt, jwt_vc, ldp_vc etc.) and which algorithms is able to process
Library should offer a factory/builder to produce the PresentationDefinition.
The resulting PresentationDefinition should
- Adhere to the data model defined in the spec (JSON Schema validation)
- Contain valid JSONPath expressions
In order to create a presentation definition just instantiate the PresentationDefinition data class which enforces the syntactic a conditional rules as defined in the specification.
The holder should be able to verify that a JSON object is a syntactically valid PresentationDefintion:
- Adheres to the data model defined in the spec (JSON Schema validation)
- Contain valid JSONPath expressions
- JSONSchema support: JSON Schema
- JSONPath support: Sextant
- Lint support: SwiftLint
- JWS, JWE, and JWK support: JOSESwift
- Testing support: Mockingbird