Update a DID
Update a did:cheqd DID using the Credo Agent.
Prerequisites
How DID Updates Work
Example: Add a New Service and Verification Method
import { DidDocumentService } from '@credo-ts/core'
await agent.dids.update({
did: 'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411',
// Used to authorize and derive additional keys, if needed
secret: {
verificationMethod: {
id: 'key-2',
type: 'JsonWebKey2020', // Can also be Ed25519VerificationKey2020, etc.
},
},
didDocument: {
id: 'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411',
controller: ['did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411'],
verificationMethod: [
{
id: 'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411#key-1',
type: 'Ed25519VerificationKey2020',
controller: 'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411',
publicKeyMultibase: 'z6MknkzLUEP5cxqqsaysNMWoh8NJRb3YsowTCj2D6yhwyEdj',
},
],
authentication: [
'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411#key-1',
],
service: [
new DidDocumentService({
id: 'did:cheqd:testnet:b84817b8-43ee-4483-98c5-f03760816411#website',
type: 'linkedDomains',
serviceEndpoint: 'https://rand.in',
}),
],
},
})Parameters Reference
Parameter
Required
Description
Last updated
Was this helpful?