Registries
Revocation means deleting or updating a credential. On Dock, credential revocation is managed with a revocation registry.
There can be multiple registries on the chain, and each registry has a unique id. It is recommended that the revocation authority create a new registry for each credential type. Dock Certs allows you to create, delete, and revoke/unrevoke the credential. You can retrieve a specified registry as well as a list of all registries created by the user.
For a detailed example of the registry workflow. Please refer here.
If you want to revoke ZKP credentials, you must create a registry with type `DockVBAccumulator2022`. For revoking other credentials, you can use `StatusList2021Entry`.
Endpoints
POST /registries GET /registries GET /registries/{id} POST /registries/{id} DELETE /registries/{id}
Create Registry
To create a registry, you have to create a policy
object for which a DID is needed. It is advised that the DID is registered on the chain first. Otherwise, someone can look at the registry and register the DID, thus gaining control of the registry.
Choosing the right revocation registry is essential. Here's a simplified overview of the available options:
StatusList2021Entry
Only supports non-ZKP credentials.
Recommended for most users.
Collective Tracking: Manages all revocation entries together, making it less costly to revoke multiple credentials simultaneously.
W3C Compliant.
DockVBAccumulator2022
Only supports ZKP credentials.
Utilizes an on-ledger accumulator for enhanced privacy.
Offers more privacy than the W3C Status List 2021.
Deprecated
CredentialStatusList2017
Only supports non-ZKP credentials.
Individual Tracking: Each entry is tracked separately, which means more ledger space is used for multiple entries.
This registry is cost-effective for a single entry. However, managing several entries can be more expensive.
Implements add-only policies.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
addOnly | body | boolean | false | True/false options. The default value is "false". |
policy | body | [DIDDock] | true | The DIDs which control this registry. You must own a DID listed here to use the registry. Only one policy supported as of now: |
type | body | string | false | Specifies which type of registry to create. Defaults to |
Enumerated Values
Parameter | Value | Description |
---|---|---|
type | StatusList2021Entry or DockVBAccumulator2022 | The type used in registry creation. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will try to create the registry. | ||
400 | The request was unsuccessful, because of invalid params, e.g., policy not supported. | ||
402 | Transaction limit reached or upgrade required to proceed |
List Registries
Return a list of all registries created by the user. The list is returned with the registry id and policy of the revocation registry.
For now, only one policy is supported, and each registry is owned by a single DID.
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 | The request was successful and will return all registries created by the user. | Inline | |
402 | Transaction limit reached or upgrade required to proceed |
Get Registry
Get the details of an existing registry, such as policy, add-only status, when it was last updated, and controller(s). You need only supply the revocation registry id that was returned upon revocation registry creation.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | true | Revocation registry id. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will return the revocation registry metadata. | ||
404 | The request was unsuccessful, because the registry was not found. | ||
402 | Transaction limit reached or upgrade required to proceed |
Revoke/Unrevoke Credential
Credential revocation is managed with on-chain revocation registries. To revoke a credential, its id (or hash of its id) must be added to the credential. It is advised to have one revocation registry per credential type. Revoking an already revoked credential has no effect.
Similar to the replay protection mechanism for DIDs, the last modified block number is kept for each registry, which is updated each time a credential is revoked or unrevoked. Unrevoking an unrevoked credential has no effect.
In this API, simply add Revoke/Unrevoke into the action
parameter and input the desired credential ids.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | true | Revocation registry id. | |
action | body | string | false | The action taken, either revoke or unrevoke. The default value is "revoke" |
credentialIds | body | array | true | The list of credential ids to act upon. |
Enumerated Values
Parameter | Value | Description |
---|---|---|
action | revoke or unrevoke | Action to take on the registry. |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and will try to revoke/unrevoke the credential. | ||
400 | The request was unsuccessful, because of invalid params. | ||
404 | The request was unsuccessful, because the registry was not found. | ||
402 | Transaction limit reached or upgrade required to proceed |
Delete Registry
A registry can be deleted, leading to all the corresponding revocation ids being deleted as well. This requires the signature from the owner, similar to the other updates.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | true | Revocation registry id. |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | The request was successful and revocation registry will be deleted. | ||
404 | The request was unsuccessful, because the registry was not found. | ||
402 | Transaction limit reached or upgrade required to proceed |
Last updated