Issue a Verifiable Credential (AnonCreds)
Issue a Verifiable Credential (AnonCreds) with did:cheqd.
Last updated
Was this helpful?
Issue a Verifiable Credential (AnonCreds) with did:cheqd.
Last updated
Was this helpful?
Using AnonCreds and the Issue Credential v2 Protocol, you can issue Verifiable Credentials signed by a did:cheqd
identifier with just a few lines of code. This guide walks through the full flow using the Credo Agent.
Before you begin, make sure you have:
A registered did:cheqd
identifier for the Issuer
A Credential Schema and Credential Definition already created and published as DID-Linked Resources
A Credo Agent configured with:
@credo-ts/cheqd
for DID operations and resource publishing
@credo-ts/anoncreds
for AnonCreds credential handling
@credo-ts/didcomm
for DIDComm messaging
Two agents: an Issuer and a Holder (can be separate apps or run locally)
Secure connectivity between agents using Out-of-Band (OOB) or a supported connection method
Use any supported method to create a connection with the Holder of the credential. Automated is recommended.
The Issuer agent will create a new connection invite for the Holder. This is needed to securely communicate between the Issuer and the Holder agents.
The above request will have an invitation
in the response. Holder will have to copy that invitation and pass URL as invitationUrl
in the following code:
Generate a credential offer and send to the holder, informing them about the available credential and its attributes.
When we want to accept a credential, we have to listen to incoming credentials and handle accordingly. In this example we do not have any user interaction, but is likely that your application would have a user-interface which would display the credential. When receiving a credential offer you can get the values from credentialExchangeRecord.credentialAttributes
.
1
Create and accept a secure connection between Issuer and Holder
2
Issuer prepares and sends a credential offer (via AnonCreds v2)
3
Holder accepts and stores the credential automatically or via UI