DIDs
DID stands for Decentralized IDentifiers. DIDs are meant to be globally unique identifiers that allow their owner to prove cryptographic control over them. A DID identifies any subject (e.g., a person, organization, thing, data model, abstract entity, etc.) that the controller of the DID decides that it identifies.
DIDs in Dock are created by choosing a 32-byte unique (on Dock chain) identifier along with a public key. You can update and delete a DID as well as list all DIDs. DID is identified by a unique, random key.
For a detailed example of the DIDs workflow. Please refer here.
Currently a DID can have only one key at a time as a controller, soon we will support multiple keys per DID.
Endpoints
POST /dids GET /dids/{did} GET /dids DELETE /dids/{did} POST /dids/{did}/export
Create DID
A DID, a public key, and a controller are required to create a new DID. The controller is both the owner of the public key and a DID. The DID can be created using an auto-generated keypair, and the controller will be the same as the DID unless otherwise specified. The DID and public key have no cryptographic relation.
It is important to have a public key of one of its three supported types. Dock supports 3 types of public keys: sr25519
, ed25519
, and secp256k1
.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | body | false | DID as fully qualified, e.g., | |
type | body | string | false | Specifies the DID method to for the generated DID. Supported options are |
controller | body | false | DID as fully qualified, e.g., | |
keyType | body | false | Type of public key for DID. The default value of the keyType is |
Enumerated Values
Parameter | Value | Desctiprion |
---|---|---|
keyType | sr25519 or ed25519 or secp256k1 or bjj | keyType signature variants. |
type | dock or key or polyginid | which DID method to generate |
When creating a Polygon ID DID, be sure to set the `keyType` field to `bjj`.
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will try to create DID. NOTE: DID does not exist on network until the job identified in the response is complete. | ||
400 | The request was unsuccessful, because of invalid params. | ||
402 | Transaction limit reached or upgrade required to proceed |
Get DID
When a DID is provided in the path, the API will attempt to resolve that DID into a DID document. This document contains the public keys and more information relating to that DID, check the identity foundation did configuration document to learn more.
The API supports resolving many DID methods, some examples are:
did:dock:5CEdyZkZnALDdCAp7crTRiaCq6KViprTM6kHUQCD8X6VqGPW
- resolves through the Dock blockchaindid:key:z6MkjRagNiMu91DduvCvgEsqLZDVzrJzFrwahc4tXLt9DoHd
- the public key is embedded in the DID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | true | Represents a specific DID that uniquely identifies the key resource. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will return the DID doc. | ||
404 | The requested DID was not found. | ||
402 | Transaction limit reached or upgrade required to proceed |
List DIDs
Return a list of all DIDs that your user account controls as fully resolved DID documents.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
offset | query | integer | false | How many items to offset by for pagination |
limit | query | integer | false | How many items to return at one time (max 64) |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | All of a user's DIDs fully resolved into DID documents. | ||
402 | Transaction limit reached or upgrade required to proceed |
Delete DID
Deletes a DID and its metadata from the blockchain and our platform. This will also delete the associated keypair from the key management system meaning that you cannot sign messages or credentials with it after this operation. The DID will no longer be able to be resolved. This operation is not reversible.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | true | Represents a specific DID that uniquely identifies the key resource. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will remove the DID. | ||
401 | The request was unsuccessful, because you don't own the DID. | ||
404 | The DID does not exist. | ||
405 | The {did} value is blank/empty. Please ensure that the {did} value does exist. | ||
402 | Transaction limit reached or upgrade required to proceed |
Export DID
Exports the DID document and keys as an encrypted Universal Wallet JSON-LD document
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
did | path | true | Represents a specific DID that uniquely identifies the key resource. | |
password | body | string | true | A password to encrypt the JSON-LD payload with |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and the DID has been exported. | ||
401 | The request was unsuccessful, because you don't own the DID. | ||
404 | The DID does not exist. |
Last updated