Trust Registry integration guide

This guide provides step-by-step instructions for integrating a trust registry into any application using a series of API endpoints. This guide assumes a basic understanding of essential elements such as DIDs, JWTs, and specific configurations.

Download a sample Postman collection here.

Prerequisites

Before starting, ensure you have:

  • A DID for the convener (did:dock:convener) with associated profile

  • A DID for the participant (did:dock:pariticpant) with associated profile

Step-by-step guide

1. Create a trust registry

Create a trust registry using the convener's DID and relevant metadata.

POST /trust-registries This endpoint creates a new trust registry with the provided metadata and convener DID.

Body:

{
  "name": "Dock Trust Registry",
  "description": "Qui labore ad consequat exercitation excepteur nulla deserunt qui sunt deserunt laboris quis dolore voluptate!",
  "logoUrl": "https://logo.com/registry",
  "ecosystemUrl": "https://myecosystem.com",
  "governanceFramework": "Consectetur non anim incididunt duis ullamco est in irure labore quis.",
  "governanceFrameworkVersion": "1.0.0",
  "convener": "did:dock:convener"
}

Response:

2. Add participants to the trust registry

Invite participants (e.g., issuers, verifiers) to the trust registry and assign schemas.

Note: Roles are automatically assigned based on the schemas allocated to a participant:

  • If a participant can only issue credentials using the assigned schemas, they are designated as an issuer.

  • If a participant can only verify credentials using the assigned schemas, they are designated as a verifier.

  • If a participant can both issue and verify, they are designated as a verifier+issuer. A participant without any assigned schemas will have a verifier role but will only be able to verify public schemas within the ecosystem.

POST /trust-registries/{trust_registry_id}/participants This endpoint invites a participant to the trust registry with specified schemas they are allowed to issue or verify. Will be called by the trust registry convener.

Body:

Note: An empty body will result in a verifier role for the participant, allowing them only to verify public schemas. Issuer and verifier schemas can be assigned in the invitation by adding the schema IDs to the request body.

Response:

Accept the invitation:

POST /trust-registries/invitations/accept This endpoint accepts an invitation to join a trust registry using a provided token. Will be called by a trust registry participant to join the registry.

Body:

Response:

Note:

  • The DID's profile name, description, and logo will be applied to the participant. The name and logo are required for DIDs that will be used as participants.

  • Invitations can be snoozed using POST /trust-registries/invitations/snooze

  • Invitations can be declined using POST /trust-registries/invitations/decline

Error Handling:

  • Attempting to reuse an invite token will result in an error.

  • Inviting a participant that already exists in the registry may also cause an error.

3. Retrieve trust registry details

Retrieve details of the trust registry, including participants and schemas.

GET /trust-registries/{trust_registry_id} This endpoint retrieves detailed information about a specific trust registry. Useful for both the convener and participants to get an overview of the registry.

Response:

Note:

  • slug can be used instead of trust_registry_id

  • The public info about a trust registry is available at GET /trust-registries/{trust_registry_id}/public

4. Update trust registry metadata

Update the metadata of an existing trust registry.

PATCH /trust-registries/{trust_registry_id} This endpoint updates the metadata of an existing trust registry. Will be called by the convener to update details like the name, description, or governance framework.

Body:

Response:

5. Manage trust registry participants

a. Update participant information

Update a participant's information within the registry.

PATCH /trust-registries/{trust_registry_id}/participants/{participant_id}/info This endpoint updates a participant’s information within the trust registry. It can be used only by the participant to update his own informations.

Body:

Response:

Note: The name and logo can be updated by modifying the associated DID profile's information.

b. Suspend or unsuspend participants

Suspend or unsuspend a participant's status within the registry.

PATCH /trust-registries/{trust_registry_id}/participants/{participant_id} This endpoint updates a participant’s information within the trust registry, such as their assigned schemas or their status (e.g., suspended or active).

Body:

Response:

c. Get all participants

Get a list of all participants in the trust registry

GET /trust-registries/{trust_registry_id}/participants This endpoint retrieves detailed information about the participants from the trust registry

Response:

6. Manage schemas

a. Assign schemas to participants

Assign specific schemas to participants based on their roles.

PATCH /trust-registries/{trust_registry_id}/participants/{participant_id} This endpoint updates a participant’s information within the trust registry, such as their assigned schemas or their status (e.g., suspended or active). Will be called by the convener to manage participant roles and schemas.

Body:

Response:

b. Get trust registry schemas

Retrieve schemas associated with the trust registry.

GET /trust-registries/{trust_registry_id}/schemas This endpoint retrieves the list of schemas associated with a specific trust registry, including participant counts and public visibility. Useful for both the convener and participants.

Response:

7. Manage proof templates

a. Assign proof templates to the trust registry

Assign proof templates to the trust registry to enable credential verification. This will allow the verifiers in the trust registry to use the proof-template

POST /trust-registries/{trust_registry_id}/proof-templates This endpoint assigns a proof template to the trust registry, enabling it for use in credential verification. Will be called by the convener.

Body:

Response:

b. Retrieve proof templates

Retrieve proof templates associated with the trust registry.

GET /trust-registries/{trust_registry_id}/proof-templates This endpoint retrieves the list of proof templates associated with the trust registry. Useful for both the convener and participants.

Response:

8. Delete trust registry entities

a. Delete a trust registry participant

Remove a participant from the trust registry.

DELETE /trust-registries/{trust_registry_id}/participants/{participant_id} This endpoint removes a participant from the trust registry. Will be called by the convener to manage the registry’s participants.

Response:

b. Delete a trust registry proof template

Remove a proof template from the trust registry.

DELETE /trust-registries/{trust_registry_id}/proof-templates/{template_id} This endpoint removes a proof template from the trust registry. Will be called by the convener to manage the registry’s proof templates.

Response:

c. Delete a trust registry

Delete the entire trust registry.

DELETE /trust-registries/{trust_registry_id} This endpoint deletes the entire trust registry. Will be called by the convener when the trust registry is no longer needed.

Response:

Last updated

Was this helpful?