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 Issuer DID
      • Create Identity Keys and Subject DIDs
      • Resolve a DID
      • Update a DID
      • Deactivate a DID
    • βœ…Issue Credentials and Presentations
      • Issue Credential
      • Setup Verida Wallet
      • Verify Credential
      • Verify Presentation
      • Revoke Credential
      • Suspend or Unsuspend 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 Verifiable Accreditation
        • Verify 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 DID-Linked Resource
      • Search DID-Linked Resource
  • πŸ› οΈ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 DID-Linked Resource
        • Resolve DID-Linked Resource
        • Create AnonCreds Schema
        • Create AnonCreds Credential Definition
      • Verifiable Credentials and Presentations
        • Issue a Verifiable Credential (AnonCreds)
        • Present a Verifiable Credential (AnonCreds)
    • 🍊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
      • Decentralised 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
      • 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
  • ⚠️ Prerequisites
  • Method Overview
  • Create DID
  • Parameters​
  • Option 1: Create a DID from a full DID Document
  • Option 2​
  • What’s Next?

Was this helpful?

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

Create a DID

Create a did:cheqd DID using the Credo Agent.

Last updated 6 days ago

Was this helpful?

This tutorial shows you how to create a cheqd DID using your configured Credo Agent, and how to publish the associated DID Document to the cheqd ledger.

⚠️ Prerequisites

Before you begin:

  • βœ… Ensure your Credo agent is correctly configured with the @credo-ts/cheqd module

  • βœ… You’ve set up a cosmosPayerSeed for publishing to the cheqd network

  • βœ… You're connected to the correct network (mainnet or testnet)

Method Overview

Credo supports two approaches to creating a DID:

Option 1 – Manually construct a full DID Document

Use when you want full control over the DID structure and already have key(s) in your wallet.

Option 2 – Auto-generate the DID Document

Use when you want Credo to create the DID Document from a key you specify in secret.

Create DID

Parameters

  1. method*: cheqd

  2. secret

  3. options*

  4. didDocument

Option 1: Create a DID from a full DID Document

  1. First, generate a key pair:

const key = await agent.wallet.createKey({
  keyType: KeyType.Ed25519,
})

const ed25519PublicKeyBase58 = key.publicKeyBase58
  1. Use that key to construct and register the DID Document:

import { DidDocument } from '@credo-ts/core'

await agent.dids.create<CheqdDidCreateOptions>({
  method: 'cheqd',
  secret: {}, // No secret needed if key is already in wallet
  options: {
    network: 'testnet',
  },
  didDocument: new DidDocument({
    id: 'did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d',
    controller: ['did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d'],
    verificationMethod: [
      {
        id: 'did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d#key-1',
        type: 'Ed25519VerificationKey2018',
        controller: 'did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d',
        publicKeyBase58: ed25519PublicKeyBase58,
      },
    ],
    authentication: [
      'did:cheqd:testnet:92874297-d824-40ea-8ae5-364a1ec9237d#key-1',
    ],
  }),
})

πŸ“ Make sure the publicKeyBase58 matches the key in your wallet. The DID will be written to the testnet unless you specify "mainnet" in options.network.

If you don’t want to manually build a DID Document, you can let Credo handle it based on your input key type and ID.

await agent.dids.create({
  method: 'cheqd',
  secret: {
    verificationMethod: {
      id: 'key-1', // Logical key name
      type: 'Ed25519VerificationKey2020', // Or another supported type
    },
  },
  options: {
    network: 'testnet',
    methodSpecificIdAlgo: 'uuid', // Optional: 'uuid' (default) or 'base58'
  },
})

πŸ” Credo will generate the DID Document using the key referenced in secret and publish it to the network.

What’s Next?

Now that your DID is live on the cheqd network, try:

Option 2

πŸ› οΈ
🍏

Create DID-Linked Resource

Associate DID-Linked Resources to your DID using Credo.

Issue Verifiable Credentials

Issue Credentials using your cheqd DID using Credo.

​
​