Product Docs
Product DocsTechnical DocsLearning & GovernanceUseful Links
  • Product Docs
  • Node Docs
  • Learning Docs
  • â„šī¸Getting Started
    • Product Overview
    • âžĄī¸Get Started with cheqd Studio
      • 👉Set Up Your Account
      • đŸ—ī¸Create API Keys
      • đŸĒ™Token Top Up
      • 🔄Advanced Configuration Options
    • â˜‘ī¸Use Trust Registries for AI Agents
      • đŸ—ī¸Build an AI Agent Trust Registry
        • Setup AI Agent Trust Registry
          • Issue Verifiable Credentials to AI Agent
        • Setup and Configure MCP Server
          • Create AI Agent DID
          • Import Credential to AI Agent
          • Advanced functionality
            • Issue a Verifiable Credential
            • Verify a Credential
      • 🤝Validate AI Agent Trust Chain
  • đŸŸĸStart using cheqd
    • 🆔Create DIDs and Identity Keys
      • Create a DID
      • Create Identity Keys
      • Create a Subject DID
      • Resolve a DID
      • Update a DID
      • Deactivate a DID
    • ✅Issue Credentials and Presentations
      • Issue a Verifiable Credential
      • Setup Verida Wallet
      • Verify a Verifiable Credential
      • Verify a Verifiable Presentation
      • Revoke a Verifiable Credential
      • Suspend or Unsuspend a Verifiable Credential
    • â™ģī¸Charge for Verifiable Credentials
      • Understanding Credential Payments
        • Access Control Conditions
        • Privacy Considerations
      • Charge for Status List
      • Issue Credential with Encrypted Status List
      • Create Verifier Pays Issuer flow
      • Bulk Update or Rotate Encryption Keys
    • 🤝Build Trust Registries
      • Decentralized Trust Chains (DTCs)
        • Root Authorisations
        • RTAO -> TAO
        • TAO -> SubTAO
        • TAO -> Trusted Issuer (TI)
        • Referencing Trust Registry within a Verifiable Credential
      • Set up Trust Chain
        • Issue a Verifiable Accreditation
        • Verify a Verifiable Accreditation
      • Get Started with TRAIN
        • Deploy TRAIN and Anchor rTAO in DNS
        • Validate Trust Chain
    • 🎋Create Status Lists
      • Bitstring Status List
        • Create Bitstring Status List
        • Update Bitstring Status List
        • Check Bitstring Status List
        • Search Bitstring Status List
      • Token Status List
        • Create Token Status List
        • Update Token Status List
    • â†•ī¸Create DID-Linked Resources
      • Understanding DID-Linked Resources
        • Context for developing DID-Linked Resources
        • Technical composition of DID-Linked Resources
        • Referencing DID-Linked Resources in VCs
      • Create a DID-Linked Resource
      • Search for DID-Linked Resources
  • đŸ› ī¸Integrate an SDK
    • Choosing the right SDK
    • 🍏Credo
      • Setup Credo Agent
      • Decentralized Identifiers (DIDs)
        • Create a DID
        • Update a DID
        • Deactivate a DID
      • DID-Linked Resources
        • Create a DID-Linked Resource
        • Resolve a DID-Linked Resource
        • Create an AnonCreds Schema
        • Create an AnonCreds Credential Definition
      • Verifiable Credentials and Presentations
        • AnonCreds
          • Issue a Verifiable Credential
          • Present a Verifiable Credential
        • JSON-LD
          • Issue a Verifiable Credential
          • Present a Verifiable Credential
        • SD-JWT VC
          • Issue a Verifiable Credential
          • Present a Verifiable Credential
    • 🍊ACA-Py
      • Setup ACA-Py Agent
      • Decentralized Identifiers (DIDs)
        • Create a DID
        • Update a DID
        • Deactivate a DID
      • DID-Linked Resources
        • Create AnonCreds Schema
        • Create AnonCreds Credential Definition
      • Verifiable Credentials and Presentations
        • AnonCreds
          • Issue a Verifiable Credential
          • Present a Verifiable Credential
          • Revoke a Verifiable Credential
        • JSON-LD
          • Issue a Verifiable Credential
          • Present a Verifiable Credential
    • 🍈Veramo
      • Setup Veramo CLI for cheqd
        • Troubleshooting Veramo CLI Setup
      • Decentralized Identifiers (DIDs)
        • Create a DID
        • Querying a DID
        • Update an existing DID
        • Deactivate a DID
        • Create an off-ledger holder DID
        • Managing Identity Keys
        • Troubleshooting
      • Verifiable Credentials and Presentations
        • Issue a Verifiable Credential
        • Verify a Verifiable Credential
        • Create a Verifiable Presentation
        • Verify a Verifiable Presentation
      • Credential Payments
        • Charge for Status List
        • Issue Credential with Encrypted Status List
        • Verifier pays Issuer
      • Bitstring Status List
        • Create Status List
        • Issuing a Verifiable Credential referencing Status List
      • DID-Linked Resources
        • Create a DID-Linked Resource
        • Create a new Resource version within existing Collection
    • đŸĢWalt.id Community Stack
  • đŸ—ī¸Architecture
    • Architecture Decision Record (ADR) Process
    • List of ADRs
      • đŸ”ĩADR 001: cheqd DID Method
      • đŸŸĸADR 002: DID-Linked Resources
      • 🟡ADR 003: DID Resolver
      • 🟠ADR 004: DID Registrar
      • đŸŸŖADR 005: DID Resolution & DID URL Dereferencing
  • đŸ’ĢAdvanced features and alternatives
    • âžĄī¸DID Registrar
      • Setup DID Registrar
      • Create a DID
      • Create a DID-Linked Resource
    • âŦ…ī¸DID Resolver
      • Setup DID Resolver
    • ⚡AnonCreds Object Method
      • Schemas
      • Credential Definitions
      • Revocation Registry Definitions
      • Revocation Status Lists
    • 🌠Advanced Tooling
      • cheqd Cosmos CLI for identity
        • Create a DID
        • Update a DID
        • Deactivate a DID
        • Query a DID
        • Create a DID-Linked Resource
        • Update a DID-Linked Resource
      • Direct interaction with ledger code
      • VDR Tools CLI with cheqd (deprecated)
      • Demo Wallet for Identity Setup
  • âš›ī¸Network
    • Get started with cheqd Network
      • Identity Write Pricing
      • Comparison to Hyperledger Indy
    • ⏊Setup your Wallet
      • Setup Leap Wallet
        • Congifure cheqd Testnet for Leap
      • Setup Keplr Wallet
      • Migrate from Keplr to Leap Wallet
    • â†Ēī¸Useful Tools and APIs
      • Block Explorer
      • Testnet Faucet
      • Validator Status API
      • Cheqd x Cosmos Data APIs
      • Cosmos Airdrop Helpers
      • Cosmos Address Convertor
      • Ethereum Bridge
    • âŦ†ī¸Network Upgrades
      • 2021
        • 0.1.x
        • 0.2.x
        • 0.3.x
      • 2022
        • 0.4.x
        • 0.5.x
        • 0.6.x
      • 2023
        • 1.x
      • 2024
        • 2.x
        • 3.x
      • 2025
        • 3.1.x
        • 4.x
      • Root Cause Analysis of Outages
        • v1.x upgrade RCA
  • âš–ī¸Legal
    • License
    • Code of Conduct
    • Security Policy
  • 🆘Support
    • System Status
    • Discord
    • Bugs & Feature Requests
Powered by GitBook
LogoLogo

General

  • Website
  • Blog
  • Get $CHEQ

Product Docs

  • Product Docs
  • cheqd Studio
  • Creds.xyz
  • Bug/Feature Requests

Technical Docs

  • Node Docs
  • GitHub
  • Block Explorer

Learning Docs

  • Learning Docs
  • Governance Docs
  • Governance Forum
  • Governance Explorer
On this page
  • Instructions
  • 1. Create your identity keys within a DID Document template
  • Command (inline)
  • Command (pass as file)
  • Inputs and arguments
  • Expected output
  • Unexpected output
  • 2. Prepare/edit DIDDoc contents
  • Example of payload.json files
  • Parameters
  • 3. Create new DID and publish DIDDoc
  • Next steps
  • Troubleshooting

Was this helpful?

Edit on GitHub
Export as PDF
  1. Integrate an SDK
  2. Veramo
  3. Decentralized Identifiers (DIDs)

Create a DID

Create a Decentralized Identifier (DID) on cheqd using Veramo.

Last updated 22 days ago

Was this helpful?

Follow these instructions to create a new DID and publish the associated DID Document on cheqd ledger.

âš ī¸ Before you begin...

Make sure you've correctly for Veramo CLI

Instructions

1. Create your identity keys within a DID Document template

The first step is generating a template for your DID Document, including a new DID and associated public/private key pair. This process also aligns with method 1 .

It is important to note that this step does not create your DID on ledger, but it generates your identity keys as a draft DID Document for you to use in the on-ledger transaction in .

Command (inline)

You can use the following command in your CLI to create your DIDDoc and associated identity keys:

veramo execute -m cheqdGenerateDidDoc --argsJSON '{"verificationMethod": "JsonWebKey2020", "methodSpecificIdAlgo": "uuid", "network": "testnet"}'

Command (pass as file)

You can pass the payload of the inputs and arguments as a file rather than inline using:

veramo execute -m cheqdGenerateDidDoc --argsFile path/to/exampleFile.json

You can reuse this example file:

Inputs and arguments

Within this command, you are able to choose from the following inputs below to produce different types of DIDDocs:

verificationMethod
  • Ed25519VerificationKey2020

  • JsonWebKey2020

  • Ed25519VerificationKey2018

methodSpecificIdAlgo
  • base58btc

  • uuid

network
  • mainnet

  • testnet

Expected output

Once you have submitted the command above, you should receive a DID Document draft template, including a set of identity keys, including your chosen inputs and arguments. You can find an example of this output below:

Example output
Method:  cheqdGenerateDidDoc

Arguments:  {
  "argsObj": {
    "verificationMethod": "Ed25519VerificationKey2020",
    "methodSpecificIdAlgo": "uuid",
    "network": "testnet"
  }
}

Result : {
  "didDoc": {
    "context": [],
    "id": "did:cheqd:testnet:e43f36e4-9fa6-40a4-a8f9-7f7b49eb44db",
    "controller": [
      "did:cheqd:testnet:e43f36e4-9fa6-40a4-a8f9-7f7b49eb44db"
    ],
    "authentication": [
      "did:cheqd:testnet:e43f36e4-9fa6-40a4-a8f9-7f7b49eb44db#key-1"
    ],
    "assertionMethod": [],
    "capabilityInvocation": [],
    "capabilityDelegation": [],
    "keyAgreement": [],
    "alsoKnownAs": [],
    "verificationMethod": [
      {
        "id": "did:cheqd:testnet:e43f36e4-9fa6-40a4-a8f9-7f7b49eb44db#key-1",
        "type": "Ed25519VerificationKey2020",
        "controller": "did:cheqd:testnet:e43f36e4-9fa6-40a4-a8f9-7f7b49eb44db",
        "publicKeyMultibase": "z2yJuNbhoUpRn7ypAugSLzkCc8QEw146RJ8DD3jzCZQ6A",
        "publicKeyJwk": []
      }
    ],
    "service": []
  },
  "versionId": ""07109dba-7582-491e-9c17-8fadbdabb304",
  "keys": {
    "publicKeyHex": "XXXX",
    "privateKeyHex": "XXXXXXXX",
    "kid": "XXXX",
    "type": "Ed25519"
  }
}

Unexpected output

Unexpected token v in JSON at position 1

2. Prepare/edit DIDDoc contents

Example of payload.json files

The below examples show the variation in syntax for different verification method key types in the DIDDoc payload file itself. Note that each key type has a slightly different output.

Ed25519VerificationKey2018
{
  "kms": "local",
  "alias": "Veramo specific name of your DIDDoc",
  "document": {
    "context": [],
    "id": "did:cheqd:testnet:<uniqueId>",
    "controller": [
      "did:cheqd:testnet:<uniqueId>"
    ],
    "verificationMethod": [{
        "id": "did:cheqd:testnet:<uniqueId>#key-1",
        "type": "Ed25519VerificationKey2018",
        "controller": "did:cheqd:testnet:<uniqueId>",
        "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"     
    }],
    "authentication": [
      "did:cheqd:testnet:<uniqueId>#key-1"
    ],
    "assertionMethod": [],
    "capabilityInvocation": [],
    "capabilityDelegation": [],
    "keyAgreement": [],
    "alsoKnownAs": [],
    "service": []
  },
  "versionId": "<uuid>", // optional
  "keys": [{
    "publicKeyHex": "<public_key_in_hex_encoding>",
    "privateKeyHex": "<private_key_in_hex_encoding>",
    "kid": "<equal_to_public_key_hex>",
    "type": "Ed25519"
    // add additional key(s) if required
  }],
  "fee": {
    "amount": [{
      "denom": "ncheq",
      "amount": "50000000000"
      }],
    "gas": "400000",
    "payer": "cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96" // add the cheqd account the transaction will come from
  }
}
Ed25519VerificationKey2020
{
  "kms": "local",
  "alias": "Veramo specific name of your DIDDoc",
  "document": {
    "context": [],
    "id": "did:cheqd:testnet:<uniqueId>",
    "controller": [
      "did:cheqd:testnet:<uniqueId>"
    ],
    "verificationMethod": [{
        "id": "did:cheqd:testnet:<uniqueId>#key-1",
        "type": "Ed25519VerificationKey2020",
        "controller": "did:cheqd:testnet:<uniqueId>",
        "publicKeyMultibase": "z2yJuNbhoUpRn7ypAugSLzkCc8QEw146RJ8DD3jzCZQ6A"     
    }],
    "authentication": [
      "did:cheqd:testnet:<uniqueId>#key-1"
    ],
    "assertionMethod": [],
    "capabilityInvocation": [],
    "capabilityDelegation": [],
    "keyAgreement": [],
    "alsoKnownAs": [],
    "service": []
  },
  "versionId": "<uuid>", // optional
  "keys": [{
    "publicKeyHex": "<public_key_in_hex_encoding>",
    "privateKeyHex": "<private_key_in_hex_encoding>",
    "kid": "<equal_to_public_key_hex>",
    "type": "Ed25519"
    // add additional key(s) if required
  }],
  "fee": {
    "amount": [{
      "denom": "ncheq",
      "amount": "50000000000"
      }],
    "gas": "400000",
    "payer": "cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96" // add the cheqd account the transaction will come from
  }
}
JSONWebKey2020
{
  "kms": "local",
  "alias": "Veramo specific name of your DIDDoc",
  "document": {
    "context": [],
    "id": "did:cheqd:testnet:<uniqueId>",
    "controller": [
      "did:cheqd:testnet:<uniqueId>"
    ],
    "verificationMethod": [{
        "id": "did:cheqd:testnet:<uniqueId>#key-1",
        "type": "JsonWebKey2020",
        "controller": "did:cheqd:testnet:<uniqueId>",
        "publicKeyJwk": {
          "kty": "OKP", // external (property name)
          "crv": "Ed25519", // external (property name)
          "x": "VCpo2LMLhn6iWku8MKvSLg2ZAoC-nlOyPVQaO3FxVeQ" // external (property name)
        }
    }],
    "authentication": [
      "did:cheqd:testnet:<uniqueId>#key-1"
    ],
    "assertionMethod": [],
    "capabilityInvocation": [],
    "capabilityDelegation": [],
    "keyAgreement": [],
    "alsoKnownAs": [],
    "service": []
  },
  "versionId": "<uuid>", // optional
  "keys": [{
    "publicKeyHex": "<public_key_in_hex_encoding>",
    "privateKeyHex": "<private_key_in_hex_encoding>",
    "kid": "<equal_to_public_key_hex>",
    "type": "Ed25519"
    // add additional key(s) if required
  }],
  "fee": {
    "amount": [{
      "denom": "ncheq",
      "amount": "50000000000"
      }],
    "gas": "400000",
    "payer": "cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96" // add the cheqd account the transaction will come from
  }
}

Parameters

  • kms (default local): Key Management System (KMS) to be used for storage.

  • alias: A human-friendly alias for the DID. Only used locally when referencing operations in Veramo CLI.

  • document: Full body of the DID Document

  • versionId: (optional): Custom versionId for the DID Document. If this is not set manually, then a UUID will be automatically generated for the DID Document version.

  • keys: Keys used to sign the DIDDoc. These must match the ones specified in the DIDDoc, otherwise an error will be thrown.

  • fee

    • amount: An array of coins, coins are represented as an object with 2 fields

      • denom: ncheq (smallest denomination classification)

      • amount: 50000000000 (This is 50 CHEQ by default and will not work with a different value)

    • gas: Each transaction must specify the maximum amount of gas it may consume.

    • payer (optional): The cheqd fee payer address

    • granter (optional): The cheqd fee granter address, Provided the grantee has an allowance by the granter

3. Create new DID and publish DIDDoc

veramo execute -m cheqdCreateIdentifier --argsFile path/to/payload.json

If you do not specify the --argsFile, you can also paste a JSON inline argument object by using the --argsJSON flag followed by the JSON payload.

Next steps

Troubleshooting

You can then use this template to populate your payload.json file in .

After running the above command, if you see an unexpected error, follow our to fix it. A common error is:

Once you have created a template for your DIDDoc and generated your keys, and before creating a DID on-ledger, you will need to prepare the payload.json file. This file can be saved where ever you choose, but the location must be specified in the create DID command used in . (By default, it will be saved under the project root directory.)

You should copy and paste the output of as an initial starting template for your payload.json file.

Note that transaction fees are paid by the cheqd account set in the agent.yml configuration file, . Each of cheqd's on-ledger identity transactions has a fixed fee, . If your account has insufficient balance the transaction will fail.

If your transaction is successful, you'll receive a success message along with the transaction details. You can on-ledger.

If you are using testnet, you can top-up your testnet balance using our .

You can also configure your Leap wallet to .

If you are using mainnet, you can .

Check out our to see common errors and fixes.

đŸ› ī¸
🍈
DID Operations Troubleshooting Guide
setup here
the pricing for cheqd DIDs and DID-Linked Resources can be found here
query your DID using the instructions here to see the representation of your DID Document
testnet faucet
support cheqd testnet using the instructions here
purchase CHEQ tokens here
troubleshooting guide for DID Operations
configured the cheqd plugin's agent settings
in the key management guide
Step 3
Step 2
Step 3
Step 1
106B
identity-keys-on-the-fly-with-did-docs.json
Example file for creating DID Document template