Workflow Builder
Verify Credentials

Verify Credentials

Requests for a presentation can be sent to a holder wallet over a connection based on a set of Credential Templates.

The Login with a Credential example workflow demonstrates all the steps needed to request a presentation from a holder wallet based on a specific credential template.

💡

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

Request Presentation

Name: didcomm/requestPresentation
Description: Request a presentation from a connection.
Version: v1

Input

The attributes key takes the following input:

ParameterTypeDescriptionRequired
connectionIdstringThe identifier of the connection.
anoncredsAnoncredsPresentationRequestInputThe Anoncreds presentation request.
commentstringAn optional comment sent with the exchange to provide context. This property may not be displayed by the receiving party.

Output

The DIDComm presentation exchange that has been completed and verified.

ParameterTypeDescriptionRequired
presentationExchangeDidcommPresentationExchangeThe presentation exchange.

Usage

Currently only the anoncreds format is supported (See standards and protocols).

YAML
actions:
  - id: requestPresentation
    name: didcomm/requestPresentation@v1
    attributes:
      connectionId: fc4d02e3-389f-4d1f-89f6-55952b084fcb
      anoncreds:
        name: Access Level Request
        version: '1.0.0'
        attributes:
          - names:
              - Name
              - Access Level
            restrictions:
              - credentialDefinitionId: 'did:cheqd:mainnet:d76283f5-943f-4f4b-b5ae-9bd6794b6dcf/resources/9703ceb3-cda2-4315-8f7e-ebceaf351aa7'

Request Presentation with an Invitation

Name: didcomm/createPresentationRequestInvitation
Description: Request a presentation with an invitation.
Version: v1

Input

The attributes key takes the following input:

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

Output

The DIDComm presentation exchange that has been completed and verified.

ParameterTypeDescriptionRequired
presentationExchangeDidcommPresentationExchangeThe presentation exchange.
invitationInvitationThe invitation to request the presentation.

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/requestPresentation).

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 proof request invitation, the goal code of request-proof 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.

AnoncredsPresentationRequestInput

The AnoncredsPresentationRequestInput type contains the required information to send an Anoncreds presentation request:

ParameterTypeDescriptionRequired
namestringThe name of the presentation request.
versionstringThe version of the presentation request, must match a version (eg. 1 or 1.1 or 1.1.1). If this parameter is unspecified, version 1.0.0 will be used by default.
attributesAnoncredsPresentationRequestRequestedAttributes[]The requested attributes.
predicatesAnoncredsPresentationRequestRequestedPredicates[]The requested predicates.
requireNonRevokedbooleanWhether the credentials should be non-revoked. If a credential is not revocable, this property will not have an effect. Default to false.

Output

Invitation

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

DidcommPresentationExchange

ParameterTypeDescriptionRequired
presentationExchangeIdstringThe identifier of the presentation exchange.
statusstringThe status of the presentation exchange. For completed presentation exchanges the states will always be presentationReceived.
threadIdstringThe identifier of the thread. This identifier is shared between the holder and verifier, and allows to correlate the exchange.
createdAtnumberTimestamp at which the presentation exchange is initiated in milliseconds since epoch.
anoncredsDidcommPresentationExchangeAnoncredsThe anoncreds presentation data from the presentation exchange. Currently only the request and presentation are included.
connectionIdstringThe identifier of the connection associated with the presentation exchange. Will be undefined for presentation exchanges without a connection.

DidcommPresentationExchangeAnoncreds

ParameterTypeDescriptionRequired
requestAnoncredsPresentationRequestData associated with the Anoncreds presentation request
presentationAnoncredsPresentationData associated with the Anoncreds presentation

AnoncredsPresentationRequest

ParameterTypeDescriptionRequired
namestringThe name of the presentation request.
versionstringThe version of the presentation request.
requireNonRevokedstringWhether the credentials should be non-revoked. If a credential is not revocable, this property will not have an effect.
attributesAnoncredsPresentationRequestRequestedAttributes[]The requested attributes.
predicatesAnoncredsPresentationRequestRequestedPredicates[]The requested predicates.
AnoncredsPresentationRequestRequestedAttributes
ParameterTypeDescriptionRequired
namesstring[]The names of the attributes in the credential that a presentation is being requested for. The name must be present in the schema associated with the credential definition.
restrictionsAnoncredsPresentationRequestRestrictions[]The restrictions for the requested attribute.
AnoncredsPresentationRequestRequestedPredicates
ParameterTypeDescriptionRequired
namestringThe name of the attribute in the credential that a predicate presentation is being requested for. The name must be present in the schema associated with the credential definition.
predicateType"greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo"The operator for the predicate.
predicateValuenumberThe value of the predicate.
restrictionsAnoncredsPresentationRequestRestrictions[]The restrictions for the requested predicate.
AnoncredsPresentationRequestRestrictions

As used in attributes and predicates.

ParameterTypeDescriptionRequired
credentialDefinitionIdstringThe credential definition Id.Either schemaId or credentialDefinitionId must be present.
schemaIdstringThe schema id.Either schemaId or credentialDefinitionId must be present.

AnoncredsPresentation

ParameterTypeDescriptionRequired
attributesAnoncredsPresentationRevealedAttributes[]The attributes requested with the presentation request.
predicatesAnoncredsPresentationRevealedPredicates[]The predicates requested with the presentation request.
AnoncredsPresentationRevealedAttributes
ParameterTypeDescriptionRequired
valueobjectObject containing key-value pairs mapping requested attributes by it's name to to the associated value.
schemaIdstringThe schema Id.
credentialDefinitionIdstringThe credential definition Id.
selfAttestedbooleanWhether the attribute is self attested.
AnoncredsPresentationRevealedPredicates
ParameterTypeDescriptionRequired
namestringThe name of the attribute in the credential that a predicate proof is being requested for. The name must be present in the schema associated with the credential definition.
predicateType"greaterThan" | "lessThan" | "greaterThanOrEqualTo" | "lessThanOrEqualTo"The operator for the predicate.
predicateValuenumberThe value of the predicate.
schemaIdstringThe schema Id.
credentialDefinitionIdstringThe credential definition Id.
selfAttestedbooleanWhether the attribute is self attested.