An implementation prototype for the issue-credential and present-proof Aries standards for Veramo Agent. This implementation allows you to send and handle DIDComm messages based on these Aries RFCs.
In addition, this plugin comes with a custom DataStore plugin that extends the original Veramo DataStore and adds support for registering and verifying credential schemas.
- Aries RFC 0453: Issue Credential Protocol 2.0
- Aries RFC 0454: Present Proof Protocol 2.0
These are the attachment format standards used for the messages:
- Aries RFC 0593: JSON-LD Credential Attachment format for requesting and issuing credentials.
- Aries RFC 0510: Presentation-Exchange Attachment format for requesting and presenting proofs.
Add the corresponding plugins. Two new MessageHandlers, custom datastores and CredentialFlow.
export const veramoAgent = createAgent<VeramoAgent>({
plugins: [
new MessageHandler({
messageHandlers: [
new DIDCommMessageHandler(),
new IssueCredentialHandler(),
new PresentProofHandler(),
],
}),
new DataStore(dbConnection),
new DataStoreORM(dbConnection),
new CredentialFlow(),
],
});
In this section, we are going to explain how this plugin works and the differences it may have with the respective specification.
This handler supports the four message types defined in the specification.
- propose-credential
- offer-credential
- request-credential
- issue-credential
Here we are going to explain how each one works.
Holder sends a propose-credential
message to credential Issuer. The Issuer retrieves the credential_preview
attribute from received message and checks whether any credential schema with strict compatible claims is registered. The attributes from the credential_preview
must be a subset of the attributes from a credential schema.
If there is any compatible schema, Issuer generates corresponding verifiable credentials without proof and sends offer-credential
to Holder.
Note:
The mechanism used in the specification may not be very useful when discussing the claims a credential should have. In the offer-credential
message, the specification introduces the attribute multiple_available
. This attribute is used to communicate to the Holder that there are multiple credentials of the same type available to be issued, but it does not provide information about the specific claim values associated with each credential.
Once Holder has received offer message from Issuer, he can receive the list of available credentials to request. If Holder already knows what type of credentials wants he can start the communication with a request-credential
message.
Issuer receives request-credential
, checks whether credential type requested is one he can issue and then creates the verifiable credential. In this process, the issuer also checks whether he has already issued the same credential type for the specific holder's DID. If this is the case, the issuer adds a replacement_id
attribute to the message. This attribute contains the hash of the previously issued credential, allowing the holder to overwrite it in their wallet.
Note:
As this is a prototype, the Issuer uses default-values
for the different claims. In a production environment, the Issuer would retrieve this information from the database for accurate values.
This handler supports the three message types defined in the specification.
- propose-presentation
- request-presentation
- presentation
Here we are going to explain how each one works.
These message types serve as communication starters for this standard. Propose-presentation
is used when a holder wants to initiate the communication flow with a verifier. In this case, the holder does not need to know which schemas the verifier supports, so they can propose a credential type. If the verifier accepts the received credential type, he proceeds to send a request-presentation
and wait for the holder to generate a verifiable presentation. Once the presentation is received, the verifier checks both the signatures from the holder and the issuer.
Note:
When generating a request, the verifier specifies and saves a challenge for the holder to generate the presentation. Once received the presentation, the verifier retrieves last request-presentation
sent to presentation holder.
The CredentialFlow class is the element that allows to send the different message types. You can only send the messages that the specification define as communication starters. Holder to Issuer: propose and request, and Issuer to Holder: offer.
Note: This is CredentialFlow plugin interface.
sendProposeCredential(
args: {
credentialPreview: ICredentialPreview;
issuer: string;
},
context: IContext
): Promise<void>;
sendOfferCredential(
args: {
credentialType: string;
holder: string;
},
context: IContext
): Promise<void>;
sendRequestCredential(
args: {
credentialType: string;
issuer: string;
},
context: IContext
): Promise<void>;
sendProposePresentation(
args: {
credentialType: string;
verifier: string;
},
context: IContext
): Promise<void>;
sendRequestPresentation(
args: {
credentialType: string;
holder: string;
},
context: IContext
): Promise<void>;
We have prepared some npm scripts in case a demonstration is needed to showcase how this plugin works and how to initiate communication.
The demo is deployed locally and uses Ganache blockchain as verifiable registry. Therefore, it is necesary to start a Ganache node on the localhost. The demo agent connects to ws://localhost:8545, which is the default endpoint when a Ganache network is started.
In addition, this demo generates and uses did:ethr
identifiers. The Ethereum DID method adds an extra part for identifying the network on which the smart contract is deployed. In the case of working on localhost, the identifiers will start with: did:ethr:development:
.
In order to send and receive any DIDComm messages, there are some prerequisites that need to be fulfilled. The user must have:
- A decentralized identifier.
- A DIDComm Messaging endpoint defined in that DID document.
- A functioning endpoint listening to the specified address.
In order to meet the needs listed above, follow the next steps.
Veramo allows to register new identifiers with an alias. For this case every new identifier is set to default
and previous default DID alias is changed to a random uuid.
iillan@iillan-lap:~/code/veramo/credential-flow-plugin$ npm run addIdentifier
> [email protected] addIdentifier
> node dist/__tests__/addIdentifier.js
New identifier created: did:ethr:development:0x03fd13a4619968dbcef148d7c39de98773dfe7439d800eaa7e72dec85327493d68
For this demo endpoints are deployed on local host so user just have to specify desired port.
iillan@iillan-lap:~/code/veramo/credential-flow-plugin$ npm run addMessagingSvc 9999
> [email protected] addMessagingSvc
> node dist/__tests__/addMessagingSvc.js "9999"
Added DIDCommMessaging Service on port: 9999
txHash:0xe7f46db78d44f26d599bed12ce7399d9b32353164ca17179b70e8fb786436498
Now it is time to deploy the endpoint and wait for new messages.
Note: To reproduce the demo, you will need two agents, which implies having two terminal endpoints, as well as two additional terminals for executing the scripts.
iillan@iillan-lap:~/code/veramo/credential-flow-plugin$ npm run startMessagingSvc
> [email protected] startMessagingSvc
> node dist/__tests__/startMessagingSvc.js
DIDCommMessaging Service listening on port: 9999
First, we are going to demonstrate how a user can acquire a credential, and then we will explain the process of presenting and verifying that credential.
For the next scenarios, you will need two different agents to fulfill different roles. This can be as simple as cloning the repository and then copying the generated directory into a new one. Take note of the working directory where you should execute the scripts.
Note:
At any moment, if you want to check the structure of the complete message, you can use the script npm run getMessage
. This script receives the message ID as an argument and retrieves it from the SQLite database used by Veramo.
The user may not know exactly which credential type they want, so he generates a credential_preview
with the desired attributes and values he would like to receive.
Example credential_preview
{
"@type": "https://didcomm.org/issue-credential/2.0/credential-preview",
"attributes": [
{
"name": "grado",
"value": "Universitario"
},
{
"name": "titulo",
"value": "Ingenieria Informatica"
}
]
}
iillan@iillan-lap:~/holder$ npm run sendProposeVC did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143
> [email protected] sendProposeVC
> node dist/__tests__/sendProposeCred.js "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
Sent Propose Credential: bb526ae7-f005-4350-9f8d-045649d008a2
Propose-credential message
{
"id": "bb526ae7-f005-4350-9f8d-045649d008a2",
"type": "https://didcomm.org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ZSI6InRpdHVsbyIsInZhbHVlIjoiSW5nZW5pZXJpYSBJbmZvcm1hdGljYSJ9XX0sImZvcm1hdHMiOlt7ImF0dGFjaF9pZCI6IjFkN2M2MWU4LWVjNWMtNDNhZC1iMjI5LWE3ZmU2MTFmNWY2MCIsImZvcm1hdCI6ImFyaWVzL2xkLXByb29mLXZjLWRldGFpbEB2MS4wIn1dLCJmaWx0ZXJzfmF0dGFjaCI6W3siQGlkIjoiMWQ3YzYxZTgtZWM1Yy00M2FkLWIyMjktYTdmZTYxMWY1ZjYwIiwibWltZS10eXBlIjoiYXBwbGljYXRpb24vanNvbiIsImRhdGEiOnsiY3JlZGVudGlhbCI6eyJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIl0sImlzc3VlciI6ImRpZDpldGhyOmRldmVsb3BtZW50OjB4MDJhN2I0OTg0ZWNiMTliN2M1YTI5ODY3MzVlNWQ1MTkyNGE5NzY3MzIzZjVkMGUzNzUxNmRkMjU2ZTg3NDIwMTQzIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyNTg2MmJhZjJjZGI2OTM3ZjlmZWY0NTRkYTNkYTk2ZmU5MjU3NjRiOWI5MzYyNTA3ZjczMmQxYmQwOWU5NzAyZiJ9fSwib3B0aW9ucyI6eyJwcm9vZlR5cGUiOiJFY2RzYVNlY3AyNTZrMVJlY292ZXJ5U2lnbmF0dXJlMjAyMCJ9fX1dfX0\",\"signature\":\"a6YH_Jpu1z8uGByCQfAst1ry6AmT4ZmeJF-CYTuKCx5U05PYajYswpWffp7m4AiDyb9ULCDg-lYYbJfLwqJrfA\"}",
"data": {
"@type": "https://didcomm.org/issue-credential/2.0/propose-credential",
"@id": "bb526ae7-f005-4350-9f8d-045649d008a2",
"credential_preview": {
"@type": "https://didcomm.org/issue-credential/2.0/credential-preview",
"attributes": [
{
"name": "grado",
"value": "Universitario"
},
{
"name": "titulo",
"value": "Ingenieria Informatica"
}
]
},
"formats": [
{
"attach_id": "1d7c61e8-ec5c-43ad-b229-a7fe611f5f60",
"format": "aries/[email protected]"
}
],
"filters~attach": [
{
"@id": "1d7c61e8-ec5c-43ad-b229-a7fe611f5f60",
"mime-type": "application/json",
"data": {
"credential": {
"type": ["VerifiableCredential"],
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f"
}
},
"options": {
"proofType": "EcdsaSecp256k1RecoverySignature2020"
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"to": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
}
Once Holder sends propose message, we should see something like this on Issuer endpoint terminal.
// Issuer terminal
Received Message from: did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f
Message type: https://didcomm.org/issue-credential/2.0/propose-credential
Propose Credential ID: bb526ae7-f005-4350-9f8d-045649d008a2
Proposed credential type: VerifiableCredential
Attributes from credential_preview: grado,titulo
Compatible credentialSchemas: [{"type":"UniversityDegreeCredential","attributes":"grado,titulo"}]
Saved Message: 9dd200dc-3333-4306-bef6-1559f6c645b7
Sent Offer Credential: 9dd200dc-3333-4306-bef6-1559f6c645b7
The issuer checks whether he can issue that specific type of credential. If he is able to do so, he proceeds to generate and send the offer.
Holder receives an offer with the possible credentials he can request. In this example, he proposed attributes that match the UniversityDegreeCredential schema. What the holder receives are the potential credentials, which are not verifiable because they are sent without the proof attribute.
// Holder terminal
Received Message from: did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143
Message type: https://didcomm.org/issue-credential/2.0/offer-credential
Offer Credential ID: 9dd200dc-3333-4306-bef6-1559f6c645b7
Credential offers~attach list: {
"credential": {
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": [
"VerifiableCredential",
"UniversityDegreeCredential"
],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
}
},
"options": {
"proofType": "EcdsaSecp256k1RecoverySignature2020"
}
}
Offer-credential message
{
"id": "9dd200dc-3333-4306-bef6-1559f6c645b7",
"type": "https://didcomm.org/issue-credential/2.0/offer-credential",
"raw": "{\"protected\":\"eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyYTdiNDk4NGVjYjE5YjdjNWEyOTg2NzM1ZTVkNTE5MjRhOTc2NzMyM2Y1ZDBlMzc1MTZkZDI1NmU4NzQyMDE0MyNjb250cm9sbGVyIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1zaWduZWQranNvbiJ9\",\"payload\":\"eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9pc3N1ZS1jcmVkZW50aWFsLzIuMC9vZmZlci1jcmVkZW50aWFsIiwidG8iOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyNTg2MmJhZjJjZGI2OTM3ZjlmZWY0NTRkYTNkYTk2ZmU5MjU3NjRiOWI5MzYyNTA3ZjczMmQxYmQwOWU5NzAyZiIsImZyb20iOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyYTdiNDk4NGVjYjE5YjdjNWEyOTg2NzM1ZTVkNTE5MjRhOTc2NzMyM2Y1ZDBlMzc1MTZkZDI1NmU4NzQyMDE0MyIsImlkIjoiOWRkMjAwZGMtMzMzMy00MzA2LWJlZjYtMTU1OWY2Yz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b3ZlcnlTaWduYXR1cmUyMDIwIn19fV19fQ\",\"signature\":\"a2A63ccVc5D4hSH2B3riZ3hHDa70T3x6_f76lnfOUMd8EmmCsRclznJ4cMLTn0LRh7JVPsjQB5M6sp62y-YZJA\"}",
"data": {
"@type": "https://didcomm.org/issue-credential/2.0/offer-credential",
"@id": "9dd200dc-3333-4306-bef6-1559f6c645b7",
"comment": "These are the credentials we can offer",
"formats": [
{
"attach_id": "3b800dc8-d8a3-48e8-8f48-4f1b2bc7aca8",
"format": "aries/[email protected]"
}
],
"offers~attach": [
{
"@id": "3b800dc8-d8a3-48e8-8f48-4f1b2bc7aca8",
"mime-type": "application/json",
"data": {
"credential": {
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
}
},
"options": {
"proofType": "EcdsaSecp256k1RecoverySignature2020"
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"to": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f"
}
Now that Holder knows which verifiable credential he can request, he proceeds to do so.
iillan@iillan-lap:~/holder$ npm run sendRequestVC did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143 UniversityDegreeCredential
> [email protected] sendRequestVC
> node dist/__tests__/sendRequestCred.js "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143" "UniversityDegreeCredential"
Sent Request Credential: 11f027ca-d0bc-4fb2-bb3a-6c5269cd6949
When the issuer receives the request-credential
message, he checks whether he knows the credential type. This seems unnecessary because the issuer has already done it when generating the offer, but remember that may not always be the case; the holder may start the communication flow directly with a request. Additionally, the issuer also looks for previously generated credentials for the holder's DID.
// Issuer terminal
Received Message from: did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f
Message type: https://didcomm.org/issue-credential/2.0/request-credential
Request Credential ID: 11f027ca-d0bc-4fb2-bb3a-6c5269cd6949
Requested credential type: VerifiableCredential,UniversityDegreeCredential
Extracted data from message
Looking for credentialSchema: UniversityDegreeCredential
Found credentialSchema.
Cheking for previous credentials...
Found: 0
Creating verifiable credential.
Saved Message: fb7c1e52-22e0-463b-af42-70d71dc16225
Sent Issue Credential: fb7c1e52-22e0-463b-af42-70d71dc16225
Request-credential message
{
"id": "11f027ca-d0bc-4fb2-bb3a-6c5269cd6949",
"type": "https://didcomm.org/issue-credential/2.0/request-credential",
"raw": "{\"protected\":\"eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyNTg2MmJhZjJjZGI2OTM3ZjlmZWY0NTRkYTNkYTk2ZmU5MjU3NjRiOWI5MzYyNTA3ZjczMmQxYmQwOWU5NzAyZiNjb250cm9sbGVyIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1zaWduZWQranNvbiJ9\",\"payload\":\"eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9pc3N1ZS1jcmVkZW50aWFsLzIuMC9yZXF1ZXN0LWNyZWRlbnRpYWwiLCJ0byI6ImRpZDpldGhyOmRldmVsb3BtZW50OjB4MDJhN2I0OTg0ZWNiMTliN2M1YTI5ODY3MzVlNWQ1MTkyNGE5NzY3MzIzZjVkMGUzNzUxNmRkMjU2ZTg3NDIwMTQzIiwiZnJvbSI6ImRpZDpldGhyOmRldmVsb3BtZW50OjB4MDI1ODYyYmFmMmNkYjY5MzdmOWZlZjQ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Avzr-b0pBEmLPW6p5lO_UO6VD2RR3uXpn_RCtDPWWisjU_luJC_vT_AreExX43TehEi-Og\"}",
"data": {
"@type": "https://didcomm.org/issue-credential/2.0/request-credential",
"@id": "11f027ca-d0bc-4fb2-bb3a-6c5269cd6949",
"formats": [
{
"attach_id": "31e6ee93-c3e1-4d73-b85f-a2c656a084c4",
"format": "aries/[email protected]"
}
],
"requests~attach": [
{
"@id": "31e6ee93-c3e1-4d73-b85f-a2c656a084c4",
"mime-type": "application/json",
"data": {
"credential": {
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f"
}
},
"options": {
"proofType": ""
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"to": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
}
Once the holder has received the requested verifiable credential, he can retrieve it from the message and verify it. The credential is then stored in the "wallet" for future use.
// Holder terminal
Received Message from: did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143
Message type: https://didcomm.org/issue-credential/2.0/issue-credential
Issue Credential ID: fb7c1e52-22e0-463b-af42-70d71dc16225
Verifiable Credential: ...
Verifiable Credential
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"grado": "https://schema.org/",
"titulo": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "0a5c496a-6981-4dd6-9708-3edd5b4f321f",
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
},
"issuanceDate": "2023-07-04T06:56:15.947Z",
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:56:15Z",
"verificationMethod": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143#controller",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..3YvBe4kvP3uao97-QMBquYWTjbsCHlbV8fuZHiw2hY1UAAur0y5Zv_coDmjCdPLX_G7zGUs9DeAccC7hvFrCQQE"
}
}
Issue-credential message
{
"id": "fb7c1e52-22e0-463b-af42-70d71dc16225",
"type": "https://didcomm.org/issue-credential/2.0/issue-credential",
"raw": "{\"protected\":\"eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyYTdiNDk4NGVjYjE5YjdjNWEyOTg2NzM1ZTVkNTE5MjRhOTc2NzMyM2Y1ZDBlMzc1MTZkZDI1NmU4NzQyMDE0MyNjb250cm9sbGVyIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1zaWduZWQranNvbiJ9\",\"payload\":\"eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9pc3N1ZS1jcmVkZW50aWFsLzIuMC9pc3N1ZS1jcmVkZW50aWFsIiwidG8iOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyNTg2MmJhZjJjZGI2OTM3ZjlmZWY0NTRkYTNkYTk2ZmU5MjU3NjRiOWI5MzYyNTA3ZjczMmQxYmQwOWU5NzAyZiIsImZyb20iOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyYTdi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9W1B9H3jMnCpQ\"}",
"data": {
"@type": "https://didcomm.org/issue-credential/2.0/issue-credential",
"@id": "fb7c1e52-22e0-463b-af42-70d71dc16225",
"comment": "This is the credential you requested",
"formats": [
{
"attach_id": "eaf9cf8b-f0cb-44bd-89fd-23222f559a01",
"format": "aries/[email protected]"
}
],
"credentials~attach": [
{
"@id": "eaf9cf8b-f0cb-44bd-89fd-23222f559a01",
"mime-type": "application/ld+json",
"data": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"grado": "https://schema.org/",
"titulo": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "0a5c496a-6981-4dd6-9708-3edd5b4f321f",
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
},
"issuanceDate": "2023-07-04T06:56:15.947Z",
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:56:15Z",
"verificationMethod": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143#controller",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..3YvBe4kvP3uao97-QMBquYWTjbsCHlbV8fuZHiw2hY1UAAur0y5Zv_coDmjCdPLX_G7zGUs9DeAccC7hvFrCQQE"
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"to": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f"
}
For this scenario we don't need to prepare another pair of terminals for the verifier. Even though there are three different roles, each agent supports all of them, so we can reutilize the issuer and use it as verifier now.
Similar to the propose step in the issuance process, the holder does not need to know which schemas the verifier supports in order to initiate the communication. The holder can indicate the credential type he would like to use without prior knowledge of the verifier's supported schemas.
iillan@iillan-lap:~/holder$ npm run sendProposeVP did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143 UniversityDegreeCredential
> [email protected] sendProposeVP
> node dist/__tests__/sendProposeVP.js "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143" "UniversityDegreeCredential"
Sent Request Presentation: 5bbc054b-db3c-44fc-928a-bb8e86980b7d
// Verifier terminal
Received Message from: did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f
Message type: https://didcomm.org/present-proof/2.0/propose-presentation
Propose Presentation: 5bbc054b-db3c-44fc-928a-bb8e86980b7d
Credential type: UniversityDegreeCredential supported
Saved Message: 4c50d784-c9d9-4151-99ef-a8cc4075d441
Sent Request Presentation: 4c50d784-c9d9-4151-99ef-a8cc4075d441
Propose-presentation message
{
"id": "5bbc054b-db3c-44fc-928a-bb8e86980b7d",
"type": "https://didcomm.org/present-proof/2.0/propose-presentation",
"raw": "{\"protected\":\"eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyNTg2MmJhZjJjZGI2OTM3ZjlmZWY0NTRkYTNkYTk2ZmU5MjU3NjRiOWI5MzYyNTA3ZjczMmQxYmQwOWU5NzAyZiNjb250cm9sbGVyIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1zaWduZWQranNvbiJ9\",\"payload\":\"eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9wcmVzZW50LXByb29mLzIuMC9wcm9wb3NlLXByZXNlbnRhdGlv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86980b7d",
"formats": [
{
"attach_id": "53cc80e6-a39f-4c6c-a307-e8c1e8e5ea63",
"format": "dif/presentation-exchange/[email protected]"
}
],
"proposals~attach": [
{
"@id": "53cc80e6-a39f-4c6c-a307-e8c1e8e5ea63",
"mime-type": "application/json",
"data": {
"input_descriptors": {
"name": "UniversityDegreeCredential"
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"to": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
}
The holder receives the request message and searches his wallet for the requested credential. If the holder has it, he proceeds to generate the presentation with the challenge specified by the verifier.
// Holder terminal
Received Message from: did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143
Message type: https://didcomm.org/present-proof/2.0/request-presentation
Request Presentation: 4c50d784-c9d9-4151-99ef-a8cc4075d441
Got credential for presentation
Generating verifiable presentation
Saved Message: 4a98be03-f5eb-45c1-a60b-e5a05b0ac17a
Sent Presentation: 4a98be03-f5eb-45c1-a60b-e5a05b0ac17a
Request-presentation message
{
"id": "4c50d784-c9d9-4151-99ef-a8cc4075d441",
"type": "https://didcomm.org/present-proof/2.0/request-presentation",
"raw": "{\"protected\":\"eyJhbGciOiJFUzI1NksiLCJraWQiOiJkaWQ6ZXRocjpkZXZlbG9wbWVudDoweDAyYTdiNDk4NGVjYjE5YjdjNWEyOTg2NzM1ZTVkNTE5MjRhOTc2NzMyM2Y1ZDBlMzc1MTZkZDI1NmU4NzQyMDE0MyNjb250cm9sbGVyIiwidHlwIjoiYXBwbGljYXRpb24vZGlkY29tbS1zaWduZWQranNvbiJ9\",\"payload\":\"eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9wcmVzZW50LXByb29mLzIuMC9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bCJ9fX19fV19fQ\",\"signature\":\"Td8nOxMTc-WiwQmUXHxpf9nQETGsSwcN4eoAWLaQV82Sui6CLrwEEw2IKgLwBzbeZ5Vjm0zu9cbYie_b2KuCYw\"}",
"data": {
"@type": "https://didcomm.org/present-proof/2.0/request-presentation",
"@id": "4c50d784-c9d9-4151-99ef-a8cc4075d441",
"formats": [
{
"attach_id": "13e0835e-7ee3-4b27-88da-17817189b68e",
"format": "dif/presentation-exchange/[email protected]"
}
],
"request_presentations~attach": [
{
"@id": "13e0835e-7ee3-4b27-88da-17817189b68e",
"mime-type": "application/json",
"data": {
"options": {
"challenge": "test_challenge",
"domain": "defaultDomain"
},
"presentation_definition": {
"input_descriptors": {
"schema": {
"id": "UniversityDegreeCredential"
}
}
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"to": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f"
}
Finally, the verifier retrieves the presentation from the message and starts the verification process in which he would have to check both digital signatures and then the credential schema.
// Verifier terminal
Received Message from: did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f
Message type: https://didcomm.org/present-proof/2.0/presentation
Presentation: 4a98be03-f5eb-45c1-a60b-e5a05b0ac17a
Found previous Request Presentation
Challenge: test_challenge
Verified Presentation: true
Verifiable Credential
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"verifier": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"holder": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"verifier": [
"did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
],
"type": ["VerifiablePresentation"],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"grado": "https://schema.org/",
"titulo": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "0a5c496a-6981-4dd6-9708-3edd5b4f321f",
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
},
"issuanceDate": "2023-07-04T06:56:15.947Z",
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:56:15Z",
"verificationMethod": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143#controller",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..3YvBe4kvP3uao97-QMBquYWTjbsCHlbV8fuZHiw2hY1UAAur0y5Zv_coDmjCdPLX_G7zGUs9DeAccC7hvFrCQQE"
}
}
],
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:58:18Z",
"verificationMethod": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f#controller",
"proofPurpose": "authentication",
"challenge": "test_challenge",
"domain": "",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..Sjo23mp1o3CfpRUVev4xTnIGH_WOEk-B8eMvwcJvTgweMKlTFe54p7K_WapbIt3M2WgOhlCckOJ4hbmfOWcd0gA"
}
}
Presentation message
{
"id": "4a98be03-f5eb-45c1-a60b-e5a05b0ac17a",
"type": "https://didcomm.org/present-proof/2.0/presentation",
"raw": "{\"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WF0ZWQiOiIyMDIzLTA3LTA0VDA2OjU4OjE4WiIsInZlcmlmaWNhdGlvbk1ldGhvZCI6ImRpZDpldGhyOmRldmVsb3BtZW50OjB4MDI1ODYyYmFmMmNkYjY5MzdmOWZlZjQ1NGRhM2RhOTZmZTkyNTc2NGI5YjkzNjI1MDdmNzMyZDFiZDA5ZTk3MDJmI2NvbnRyb2xsZXIiLCJwcm9vZlB1cnBvc2UiOiJhdXRoZW50aWNhdGlvbiIsImNoYWxsZW5nZSI6InRlc3RfY2hhbGxlbmdlIiwiZG9tYWluIjoiIiwiandzIjoiZXlKaGJHY2lPaUpGVXpJMU5rc3RVaUlzSW1JMk5DSTZabUZzYzJVc0ltTnlhWFFpT2xzaVlqWTBJbDE5Li5Tam8yM21wMW8zQ2ZwUlVWZXY0eFRuSUdIX1dPRWstQjhlTXZ3Y0p2VGd3ZU1LbFRGZTU0cDdLX1dhcGJJdDNNMldnT2hsQ2NrT0o0aGJtZk9XY2QwZ0EifX19XX19\",\"signature\":\"ghe1g8anWRF8-_4lOUjeQQO7RG17V8yQj5RIkDQ3xAgN9ja49KYBTwCv6mj08XJ9DibR8y_uGippi6OC08b04Q\"}",
"data": {
"@type": "https://didcomm.org/present-proof/2.0/presentation",
"@id": "4a98be03-f5eb-45c1-a60b-e5a05b0ac17a",
"comment": "Here you have the presentation requested",
"formats": [
{
"attach_id": "12be72e2-f412-4c1e-9dbb-91e41dff5829",
"format": "dif/presentation-exchange/[email protected]"
}
],
"presentations~attach": [
{
"@id": "12be72e2-f412-4c1e-9dbb-91e41dff5829",
"mime-type": "application/ld+json",
"data": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"verifier": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"holder": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"grado": "https://schema.org/",
"titulo": "https://schema.org/"
},
"https://w3id.org/security/suites/secp256k1recovery-2020/v2"
],
"id": "0a5c496a-6981-4dd6-9708-3edd5b4f321f",
"issuer": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
"type": [
"VerifiableCredential",
"UniversityDegreeCredential"
],
"credentialSubject": {
"id": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"grado": "gradoDefaultValue",
"titulo": "tituloDefaultValue"
},
"issuanceDate": "2023-07-04T06:56:15.947Z",
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:56:15Z",
"verificationMethod": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143#controller",
"proofPurpose": "assertionMethod",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..3YvBe4kvP3uao97-QMBquYWTjbsCHlbV8fuZHiw2hY1UAAur0y5Zv_coDmjCdPLX_G7zGUs9DeAccC7hvFrCQQE"
}
}
],
"verifier": [
"did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143"
],
"type": [
"VerifiablePresentation"
],
"proof": {
"type": "EcdsaSecp256k1RecoverySignature2020",
"created": "2023-07-04T06:58:18Z",
"verificationMethod": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f#controller",
"proofPurpose": "authentication",
"challenge": "test_challenge",
"domain": "",
"jws": "eyJhbGciOiJFUzI1NkstUiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..Sjo23mp1o3CfpRUVev4xTnIGH_WOEk-B8eMvwcJvTgweMKlTFe54p7K_WapbIt3M2WgOhlCckOJ4hbmfOWcd0gA"
}
}
}
]
},
"metaData": [
{
"type": "DIDCommMessaging",
"value": "credential-flow-demo"
},
{
"type": "didCommMetaData",
"value": "{\"packing\":\"jws\"}"
}
],
"from": "did:ethr:development:0x025862baf2cdb6937f9fef454da3da96fe925764b9b9362507f732d1bd09e9702f",
"to": "did:ethr:development:0x02a7b4984ecb19b7c5a2986735e5d51924a9767323f5d0e37516dd256e87420143",
While this work was being developed, Spherity published its Aries RFCs Veramo Plugin. In addition to supporting the issue credential and present proof standards, they also provide support for Aries RFC 0023: DID Exchange Protocol 1.0.
Their work focuses more on managing communication flows and maintaining the machine state for each protocol, but it lacks effort in defining proper message formats. In contrast, our plugin tries to utilize most of the available attributes and employs specific formats for attachments. However, in their implementation, they often leave these attributes as empty strings and occasionally introduce invented attributes.