Skip to main content

Client

Clients can interact with this module via:

The CLI supports the addition of the --verifiable-presentation flag to the txFactory to satisfy the requirement of the AnteHandler.

CLI

The txFactory is updated in the sdk to add the --verifiable-presentation flag to satisfy the requirement of the anteHandler. The base64 encoded verifiable presentation is passed as the argument to the flag which will populate the ExtensionOptions field in the transaction, then signed and broadcasted as usual.

For example:

d tx notary notarise <data> --from alice --verifiable-presentation <base64 encoded verifiable presentation>

Transactions

There are no transactions to execute for this module as authority is the chain's governance module. All execution should go through x/gov on the chain.

Query

Get Verification Registry

Gets the verification routes registry state

dchain query vcv get-routes-registry

verification_routes_registry:
- message: cosmos.bank.v1beta1.MsgSend
route:
app_addr: dchain1gwqac243g2z3vryqsev6acq965f9ttwhpka3ds
route_id: "1"
- message: cosmos.staking.v1beta1.MsgCreateValidator
route:
app_addr: dchain1mx5e3jkxvzf8frl7cl8m69264ctn0shl3yfa4v
route_id: "1"

Get Message Route

Gets the route of the specific message

# dchain query vcv get-message-route <Msg>

dchain query vcv get-message-route cosmos.staking.v1beta1.MsgCreateValidator
route:
app_addr: dchain1mx5e3jkxvzf8frl7cl8m69264ctn0shl3yfa4v
route_id: "1"

gRPC

Query Service

The vcv module provides a gRPC query service defined in d/vcv/v1/query.proto.

GetRoutesRegistry

Get the verification routes registry state:

grpcurl -plaintext localhost:9090 d.vcv.v1.Query/GetRoutesRegistry

Request:

message QueryRoutesRegistryRequest {}

Response:

message QueryGetRoutesRegistryResponse {
repeated RoutesRegistryEntry routes = 1;
}

message RoutesRegistryEntry {
string key = 1;
RouteAndAdditionalReq value = 2;
}

GetMessageRoute

Get the route of a specific message:

grpcurl -plaintext -d '{"message": "cosmos.staking.v1beta1.MsgCreateValidator"}' \
localhost:9090 d.vcv.v1.Query/GetMessageRoute

Request:

message QueryMessageRouteRequest {
string message = 1;
}

Response:

message QueryGetMessageRouteResponse {
RouteAndAdditionalReq route_and_additional_req = 1;
}

GetVerifierContract

Get the verifier contract for a specific credential type:

grpcurl -plaintext -d '{"vctype": "ProofOfIdentity"}' \
localhost:9090 d.vcv.v1.Query/GetVerifierContract

Request:

message QueryGetVerifierContractRequest {
string vctype = 1;
}

Response:

message QueryGetVerifierContractResponse {
VerifierContract verifier_contract = 1;
}

GetRouteRequirements

Get the verification requirements for a specific route:

grpcurl -plaintext -d '{"app_addr": "dchain1gwqac243g2z3vryqsev6acq965f9ttwhpka3ds", "route_id": "1"}' \
localhost:9090 d.vcv.v1.Query/GetRouteRequirements

Request:

message QueryGetRouteRequirementsRequest {
string app_addr = 1;
uint64 route_id = 2;
}

Response:

message QueryGetRouteRequirementsResponse {
OutputVerificationRequirements requirements = 1;
}

REST

Query Endpoints

REST endpoints are available via the gRPC-gateway.

GET /d/vcv/v1/verification_routes_registry

Get the verification routes registry state.

Example:

curl http://localhost:1317/d/vcv/v1/verification_routes_registry

Response:

{
"routes": [
{
"key": "cosmos.bank.v1beta1.MsgSend",
"value": {
"route": {
"app_addr": "dchain1gwqac243g2z3vryqsev6acq965f9ttwhpka3ds",
"route_id": "1"
}
}
}
]
}

GET /d/vcv/v1/verification_routes_registry/(message)

Get the route of a specific message.

Example:

curl http://localhost:1317/d/vcv/v1/verification_routes_registry/cosmos.staking.v1beta1.MsgCreateValidator

Response:

{
"route_and_additional_req": {
"route": {
"app_addr": "dchain1mx5e3jkxvzf8frl7cl8m69264ctn0shl3yfa4v",
"route_id": "1"
}
}
}

GET /d/vcv/v1/verifier_contract/(vctype)

Get the verifier contract for a specific credential type.

Example:

curl http://localhost:1317/d/vcv/v1/verifier_contract/sdjwt

Response:

{
"verifier_contract": {
"address": "dchain1...",
"credential_type": "sdjwt"
}
}