Create a DID-Linked Resource
Follow these instructions to create a new Resource linked to a DID using DID registrar. This tutorial will use the cheqd did regisrtar swagger API's and the Veramo CLI.
⚠️ Before you begin... Make sure you've completed creating a DID for this tutorial for Veramo CLI
1. Request Create Operation
Use the /{did}/create-resource
api to publish a new DID-Linked Resource
Paste the DID in the did path parameter
Generate request body by providing name, type and base64 encoded data
Click 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.
2. 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 resource.
Copy the Result value from the response.
3. Submit Signature
Use the /create-resource
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
4. Check your Resource is live
You can check your DID on the Universal Resolver or by going to: https://resolver.cheqd.net/1.0/identifiers/{yourDID}/resources/{yourResourceId}
Last updated