Workflow Builder
Issue Credentials

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:

ParameterTypeDescriptionRequired
connectionIdstringConnection identifier to send this credential to.
anoncredsAnoncredsCredentialOfferInputThe Anoncreds credential offer.
commentstringAn optional comment sent with the exchange to provide context. This property may not be displayed by the receiving party.

AnoncredsCredentialOfferInput

ParameterTypeDescriptionRequired
credentialDefinitionIdstringCredential definition identifier.
attributesRecord<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

ParameterTypeDescriptionRequired
credentialExchangeDidcommCredentialExchangeThe 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:

ParameterTypeDescriptionRequired
anoncredsAnoncredsCredentialOfferInputThe Anoncreds credential offer.
invitationInvitationInputThe invitation properties.
commentstringAn optional comment sent with the exchange to provide context. This property may not be displayed by the receiving party.

Output

ParameterTypeDescriptionRequired
credentialExchangeDidcommCredentialExchangeThe DIDComm credential exchange.
invitationInvitationThe invitation to issue the credential.

Types

Input

InvitationInput

ParameterTypeDescriptionRequired
aliasstringAlias for the connection
labelstringLabel for the invitation. Will be shared with the other party.

Defaults to team name
imageUrlstringImage URL to be included in the invitation.
createConnectionbooleanWhether 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
goalstringHuman readable string that describes the goal for creating the invitation.
goalCodestringMachine 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.
invitationDiddid:webUse 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

ParameterTypeDescriptionRequired
credentialExchangeIdstringThe identifier of the credential exchange.
statusstringThe status of the credential exchange. For completed credential exchanges the states will always be credentialIssued
threadIdstringThe identifier of the thread. This identifier is shared between the issuer and holder, and allows to correlate the exchange.
createdAtnumberTimestamp at which the credential exchange is initiated in milliseconds since epoch.
anoncredsDidcommCredentialExchangeAnoncredsThe anoncreds credential data from the credential exchange. Currently only the offer is included.
connectionIdstringThe identifier of the connection associated with the credential exchange. Will be undefined for credential exchanges without a connection.

DidcommCredentialExchangeAnoncreds

ParameterTypeDescriptionRequired
offerAnoncredsCredentialOfferData associated with the Anoncreds credential offer.

AnoncredsCredentialOffer

ParameterTypeDescriptionRequired
attributesRecord<string, string | number>Object containing key-value pairs for the name and values of the credential attributes.
credentialDefinitionIdstringThe identifier of the credential definition used for issuing the credential.

Output

Invitation

ParameterTypeDescriptionRequired
invitationUrlstringThe invitation as a short URL. valid for 7 days
fullInvitationUrlstringThe invitation encoded as URL.
💡

To understand how to work with actions in more depth, checkout the section on working with actions.