Create a DID

Create a did:cheqd Decentralized Identifier (DID) using the ACA-Py Agent.

Follow these instructions to create a new DID from ACA-Py Agent and publish the associated DID Document on cheqd ledger.

⚠️ Before you begin...

Make sure you've correctly configured the cheqd plugin's agent settings for ACA-Py.

For wallet storage, utilise a Postgres database to ensure key persistence, enabling future updates to the DID.

Create DID

Populate the various optionsand featuresin the JSON request body and call the API to create the DID.

Create a did:cheqd

post
Body
featuresobjectOptional

Additional features to enable for the did.

Example: {}
optionsobjectOptional

Additional configuration options

Example: {"key_type":"ed25519","method_specific_id_algo":"uuid","network":"testnet"}
Responses
200Success
application/json
post
POST /did/cheqd/create HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 103

{
  "features": "{}",
  "options": {
    "key_type": "ed25519",
    "method_specific_id_algo": "uuid",
    "network": "testnet"
  }
}
200Success
{
  "did": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86",
  "didState": {
    "did": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86",
    "didDocument": {
      "authentication": [
        "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86#key-1"
      ],
      "controller": [
        "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86"
      ],
      "id": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86",
      "verificationMethod": [
        {
          "id": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86#key-1",
          "type": "Ed25519VerificationKey2020",
          "controller": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86",
          "publicKeyMultibase": "z6Mk..."
        }
      ]
    },
    "secret": {
      "signingResponse": [
        {
          "kid": "did:cheqd:testnet:099be283-4302-40cc-9850-22016bcd1d86#key-1",
          "signature": "SHFz..."
        }
      ]
    },
    "state": "finished"
  },
  "success": true,
  "verkey": "BnSWTUQmdYCewSGFrRUhT6LmKdcCcSzRGqWXMPnEP168"
}

Request Body

These are the variables that can be passed in the Body:

features (optional)

Optional Object with Key-Value format for additional features of the new DID. This is for future use.

options (optional)

Optional Object with Key-Value format for additional configuration options, recommendations below:

"network": testnet or mainnet

"key_type": "ed25519" or "bls12381g2"

List DIDs associated with your wallet

After creating a DID or multiple DIDs, users can list all the created DIDs associated with their wallet. Using the /wallet/did API.

List wallet DIDs

get
Query parameters
didstringOptional

DID of interest

Example: {"value":"did:peer:WgWxqztrNooG92RXvxSTWv"}Pattern: ^(did:sov:)?[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{21,22}$|^did:([a-zA-Z0-9_]+)(:[a-zA-Z0-9_.%-]+)?:([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\/[^#?]*)?([?][^#]*)?(\#.*)?$$
key_typestring · enumOptional

Key type to query for.

Example: {"value":"ed25519"}Possible values:
methodstringOptional

DID method to query for. e.g. sov to only fetch indy/sov DIDs

Example: {"value":"key"}
posturestring · enumOptional

Whether DID is current public DID, posted to ledger but current public DID, or local to the wallet

Example: {"value":"wallet_only"}Possible values:
verkeystringOptional

Verification key of interest

Example: {"value":"H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"}Pattern: ^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}$
Responses
200Success
application/json
get
GET /wallet/did HTTP/1.1
Host: 
Accept: */*
200Success
{
  "results": [
    {
      "did": "did:peer:WgWxqztrNooG92RXvxSTWv",
      "key_type": "ed25519",
      "metadata": {},
      "method": "sov",
      "posture": "wallet_only",
      "verkey": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
    }
  ]
}

Last updated

Was this helpful?