arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Create AnonCreds Credential Definition

Create a Credential Definition as a DID-Linked Resource (DLR) on cheqd for issuing AnonCreds.

hashtag
Create Credential Definition

The request body must contain the credential_definition object with the Issuer DID and the Schema ID created in the previous steps.

To enable revocation, the options must contain the revocation flag, and the size of the revocation registry. Also, ensure that a Tails Serverarrow-up-right is configured for the issuer.

hashtag
Request Body

chevron-rightcredential_definition (mandatory)hashtag

"issuerId": DID of the Issuer.

"schemaId": The AnonCreds Schema ID created by the Issuer (must be of the same DID).

"tag": Additional Name to identify the Credential Definition.

chevron-rightoptions (optional)hashtag

"support_revocation": Boolean value to indicate that the Credential can be revoked or not. (Tails server must be configured if this is set to `true`)

"revocation_registry_size": Maximum size of the Revocation Registry.

hashtag
Check the new Credential Definition

hashtag
Create a credential definition on the connected datastore

post
Body
Responses
chevron-right
200Success
application/json
credential_definition_metadataobjectOptional
job_idstringOptional
registration_metadataobjectOptional
post
/anoncreds/credential-definition
200Success

hashtag
Retrieve an individual credential definition details

get
Path parameters
cred_def_idstringRequired

Credential definition identifier

Example: {"value":"did:(method):3:CL:20:tag"}
Responses
chevron-right
200Success
application/json
credential_definition_idstringOptional

credential definition id

Example: did:(method):3:CL:20:tag
credential_definitions_metadataobjectOptional
resolution_metadataobjectOptional
get
/anoncreds/credential-definition/{cred_def_id}
200Success
POST /anoncreds/credential-definition HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 310

{
  "credential_definition": {
    "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
    "schemaId": "did:(method):2:schema_name:1.0",
    "tag": "default"
  },
  "options": {
    "create_transaction_for_endorser": false,
    "endorser_connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "revocation_registry_size": 1000,
    "support_revocation": true
  }
}
{
  "credential_definition_metadata": {},
  "credential_definition_state": {
    "credential_definition": {
      "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
      "schemaId": "did:(method):2:schema_name:1.0",
      "tag": "default",
      "type": "CL",
      "value": {
        "primary": {
          "n": "0",
          "r": {},
          "rctxt": "0",
          "s": "0",
          "z": "0"
        },
        "revocation": {
          "g": "1 1F14F&ECB578F 2 095E45DDF417D",
          "g_dash": "1 1D64716fCDC00C 1 0C781960FA66E3D3 2 095E45DDF417D",
          "h": "1 16675DAE54BFAE8 2 095E45DD417D",
          "h0": "1 21E5EF9476EAF18 2 095E45DDF417D",
          "h1": "1 236D1D99236090 2 095E45DDF417D",
          "h2": "1 1C3AE8D1F1E277 2 095E45DDF417D",
          "h_cap": "1 1B2A32CF3167 1 2490FEBF6EE55 1 0000000000000000",
          "htilde": "1 1D8549E8C0F8 2 095E45DDF417D",
          "pk": "1 142CD5E5A7DC 1 153885BD903312 2 095E45DDF417D",
          "u": "1 0C430AAB2B4710 1 1CB3A0932EE7E 1 0000000000000000",
          "y": "1 153558BD903312 2 095E45DDF417D 1 0000000000000000"
        }
      }
    },
    "credential_definition_id": "did:(method):3:CL:20:tag",
    "state": "finished"
  },
  "job_id": "text",
  "registration_metadata": {}
}
GET /anoncreds/credential-definition/{cred_def_id} HTTP/1.1
Accept: */*
{
  "credential_definition": {
    "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
    "schemaId": "did:(method):2:schema_name:1.0",
    "tag": "default",
    "type": "CL",
    "value": {
      "primary": {
        "n": "0",
        "r": {},
        "rctxt": "0",
        "s": "0",
        "z": "0"
      },
      "revocation": {
        "g": "1 1F14F&ECB578F 2 095E45DDF417D",
        "g_dash": "1 1D64716fCDC00C 1 0C781960FA66E3D3 2 095E45DDF417D",
        "h": "1 16675DAE54BFAE8 2 095E45DD417D",
        "h0": "1 21E5EF9476EAF18 2 095E45DDF417D",
        "h1": "1 236D1D99236090 2 095E45DDF417D",
        "h2": "1 1C3AE8D1F1E277 2 095E45DDF417D",
        "h_cap": "1 1B2A32CF3167 1 2490FEBF6EE55 1 0000000000000000",
        "htilde": "1 1D8549E8C0F8 2 095E45DDF417D",
        "pk": "1 142CD5E5A7DC 1 153885BD903312 2 095E45DDF417D",
        "u": "1 0C430AAB2B4710 1 1CB3A0932EE7E 1 0000000000000000",
        "y": "1 153558BD903312 2 095E45DDF417D 1 0000000000000000"
      }
    }
  },
  "credential_definition_id": "did:(method):3:CL:20:tag",
  "credential_definitions_metadata": {},
  "resolution_metadata": {}
}