Create a DID
Summary
These instructions will help developers create DIDs on cheqd using the DID Registrar.
Watch this video for a simple walkthrough
What you need
Any framework for creating keys and signing payloads, such as Veramo CLI;
cheqd DID Registrar
5 minutes!
Figure 1: Swagger UI for DID Registrar
1. Setup Veramo CLI
This tutorial will be using the Veramo CLI for Key management. Setup the cli following this tutorial
2. Generate Key Pair in Veramo wallet
Enter the below command in the cli
3. Generate DID Payload
Go to "cheqd helpers" in our Registrar Driver here and click "try it out" in the top right corner.
Select the following options:
Select VerificationMethodType
Select MethodSpecificAlgo
Select network
Enter the publicKeyHex value generated in the previous step
Figure 2: Creating a DID payload from template
Copy the didDoc
field from the output.
4. Request Create Operation
Use /create
to publish the DID
Paste the contents of
didDoc
from the previous step in thedidDocument
field of the/create
api bodyClick on execute to perform the request
This response requests an
action
for you to sign the serialized payload again in a CLI. This is a security feature which means you are not passing your private key to the Registrar. Note down the serialized payload, jobId from the response
5. Sign Payload
Sign the serialized payload in your CLI with the below command
Fill in the prompts
keyRef: Enter the kid of the keyPair generated in the first step
algorithm:
Ed25519
data to sign: Paste the serialized payload from the previous step
enconding: Select
base64
NOTE: If there are n verification methods for the controller then n signatures are required to publish a DID.
Copy the Result value from the response.
6. Submit Signature
Use the /create
api again
Create the payload using the following values
jobId
secret
signingResponse
verificationMethodId
signature
Click on Execute
The state in didState should be
finished
in the response, the DID is created successfully
7. Check your DID is live
You can check your DID on the universal resolver or by going to https://resolver.cheqd.net/1.0/identifiers/{yourDID}
Last updated