/build/rpc / assets / icu
decrypticupayload
decrypticupayload "asset_id" "dek" Decrypt a holder-only ICU payload using a DEK (Data Encryption Key). This RPC decrypts an encrypted ICU payload stored in LevelDB and returns the plaintext canonical structure. In production, the wallet would unwrap the DEK from ICU_KEYWRAP using ECDH. For testing, DEK can be provided directly. Arguments: 1. asset_id (string, required) Asset ID (32-byte hex) 2. dek (string, required) 32-byte Data Encryption Key as hex (unwrapped from ICU_KEYWRAP by wallet) Result: { (json object) "asset_id" : "hex", (string) Asset ID "canonical_text" : "str", (string) Decrypted canonical text (UTF-8) "witness_bundle" : "str", (string) Decrypted witness bundle (JSON) "visibility" : n, (numeric) 0 = public, 1 = holder_only "compression" : n, (numeric) 0 = none, 1 = zstd "encryption_mode" : n, (numeric) 0 = plaintext, 1 = ChaCha20-Poly1305 "canonical_hash" : "hex", (string) SHA256(canonical_text) "witness_hash" : "hex" (string) SHA256(witness_bundle) } Examples: > bitcoin-cli decrypticupayload "<asset_id>" "<64-char-hex-dek>" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "decrypticupayload", "params": ["<asset_id>", "<64-char-hex-dek>"]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
decrypticupayload(asset_id: string, dek: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"decrypticupayload","params":["\"<asset_id>\"","\"<dek>\""]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| asset_id | string | yes | Asset ID (32-byte hex) |
| dek | string | yes | 32-byte Data Encryption Key as hex (unwrapped from ICU_KEYWRAP by wallet) |
Result
Type: any
{ (json object) "asset_id" : "hex", (string) Asset ID "canonical_text" : "str", (string) Decrypted canonical text (UTF-8) "witness_bundle" : "str", (string) Decrypted witness bundle (JSON) "visibility" : n, (numeric) 0 = public, 1 = holder_only "compression" : n, (numeric) 0 = none, 1 = zstd "encryption_mode" : n, (numeric) 0 = plaintext, 1 = ChaCha20-Poly1305 "canonical_hash" : "hex", (string) SHA256(canonical_text) "witness_hash" : "hex" (string) SHA256(witness_bundle) }
Source: services/core-node/bcore/src/rpc/rawtransaction.cpp:1427
C++ symbol: decrypticupayload