arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Create AnonCreds Schema

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

To issue Verifiable Credentials, the issuer will have to first create a Schema and then a Credential Definition.

hashtag
Create Schema

The request body must contain the schema object, which defines the attributes, name and version of the Schema. This will create a DID-Linked Resourcearrow-up-right of type anonCredsSchema.

hashtag
Request Body

chevron-rightoptions (optional)hashtag

Optional Key-Value pairs of additional options.

chevron-rightschema (mandatory)hashtag

"attrNames": Array of attributes for the schema definition.

"issuerId": Issuer DID, use the did created by the Issuer.

"name": Name of the Schema

"version": Version of the Schema (To update existing Schema, use same name and different version)

hashtag
Check the new Schema

DID-Linked Resources

Create DID-Linked Resources (DLRs) linked to Decentralized Identifiers (DIDs) on cheqd using ACA-Py.

"DID-Linked Resources" are identified with a did:cheqd Decentralized Identifierarrow-up-right with a Universally Unique Identifier (UUID)arrow-up-right that acts as a permanently-accessible link to fetch the resources from the cheqd ledger. We refer to this as the "resource ID". Through the "resource ID" or a set of DID URL query parameters, applications are able to persistently access a digital resource on the cheqd network.

hashtag
Get started

hashtag
Alternatives

Below are a list of SDK alternatives for creating cheqd DID-Linked Resources.

t

Understanding DLRs

More details about DID-Linked Resources on Cheqd.

Understanding AnonCreds

More details about AnonCreds Object Method.

Create Schema

Create an AnonCreds Schema.

Create Credential Definition

Create an AnonCreds Credential Definition

Cover

cheqd Studio

Our API product enables users to use cheqd's functionality with minimal complexity and easily integrate APIs into existing apps.

Cover

Credo

Credo is an SDK which supports the European Architecture and Reference Framework (ARF) standards as well as AnonCreds with full cheqd support for DIDs.

Cover

DID Registrar

Simple setup for building cheqd DIDs into existing applications using REST APIs, building into the .

Cover

Veramo

The Veramo SDK plugin supports JSON, JSON-LD credentials as well as cheqd Credential Payments in an SDK.

Cover

cheqd Cosmos CLI

Cosmos-native CLI for creating transactions on cheqd. Should be used for testing purposes only.

Universal Registrararrow-up-right

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 schema on the connected datastore

post
Body
Responses
chevron-right
200Success
application/json
job_idstringOptional
registration_metadataobjectOptional
schema_metadataobjectOptional
post
/anoncreds/schema
200Success

hashtag
Retrieve an individual schemas details

get
Path parameters
schema_idstringRequired

Schema identifier

Example: {"value":"did:(method):2:schema_name:1.0"}
Responses
chevron-right
200Success
application/json
resolution_metadataobjectOptional
schema_idstringOptional

Schema identifier

Example: did:(method):2:schema_name:1.0
schema_metadataobjectOptional
get
/anoncreds/schema/{schema_id}
200Success

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/schema HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 239

{
  "options": {
    "create_transaction_for_endorser": false,
    "endorser_connection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  },
  "schema": {
    "attrNames": [
      "score"
    ],
    "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
    "name": "Example schema",
    "version": "1.0"
  }
}
{
  "job_id": "text",
  "registration_metadata": {},
  "schema_metadata": {},
  "schema_state": {
    "schema": {
      "attrNames": [
        "score"
      ],
      "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
      "name": "Example schema",
      "version": "1.0"
    },
    "schema_id": "did:(method):2:schema_name:1.0",
    "state": "finished"
  }
}
GET /anoncreds/schema/{schema_id} HTTP/1.1
Accept: */*
{
  "resolution_metadata": {},
  "schema": {
    "attrNames": [
      "score"
    ],
    "issuerId": "did:(method):WgWxqztrNooG92RXvxSTWv",
    "name": "Example schema",
    "version": "1.0"
  },
  "schema_id": "did:(method):2:schema_name:1.0",
  "schema_metadata": {}
}
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": {}
}