description |
---|
Create a DID using the did:cheqd method |
To create a cheqd DID (did:cheqd
) and associated DID Document there are two ways of building the payload for the request:
Make sure you have set up your account with cheqd Studio and are logged in, using our guide below:
Set up your account | Set up your account with cheqd Studio and get your API key to start using the APIs. | set-up-account.md |
Using the /did/create
API, users have two options for creating a did:cheqd
DID and associated DID Document on-ledger:
- Filling out a simple form using the
application/x-www-url-form-encoded
option within an API client of your choice. - Compiling a DID Document body yourself using the
application/json
option within an API client of your choice.
{% swagger src="https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json" path="/did/create" method="post" expanded="true" %} https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json {% endswagger %}
This is the easiest way to create DIDs on cheqd and is recommended for users who are not overly familiar with compiling DID Documents.
Using the application/x-www-url-form-encoded
option, users are able to choose between the following variables to compile your DID:
network (required)
- "testnet" (recommended for testing)
- "mainnet" (recommended for production)
methodSpecificIdAlgo (required)
- "uuid" - this is a Universally Unique Identifier (recommended)
- "base58btc" - this is an identifier which is commonly used for Hyperledger Indy transactions
verificationMethod / type (required)
- "Ed25519VerificationKey2018" (recommended)
- "Ed25519VerificationKey2020"
- "JSONWebKey2020"
assertionMethod (optional)
- true (recommended if used for issuing Verifiable Credentials)
- false
didDocument (optional)
This input field contains either a complete DID document, or an incremental change (diff) to a DID document. For example:
{
"service": [
{
"id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#service-1",
"type": "LinkedDomains",
"serviceEndpoint": [
"https://example.com"
]
}
]
}
From this request, the Credential Service will automatically create and publish a DID and associated DID Document to the ledger and return it as a response.
Instead of generating a DID Document using simple parameters, you can create a fully formatted DID Document yourself. Before, submitting a manually created DID, you will need to have created a set of identity keys to input the key material into the DID document.
Use the /key/create
API to generate a new keypair within the Credential Service key management store. Copy the "publicKeyHex".
To simplify this process of formatting a DID Document using your own keys, we've created a Helper Tool in our DID Registrar here. Simply paste in your publicKeyHex and choose the variables to compile your DID Document template.
Within the /did/create
JSON payload, paste the response of your DID Document template, with your own signing keys.
Request format:
{
"didDocument": {
"id": "did:cheqd:testnet:0ff9df5d-653b-4f77-a66c-0035abc34d63",
"controller": [
"did:cheqd:testnet:0ff9df5d-653b-4f77-a66c-0035abc34d63"
],
"verificationMethod": [
{
"id": "did:cheqd:testnet:0ff9df5d-653b-4f77-a66c-0035abc34d63#key-1",
"type": "JsonWebKey2020",
"controller": "did:cheqd:testnet:0ff9df5d-653b-4f77-a66c-0035abc34d63",
"publicKeyJwk": {
"crv": "Ed25519",
"kty": "OKP",
"x": "BFSLOxwMJgpmWRtTUuo0JAvz6VXGp4WDDcN0dFfCQKo"
}
}
],
"authentication": [
"did:cheqd:testnet:0ff9df5d-653b-4f77-a66c-0035abc34d63#key-1"
]
}
}
Hit execute on the API below to create your did:cheqd
DID and associated DID Document.
{% swagger src="https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json" path="/did/create" method="post" %} https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json {% endswagger %}
After creating a DID or multiple DIDs, users can list all the created DIDs associated with their account. Using the /did/list
API.
{% swagger src="https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json" path="/did/list" method="get" expanded="true" %} https://raw.githubusercontent.com/cheqd/credential-service/main/src/static/swagger-api.json {% endswagger %}
Below are a list of alternatives for creating cheqd DIDs.
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. | credo.md |
Veramo | The Veramo SDK Plugin supports JSON, JSON-LD credentials as well as cheqd Credential Payments in an SDK. | veramo-plugin |
Walt.id Community Stack | Walt.id Community Stack is an SDK that supports the European Architecture and Reference Framework (ARF) standards for identity, with full cheqd support. | ssi-kit.md |
DID Registrar | Simple setup for building cheqd DIDs into existing applications using REST APIs, building into the Universal Registrar. | did-registrar |
cheqd Cosmos CLI | Cosmos CLI which directly communicates with the cheqd network. This should only be used for testing environments. | cheqd-node-cli |