Skip to main content
Version: v4 (next)

Create a Trust Registry

MOD-TR-MSG-1

Make sure you've read the Learn section.

Post a message that will modify the ledger state by creating a trust registry. This operation is delegable — it can be executed by an operator on behalf of an authority (group account).

This creates a TrustRegistry, a GovernanceFrameworkVersion (v1), and a GovernanceFrameworkDocument in a single transaction.

Prerequisites

Before creating a trust registry, ensure you have completed these steps:

  1. Create a group account — The authority that controls the trust registry must be a Cosmos SDK group with a decision policy. This group will be the authority.
  2. Grant operator authorization — Use the Delegation module to authorize your operator account to execute TR messages on behalf of the authority (via a group proposal).
  3. Prepare your Ecosystem Governance Framework (EGF) — Have your EGF document published at a public URL and calculate its digest-sri hash.

Message Parameters

NameDescriptionMandatory
authorityGroup account that will control the trust registryyes
didDecentralized Identifier (DID) — must follow DID-CORE syntaxyes
languageBCP 47 default language tag (e.g., en, fr, es), max 17 charsyes
doc-urlURL of the EGF in the default languageyes
doc-digest-sriHash (e.g., SHA-384) with SRI format prefixyes
akaAlso Known As URIno

Required Environment Variables

Set the following environment variables before running the CLI commands:

USER_ACC=my-user-account
CHAIN_ID=vna-testnet-1
NODE_RPC=https://rpc.testnet.verana.network

Post the Message

Usage

veranad tx tr create-trust-registry [authority] [did] [language] [doc-url] [doc-digest-sri] \
[--aka <aka>] \
--from <operator> --chain-id <chain-id> --keyring-backend test --fees <amount> --gas auto --node $NODE_RPC
info

The [authority] is the group account address. The --from flag specifies the operator (transaction signer) who must be authorized by the authority.

Example #1: Basic creation

veranad tx tr create-trust-registry $AUTHORITY_ACC did:example:123456789abcdefghi en \
https://example.com/doc sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26 \
--from $USER_ACC --chain-id ${CHAIN_ID} --keyring-backend test --fees 600000uvna --node $NODE_RPC

Example #2: With AKA (Also Known As)

veranad tx tr create-trust-registry $AUTHORITY_ACC did:example:123456789abcdefghi en \
https://example.com/doc001-01 sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68001 \
--aka http://example.com \
--from $USER_ACC --chain-id ${CHAIN_ID} --keyring-backend test --fees 600000uvna --node $NODE_RPC
tip

How to find the id of the trust registry that was just created?

TX_HASH=<replace with tx-hash>
veranad q tx $TX_HASH \
--node $NODE_RPC --output json \
| jq '.events[] | select(.type == "create_trust_registry") | .attributes | map({(.key): .value}) | add'

Replace with the correct transaction hash.

Publish your Trust Registry in your DID Document

Make sure to add the corresponding service entry to your DID Document in order to prove ownership of the DID, by replacing 1234 with your trust registry id and setting the serviceEndpoint:

"service": [
{
"id": "did:example:ecosystem#vpr-schemas-trust-registry-1234",
"type": "VerifiablePublicRegistry",
"version": "1.0",
"serviceEndpoint": ["vpr:verana:testnet"]
}
]