Update an existing DID
Follow these instructions to update an existing did:cheqd
entry on cheqd ledger.
⚠️ Before you begin...
Make sure you've correctly configured the cheqd plugin's agent settings for Veramo CLI
Instructions
1. Prepare DIDDoc contents
Before updating the DID, you will need to prepare the updated DIDDoc and parameters for the transaction in an payload.json
file.
This file can be saved whereever you choose, but the location must be specified in the create DID command used in Step 2. (By default, it will be saved under the project root directory.)
Parameters
kms
(defaultlocal
): Key Management System (KMS) to be used for storage.did
: Thedid
that resolves to yourDIDDoc
.alias
: A human-friendly alias for the DID. Only used locally when referencing operations in Veramo CLI.document
: Full body of the DID Document including updated sections.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 fieldsdenom
: ncheq (smallest denomination classification)amount
: 25000000000 (This is 25 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 addressgranter
(optional): The cheqd fee granter address, Provided the grantee has an allowance by the granter
Note that transaction fees are paid by the cheqd account set in the
agent.yml
configuration file, setup here. Each of cheqd's on-ledger identity transactions has a fixed fee, the pricing for cheqd DIDs and DID-Linked Resources can be found here. If your account has insufficient balance the transaction will fail.
2. Update existing DID
Use the command below to construct and broadcast update transaction.
So, let's try to update service
section of our DIDDoc
. Then, your payload.json
file will look like this.
Note, that we are updating a service
section of in our DIDDoc
.
After you have updated the payload.json
file, run the command below to update the did
:
If you would like to fetch the updated DIDDoc body following the successful DID update result, execute the resolve
command as outlined here. You can check if service
section of DIDDoc
has been updated.
Next steps
DID update operations can be complicated, especially when changing or updating keys, using multiple keys etc. Understand the design of the cheqd DID method and Verification Relationships in the W3C DID Core specification to understand the logic that is applied in these scenarios.
Last updated