Update an existing DID
Follow these instructions to update an existing
did:cheqdentry on cheqd ledger.
⚠️ Before you begin...
Before updating the DID, you will need to prepare the updated DIDDoc and parameters for the transaction in an
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.)
local): Key Management System (KMS) to be used for storage.
didthat resolves to your
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.
amount: An array of coins, coins are represented as an object with 2 fields
denom: 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 address
granter(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.ymlconfiguration 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.
Use the command below to construct and broadcast update transaction.
So, let's try to update
servicesection of our
DIDDoc. Then, your
payload.jsonfile will look like this.
"versionId": "<uuid>", // optional
Note, that we are updating a
servicesection of in our
After you have updated the
payload.jsonfile, run the command below to update the
veramo execute -m cheqdUpdateIdentifier --argsFile path/to/payload.json
If you would like to fetch the updated DIDDoc body following the successful DID update result, execute the
resolvecommand as outlined here. You can check if
DIDDochas been updated.
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.