/build/rpc / assets / icu
buildcanonicalicupayload
buildcanonicalicupayload "canonical_text" {"canonical_hash":"str"} ( visibility ) Build a canonical ICU payload from governance text and witness metadata. This is a helper RPC for GUI/external tools to avoid duplicating serialization logic. Returns the serialized payload hex and computed hashes for use with registerasset. Arguments: 1. canonical_text (string, required) Governance document text (UTF-8) 2. witness_bundle (json object, required) Witness metadata as JSON object { "canonical_hash": "str", (string, optional) Use 'placeholder' for automatic replacement } 3. visibility (numeric, optional, default=0) 0=public, 1=holder_only Result: { (json object) "icu_payload_plain" : "hex", (string) Hex-encoded canonical ICU payload (ready for registerasset) "canonical_hash" : "hex", (string) SHA256 hash of canonical_text (little-endian hex) "witness_hash" : "hex", (string) SHA256 hash of witness_bundle JSON (little-endian hex) "witness_bundle" : { (json object) Witness bundle with canonical_hash filled in ... }, "icu_visibility" : n, (numeric) Visibility mode (0 or 1) "payload_size" : n (numeric) Size of payload in bytes } Examples: > bitcoin-cli buildcanonicalicupayload "Board requires 2/3 majority" '{"version":"1.0","canonical_hash":"placeholder"}' 0 > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "buildcanonicalicupayload", "params": ["Board requires 2/3 majority", {"version":"1.0","canonical_hash":"placeholder"}, 0]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
buildcanonicalicupayload(canonical_text: string, witness_bundle: object, visibility?: number) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"buildcanonicalicupayload","params":["\"<canonical_text>\"",{},0]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| canonical_text | string | yes | Governance document text (UTF-8) |
| witness_bundle | object | yes | Witness metadata as JSON object { "canonical_hash": "str", (string, optional) Use 'placeholder' for automatic replacement } |
| visibility | number | — | 0=public, 1=holder_only |
Result
Type: any
{ (json object) "icu_payload_plain" : "hex", (string) Hex-encoded canonical ICU payload (ready for registerasset) "canonical_hash" : "hex", (string) SHA256 hash of canonical_text (little-endian hex) "witness_hash" : "hex", (string) SHA256 hash of witness_bundle JSON (little-endian hex) "witness_bundle" : { (json object) Witness bundle with canonical_hash filled in ... }, "icu_visibility" : n, (numeric) Visibility mode (0 or 1) "payload_size" : n (numeric) Size of payload in bytes }
Source: services/core-node/bcore/src/wallet/rpc/assets.cpp:4725
C++ symbol: buildcanonicalicupayload