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 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
      • 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
      • 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

Was this helpful?

Edit on GitHub
Export as PDF
  1. Start using cheqd
  2. Create DIDs and Identity Keys

Update a DID

Update a did:cheqd Decentralized Identifier (DID) using cheqd Studio.

Users are able to update DID Documents for various reasons, such as to include a new section (such as service) or to rotate the verificationMethod or authentication keys within the DID Document.

With the /did/update API, users are able to input either:

  1. The specific section(s) of the DID Document to be updated; or

  2. The full updated DID Document body.

For the /did/update function, users are recommended to use the application/json request format for the API.

Example Request formats

Update Service Section

To update individual sections of the DID Document, users are able to pass only the section they would like to update. For example, users may often want to update the service section to add or change a serviceEndpoint:

{
  "did": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881",
  "service": [
      {
        "id": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#website",
        "type": "LinkedDomains",
        "serviceEndpoint": [
          "https:example.com"
        ]
      }
    ]
}

The above request format will replace the service section of the existing DID Document with the new section. No extra information, such as the verificationMethod or authentication keys need to be passed with the request, because cheqd Studio custodies the keys on behalf of the user.

Rotate Keys

Users may regularly want to rotate the keys used to control the DID. Like with the service section above, users are able to pass the sections of the DID Document that include the rotated keys, usually contained within theverificationMethod and authentication sections.

Other sections such as keyAgreement, capabilityInvocation, capabilityDelegation, assertionMethod, etc. may also be updated via this method

{
  "did": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881",
  "verificationMethod": [
     {
       "id":"did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#key-2",
       "type":"Ed25519VerificationKey2018",
       "controller":"did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881",
       "publicKeyBase58":"4sjwZ3VGWupJ26ytxjhU6LhjKiPrHV5reZbaNseyHtf8"
     }
  ],
  "authentication": [
       "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#key-2"
  ]
}

The example above will rotate the keys that control the DID Document, updating the DID Document's verificationMethod and authentication sections accordingly.

Any top level section of the DID Document may be updated this way, including the likes of alsoKnownAs, assertionMethod, capabilityDelegation, etc.

Pass full updated DID Document body

Users may alternatively want to update the DID Document body in full, and pass the updated DID Document to the API. For example:

{
  "didDocument": {
    "@context": [
      "https://www.w3.org/ns/did/v1",
      "https://w3id.org/security/suites/ed25519-2018/v1"
    ],
    "id": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881",
    "controller": [
      "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881"
    ],
    "verificationMethod": [
      {
        "id": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#key-1",
        "type": "Ed25519VerificationKey2018",
        "controller": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881",
        "publicKeyBase58": "4sjwZ3VGWupJ26ytxjhU6LhjKiPrHV5reZbaNseyHtf8"
      }
    ],
    "authentication": [
      "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#key-1"
    ],
    "service": [
      {
        "id": "did:cheqd:mainnet:71e24492-e62c-4e55-a581-007a6e36e881#website",
        "type": "LinkedDomains",
        "serviceEndpoint": [
          "https://example.com"
        ]
      }
    ]
  }
}

This method may be better for users wanting to update larger portions of the DID Document, or for having full visibility over the updated body.

Get started with the API below

Use the /did/update API below to pass your DID Document update as a request, using either the full body or a specific section.

Last updated 1 day ago

Was this helpful?

đŸŸĸ
🆔
  • Example Request formats
  • Pass full updated DID Document body
  • Get started with the API below
  • POSTUpdate a DID Document.

Update a DID Document.

post

This endpoint updates a DID Document. As an input, it can take JUST the sections/parameters that need to be updated in the DID Document (in this scenario, it fetches the current DID Document and applies the updated section). Alternatively, it take the fully-assembled DID Document with updated sections as well as unchanged sections.

Authorizations
Body
didstringOptional

DID identifier to be updated.

Example: did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0
authenticationstring[]Optional

Authentication section of the DID Document.

publicKeyHexsstring[]Optional

List of key references (publicKeys) which will be used for signing the message. The should be in hexadecimal format and placed in the wallet of current user.

Responses
200
The request was successful.
application/json
400
A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.
401
Access token is missing or invalid
500
An internal error has occurred. Additional state information plus metadata may be available in the response body.
post
POST /did/update HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 1226

"did='did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0'&service=[{'id':'did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1','type':'LinkedDomains','serviceEndpoint':['https://example.com']}]&verificationMethod=[{'controller':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0','id':'did:cheqd:testnet :7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1','publicKeyBase58':'BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt','type':'Ed25519VerificationKey2018'}]&authentication=['text']&publicKeyHexs=['text']&didDocument={'@context':['https://www.w3.org/ns/did/v1'],'id':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0','controller':['did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0'],'verificationMethod':[{'id':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1','type':'Ed25519VerificationKey2018','controller':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0','publicKeyBase58':'z6MkkVbyHJLLjdjU5B62DaJ4mkdMdUkttf9UqySSkA9bVTeZ'}],'authentication':['did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1'],'service':[{'id':'did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1','type':'LinkedDomains','serviceEndpoint':['https://example.com']}]}"
{
  "did": "text",
  "controllerKeyId": "text",
  "keys": [
    {}
  ],
  "services": [
    {
      "id": "did:cheqd:mainnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
      "type": "LinkedDomains",
      "serviceEndpoint": [
        "https://example.com"
      ]
    }
  ],
  "controllerKeyRefs": [
    "text"
  ],
  "controllerKeys": [
    "text"
  ]
}