Definitions

Definitions are used to define a credential, they are made up of two components.

  • Display Definition: Controls the branding of the credential and styling of the claims.
  • Rules Definition: Determines what users need to provide before they receive a verifiable credential.

Definition Model Examples

This is an examples of Display and Role Definition models.

Display Definition
{
  "locale": "en-US",
  "card": {
    "title": "Verifiable Identity",
    "issuedBy": "ZeroTrust.How",
    "backgroundColor": "#000000",
    "textColor": "#ffffff",
    "logo": {
      "uri": "https://example.com/logo.png",
      "description": "Verifiable Identity Logo"
    },
    "description": "This card is to verify your identity."
  },
  "consent": {
    "title": "Get your Verifiable Identity?",
    "instructions": "Present Verifiable Identity to prove who you are."
  },
  "claims": [
    {
      "claim": "vc.credentialSubject.citizenID",
      "label": "Citizen ID",
      "type": "String"
    },
    {
      "claim": "vc.credentialSubject.firstName",
      "label": "First name",
      "type": "String"
    },
    {
      "claim": "vc.credentialSubject.lastName",
      "label": "Last name",
      "type": "String"
    },
    {
      "claim": "vc.credentialSubject.dateOfBirth",
      "label": "Date of Birth",
      "type": "String"
    }
  ]
}
Rules Definition
  {
    "attestations": {
    "idTokenHints": [
      {
      "mapping": [
        {
          "outputClaim": "citizenId",
          "required": false,
          "inputClaim": "citizen_id",
          "indexed": false
        },
        {
          "outputClaim": "firstName",
          "required": false,
          "inputClaim": "given_name",
          "indexed": false
        },
        {
          "outputClaim": "lastName",
          "required": false,
          "inputClaim": "family_name",
          "indexed": false
        },
        {
          "outputClaim": "dateOfBirth",
          "required": false,
          "inputClaim": "date_of_birth",
          "indexed": false
        }
      ],
      "required": false,
      "trustedIssuers": []
      }
    ]
  },
  "validityInterval": 2592000,
  "vc": {
    "type": [
    "VerifiedIdentityCredential"
    ]
  }
}