Create Identity Keys and Subject DIDs

Issuers may want to create identity keypairs for multiple reasons, such as for signing payloads or for creating did:key DIDs.

Create an identity key pair.

This endpoint creates an identity key pair associated with the user's account for custodian-mode clients.

POST/key/create
Query parameters
Response

The request was successful.

Body
kidstring
typeenum
Ed25519Secp256k1
publicKeyHexstring
Request
const response = await fetch('/key/create', {
    method: 'POST',
    headers: {},
});
const data = await response.json();
Response
{
  "kid": "text",
  "type": "Ed25519",
  "publicKeyHex": "text"
}

There is also an option to fetch an identity keypair by inputting a Key ID (kid) as a request format.

Fetch an identity key pair.

This endpoint fetches an identity key pair's details for a given key ID. Only the user account associated with the custodian-mode client can fetch the key pair.

GET/key/read/{kid}
Path parameters
kid*string

Key ID of the identity key pair to fetch.

Response

The request was successful.

Body
kidstring
typeenum
Ed25519Secp256k1
publicKeyHexstring
Request
const response = await fetch('/key/read/{kid}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "kid": "text",
  "type": "Ed25519",
  "publicKeyHex": "text"
}

Creating a Subject DID

cheqd Studio currently supports two types of subject DIDs:

  • did:key

  • did:vda

With the former, you can follow the did:key specification to create a subject DID based on a generated keypair.

With the latter, you can setup your did:vda subject DID on your Verida wallet. Using cheqd Studio, you will be able to send credentials to your Verida wallet and use it to store and securely back them up.

Last updated