/build/rpc / assets / raw_attach
rawtxattachassettag
rawtxattachassettag "hex" vout "asset_id" amount ( flags {"asset_id":"hex","ctxt_hash":"hex","spk_hash32":"hex","wrapped_key":"hex","suite_id":n,"extras_mask":n,"wrap_commit":"hex","kc_tag":"hex"} ) Attach an AssetTag TLV (optionally with ICU_KEYWRAP) to the specified vout of a raw transaction. Arguments: 1. hex (string, required) Raw transaction hex 2. vout (numeric, required) Output index 3. asset_id (string, required) 32-byte asset id hex (no 0x) 4. amount (numeric, required) Asset amount (u64) 5. flags (numeric, optional, default=0) Asset flags (u32) 6. keywrap (json object, optional) Optional ICU_KEYWRAP sub-TLV for WRAP_REQUIRED assets { "asset_id": "hex", (string, required) 32-byte asset id hex "ctxt_hash": "hex", (string, required) 32-byte ciphertext hash "spk_hash32": "hex", (string, required) 32-byte scriptPubKey hash "wrapped_key": "hex", (string, required) Wrapped symmetric key (variable length hex) "suite_id": n, (numeric, optional, default=0) Cryptographic suite ID (u8) "extras_mask": n, (numeric, optional, default=0) Extras bitmask: 0x01=wrap_commit, 0x02=kc_tag (u8) "wrap_commit": "hex", (string, optional) 32-byte wrap commitment (if extras_mask & 0x01) "kc_tag": "hex", (string, optional) 16-byte key confirmation tag (if extras_mask & 0x02) } Result: "hex" (string) Modified hex Examples: > bitcoin-cli rawtxattachassettag "<hex>" 1 "<asset_id>" 1000000 0 > bitcoin-cli rawtxattachassettag "<hex>" 1 "<asset_id>" 1000000 0 '{"asset_id":"...", "ctxt_hash":"...", "spk_hash32":"...", "wrapped_key":"..."}'
Signature
rawtxattachassettag(hex: string, vout: number, asset_id: string, amount: number, flags?: number, keywrap?: object) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"rawtxattachassettag","params":["\"<hex>\"",0,"\"<asset_id>\"",0,0,{}]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| hex | string | yes | Raw transaction hex |
| vout | number | yes | Output index |
| asset_id | string | yes | 32-byte asset id hex (no 0x) |
| amount | number | yes | Asset amount (u64) |
| flags | number | — | Asset flags (u32) |
| keywrap | object | — | Optional ICU_KEYWRAP sub-TLV for WRAP_REQUIRED assets { "asset_id": "hex", (string, required) 32-byte asset id hex "ctxt_hash": "hex", (string, required) 32-byte ciphertext hash "spk_hash32": "hex", (string, required) 32-byte scriptPubKey hash "wrapped_key": "hex", (string, required) Wrapped symmetric key (variable length hex) "suite_id": n, (numeric, optional, default=0) Cryptographic suite ID (u8) "extras_mask": n, (numeric, optional, default=0) Extras bitmask: 0x01=wrap_commit, 0x02=kc_tag (u8) "wrap_commit": "hex", (string, optional) 32-byte wrap commitment (if extras_mask & 0x01) "kc_tag": "hex", (string, optional) 16-byte key confirmation tag (if extras_mask & 0x02) } |
Result
Type: any
"hex" (string) Modified hex
Source: services/core-node/bcore/src/rpc/rawtransaction.cpp:593
C++ symbol: rawtxattachassettag