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
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.
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.
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
You can check your DID on the Universal Resolver or by going to: https://resolver.cheqd.net/1.0/identifiers/{yourDID}/resources/{yourResourceId}
This page describes how to use and set up the cheqd DID Registrar software package.
If you do not want to install anything and just want to test it using our testnet, you can load the REST API endpoint for registrar in your browser.
You should run your own registrar to perform DID Operations on the Mainnet.
Environment variables needed for the Registrar are
FEE_PAYER_TESTNET_MNEMONIC
: The cosmos payer mnemonic for the Cheqd Mainnet
FEE_PAYER_MAINNET_MNEMONIC
: The cosmos payer mnemonic for the Cheqd Tesnet, By default it's the Testnet Faucet
LOCAL_STORE_TTL
(default: 600
): The time in seconds for the registrar to store data in cache
PORT
(default: 3000
): The port number
Clone the repository
Build Docker container image using Dockerfile:
Run the Docker container (modify according to your own build tags and other desired parameters):
These instructions will help developers create DIDs on cheqd using the DID Registrar.
Any framework for creating keys and signing payloads, such as Veramo CLI;
cheqd DID Registrar
5 minutes!
Figure 1: Swagger UI for DID Registrar
This tutorial will be using the Veramo CLI for Key management. Setup the cli following this tutorial
Enter the below command in the cli
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.
Use /create
to publish the DID
Paste the contents of didDoc
from the previous step in the didDocument
field of the /create
api body
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
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.
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
You can check your DID on the universal resolver or by going to https://resolver.cheqd.net/1.0/identifiers/{yourDID}
REST API service for creating cheqd DIDs and DID-Linked Resources
The Universal Registrar is an open source application created by the Decentralized Identity Foundation (DIF) which aims to make it far easier to create, update and deactivate Decentralized Identifiers (DIDs) across a range of DID Methods without full integration.
The aim of the Universal Registrar is similar to the Universal Resolver; to transform method-specific APIs for DID transactions into a common format for client applications to easily call.
Not only does it make it easier for client applications to support DIDs from multiple DID methods, but it also makes it far quicker and easier to create, update and deactivate DIDs — as it calls the method-specific driver with a common API.
Therefore, the barrier for integrating cheqd DIDs into existing client applications has been greatly reduced by the Registrar. Instead of having to integrate with the cheqd SDK, applications can now create a simple workflow to call the relevant APIs for issuing, updating or deactivating cheqd DIDs and creating DID-Linked Resources.
There are plenty of other places you can go to get started creating cheqd DIDs. Simply pick the option which is best suited for your needs:
Setup DID Registrar
Setup DID Registrar yourself or use the Universal Registrar interface.
Create a DID
Create a DID simply over REST API.
Create a DID-Linked Resource
Create a DID-Linked Resource simply over REST API.
cheqd Studio
Our API product enables users to use cheqd's functionality with minimal complexity and easily integrate APIs into existing apps.
Veramo
The Veramo SDK Plugin is an extension of the Veramo SDK, a JavaScript framework for Trusted Data, adding support for cheqd functionality.
Credo
Credo is an SDK which supports the European Architecture and Reference Framework (ARF) standards as well as AnonCreds with full cheqd support for DIDs.
Walt.id SSI Kit
Walt.id SSI Kit is an SDK that supports the European Architecture and Reference Framework (ARF) standards for identity, with full cheqd support.
cheqd Cosmos CLI
Cosmos CLI which directly communicates with the cheqd network. This should only be used for testing environments.