Language

Choose a language

/build/rpc / assets / zk_compliance

getassetcomplianceroot

getassetcomplianceroot "asset_id_or_ticker" Query the active compliance root commitment for a KYC asset. Returns the commitment (root‖height packed), extracted height, max_root_age, and vk_commitment. Arguments: 1. asset_id_or_ticker (string, required) Asset identifier (hex) or ticker Result: { (json object) "asset_id" : "hex", (string) Asset identifier "compliance_root_commit" : "hex", (string) 32-byte commitment (root‖height) "root_height" : n, (numeric) Extracted capture height (last 4 bytes, big-endian) "max_root_age" : n, (numeric) Maximum merkle root age in blocks "zk_vk_commitment" : "hex", (string) ZK verification key commitment "has_commitment" : true|false (boolean) Whether a compliance root is set } Examples: > bitcoin-cli getassetcomplianceroot "a3f747562969280eb3ddc96ff57e3692b7b55611d8c89785f52fc2d1535d22b3" > bitcoin-cli getassetcomplianceroot "GOLD"

Signature

getassetcomplianceroot(asset_id_or_ticker: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"getassetcomplianceroot","params":["\"<asset_id_or_ticker>\""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
asset_id_or_tickerstringyesAsset identifier (hex) or ticker

Result

Type:  any

{ (json object) "asset_id" : "hex", (string) Asset identifier "compliance_root_commit" : "hex", (string) 32-byte commitment (root‖height) "root_height" : n, (numeric) Extracted capture height (last 4 bytes, big-endian) "max_root_age" : n, (numeric) Maximum merkle root age in blocks "zk_vk_commitment" : "hex", (string) ZK verification key commitment "has_commitment" : true|false (boolean) Whether a compliance root is set }

Source: services/core-node/bcore/src/wallet/rpc/assets.cpp:8611

C++ symbol: getassetcomplianceroot