Presentation Exchange
In this guide, we'll cover the process of presenting Verifiable Credentials (VCs) to a verifier. This process is known as a Presentation Exchange (PEX) and involves selecting credentials that satisfy a Presentation Definition, creating a presentation based on that definition, and submitting the presentation to a verifier. PEX is typically executed by the user's Wallet application, acting on behalf of the user.
Before presenting VCs in a PEX, it's important to note that the VCs would have already been created, signed in a JWT format, and stored in the user's Wallet application.
Presentation Definition​
The entity requesting credentials, aka the verifier, will have defined the presentation requirements using a Presentation Definition. This definition specifies the criteria that the VCs need to meet.
Assume a lender has an existing Presentation Definition specifying that applicants must provide VCs to prove their legal name, date of birth, and employment status:
Presentation Definition
We'll use the Presentation Definition above to present credentials that meet its requirements.
Import PresentationExchange​
All methods needed to perform a PEX are in the PresentationExchange
class.
You can import this class from the @web5/credentials
package:
import { PresentationExchange, VerifiablePresentation } from '@web5/credentials';
Select Credentials​
A user may possess multiple credentials.
To preserve the user's privacy, when creating a Presentation, you'll want to present only the VCs that match the Presentation Definition requirements.
This is done with the selectCredentials()
method:
Satisfy Presentation Definition​
To ensure that the selected credentials collectively satisfy all of the Presentation Definition's requirements, call the satisfiesPresentationDefinition()
method:
This method will throw an error if all requirements of the Presentation Definition are not satisfied.
Create Presentation​
Once you've confirmed that the VCs successfully satisfy the Presentation Definition, you can create a presentation using the createPresentationFromCredentials()
method:
This method returns a PresentationResult
which contains the presentation:
{
"vpDataModel": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiablePresentation"
],
"id": "urn:uuid:7747d88c-17be-40e0-a10a-0481b330581e",
"holder": "did:dht:99tgimyf665zdntupjf88yoi8q656g15j8z87r4kdg45578mwacy",
"verifiableCredential": [
[
"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDprZXk6ejZNa2VyNDlDbnVnN2hzdkhEZ3Y0NHl2cGR2dE1oNHlMaURYeFM2N2huclVodHQyI3o2TWtlcjQ5Q251Zzdoc3ZIRGd2NDR5dnBkdnRNaDR5TGlEWHhTNjd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UdabkJuYWpWbGFFRm1ZWFI1YzFOa2MwNVNWbVpMYkhwUWRqTjVkeUo5TENKemRXWm1hWGhFWVhSaElqcDdJbVJsYkhSaFNHRnphQ0k2SWtWcFF6ZGZjMXBzTW1wMVVXNUdhRVJIV1RSb2NFVTRiMlF4YVU5MWRuZG1PVFJ5TVVkbk9HMWFWbVJCVmxFaUxDSnlaV052ZG1WeWVVTnZiVzFwZEcxbGJuUWlPaUpGYVVKdU5sTnJiSEpWYzNKdVFuaFJPVXBqVXkxTlNVaGtWelYwTXpRM1MxWjNaMXBwVEZwMFQwcDRRVkYzSW4xOSIsIm5hbWUiOiJhbGljZSBib2IiLCJkYXRlT2ZCaXJ0aCI6IjEwLTAxLTE5OTAifX19.mNCDv_JntH-wZpYONKNL58UbOWaYXCYJO_HPI_WVlSgwzo6dhYmV_9qtpFKd_exFb-aaEYPeSE43twWlrJeSBg"
]
],
"presentationResult": {
"presentation": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://identity.foundation/presentation-exchange/submission/v1"
],
"type": [
"VerifiablePresentation",
"PresentationSubmission"
],
"presentation_submission": {
"id": "WOiGWyQL7gdsfpvllAySZ",
"definition_id": "presDefIdloanAppVerification123",
"descriptor_map": [
{
"id": "employmentVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[0]"
},
{
"id": "dobVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[1]"
},
{
"id": "nameVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[1]"
}
]
},
"verifiableCredential": [
"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDprZXk6ejZNa2VyNDlDbnVnN2hzdkhEZ3Y0NHl2cGR2dE1oNHlMaURYeFM2N2huclVodHQyI3o2TWtlcjQ5Q251Zzdoc3ZIRGd2NDR5dnBkdnRNaDR5TGlEWHhTNjdobnJVaHR0MiJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtlcjQ5Q251Zzdoc3ZIRGd2NDR5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WVhSaElqcDdJbVJsYkhSaFNHRnphQ0k2SWtWcFF6ZGZjMXBzTW1wMVVXNUdhRVJIV1RSb2NFVTRiMlF4YVU5MWRuZG1PVFJ5TVVkbk9HMWFWbVJCVmxFaUxDSnlaV052ZG1WeWVVTnZiVzFwZEcxbGJuUWlPaUpGYVVKdU5sTnJiSEpWYzNKdVFuaFJPVXBqVXkxTlNVaGtWelYwTXpRM1MxWjNaMXBwVEZwMFQwcDRRVkYzSW4xOSIsIm5hbWUiOiJhbGljZSBib2IiLCJkYXRlT2ZCaXJ0aCI6IjEwLTAxLTE5OTAifX19.mNCDv_JntH-wZpYONKNL58UbOWaYXCYJO_HPI_WVlSgwzo6dhYmV_9qtpFKd_exFb-aaEYPeSE43twWlrJeSBg"
]
},
"presentationSubmissionLocation": 1,
"presentationSubmission": {
"id": "WOiGWyQL7gdsfpvllAySZ",
"definition_id": "presDefIdloanAppVerification123",
"descriptor_map": [
{
"id": "employmentVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[0]"
},
{
"id": "dobVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[1]"
},
{
"id": "nameVerification",
"format": "jwt_vc",
"path": "$.verifiableCredential[1]"
}
]
}
}
}
}
Validate Presentation Submission​
Before submitting the presentation to a lender, you can validate the Presentation via the validateSubmission()
method:
The information regarding Checked
objects is only applicable to the JavaScript SDK.
This method checks the presentation submission for any errors, returns an array of Checked
objects representing the validation checks performed on the presentation submission:
[ Checked { tag: 'root', status: 'info', message: 'ok' } ]
Each Checked
object contains:
- tag: the path,
root
of the submission that was checked - status: the result of the check, which is
info
for successful checks orerror
for failed checks - message: shows
ok
if successful, and if unsuccessful this is where you'll find error messages
Verifiable Presentation​
Once the Presentation is error-free and has passed the validation checks, you can submit the Verifiable Presentation as a signed and encoded JWT to the lender for verification.
Was this page helpful?
Connect with us on Discord
Submit feedback: Open a GitHub issue
Edit this page: GitHub Repo
Contribute: Contributing Guide