Issue Credentials
Credentials are issued to a holder wallet over a connection based on a Credential Template.
The Issue an Employee Badge example workflow demonstrates all the steps needed to issue a credential to a holder wallet.
Issue Credential
Name: didcomm/issueCredential
Description: Issue a credential to a connection.
Version: v1
Input
The attributes key takes the following input:
Parameter | Type | Description | Required |
---|---|---|---|
connectionId | string | Connection identifier to send this credential to. | ✅ |
anoncreds | AnoncredsCredentialOfferInput | The Anoncreds credential offer. | ✅ |
comment | string | An optional comment sent with the exchange to provide context. This property may not be displayed by the receiving party. | ❌ |
AnoncredsCredentialOfferInput
Parameter | Type | Description | Required |
---|---|---|---|
credentialDefinitionId | string | Credential definition identifier. | ✅ |
attributes | Record<string, string | number> | Object containing key-value pairs for the name and values of the credential attributes. Entries must match the schema attributes names. | ✅ |
Output
Parameter | Type | Description | Required |
---|---|---|---|
credentialExchange | DidcommCredentialExchange | The DIDComm credential exchange. | ✅ |
Usage
YAML
actions:
- id: issueDOBCredential
name: didcomm/issueCredential@v1
attributes:
connectionId: 'fc4d02e3-389f-4d1f-89f6-55952b084fcb' # from connection action
anoncreds:
# from credential definition action
credentialDefinitionId: 'did:cheqd:mainnet:d76283f5-943f-4f4b-b5ae-9bd6794b6dcf/resources/9703ceb3-cda2-4315-8f7e-ebceaf351aa7'
attributes:
name: 'Alice'
dateOfBirth: 19901010
Issue Credential with an Invitation
Name: didcomm/createCredentialIssuanceInvitation
Description: Issue a credential directly with an invitation.
Version: v1
Input
The attributes key takes the following input:
Parameter | Type | Description | Required |
---|---|---|---|
anoncreds | AnoncredsCredentialOfferInput | The Anoncreds credential offer. | ✅ |
invitation | InvitationInput | The invitation properties. | ❌ |
comment | string | An optional comment sent with the exchange to provide context. This property may not be displayed by the receiving party. | ❌ |
Output
Parameter | Type | Description | Required |
---|---|---|---|
credentialExchange | DidcommCredentialExchange | The DIDComm credential exchange. | ✅ |
invitation | Invitation | The invitation to issue the credential. | ✅ |
Types
Input
InvitationInput
Parameter | Type | Description | Required |
---|---|---|---|
alias | string | Alias for the connection | ❌ |
label | string | Label for the invitation. Will be shared with the other party. | ❌ Defaults to team name |
imageUrl | string | Image URL to be included in the invitation. | ❌ |
createConnection | boolean | Whether to create a connection as part of the exchange. This allows to directly send messages to this connection in the future, without needing to create an out of band invitation first (see for example didcomm/issueCredential ). | ❌ Defaults to true |
goal | string | Human readable string that describes the goal for creating the invitation. | ❌ |
goalCode | string | Machine readable string that describes the goal for creating the invitation. Commonly used values for goalCode are issue-vc , request-proof , create-account , or p2p-messaging , however as this is a credential issuance invitation, the goal code of issue-vc could be assumed. | ❌ |
invitationDid | did:web | Use a specific did for the invitation, allowing the receiver to recognize the did, or reuse an existing connection based on the DID. The connection will still use a 'did:peer' did for the connection, this is only for the invitation. | ❌ |
DidcommCredentialExchange
Parameter | Type | Description | Required |
---|---|---|---|
credentialExchangeId | string | The identifier of the credential exchange. | ✅ |
status | string | The status of the credential exchange. For completed credential exchanges the states will always be credentialIssued | ✅ |
threadId | string | The identifier of the thread. This identifier is shared between the issuer and holder, and allows to correlate the exchange. | ✅ |
createdAt | number | Timestamp at which the credential exchange is initiated in milliseconds since epoch. | ✅ |
anoncreds | DidcommCredentialExchangeAnoncreds | The anoncreds credential data from the credential exchange. Currently only the offer is included. | ✅ |
connectionId | string | The identifier of the connection associated with the credential exchange. Will be undefined for credential exchanges without a connection. | ❌ |
DidcommCredentialExchangeAnoncreds
Parameter | Type | Description | Required |
---|---|---|---|
offer | AnoncredsCredentialOffer | Data associated with the Anoncreds credential offer. | ✅ |
AnoncredsCredentialOffer
Parameter | Type | Description | Required |
---|---|---|---|
attributes | Record<string, string | number> | Object containing key-value pairs for the name and values of the credential attributes. | ✅ |
credentialDefinitionId | string | The identifier of the credential definition used for issuing the credential. | ✅ |
Output
Invitation
Parameter | Type | Description | Required |
---|---|---|---|
invitationUrl | string | The invitation as a short URL. valid for 7 days | ✅ |
fullInvitationUrl | string | The invitation encoded as URL. | ✅ |
💡
To understand how to work with actions in more depth, checkout the section on working with actions.