Language

Choose a language

/build/rpc / assets / issuance

asset.build_delivery_template

asset.build_delivery_template "asset_id_or_ticker" "address" amount ( {"wrapped_key":"hex","suite_id":n,"extras_mask":n,"wrap_commit":"hex","kc_tag":"hex","zk_proof":"hex","zk_public_inputs":"hex","tfr_commit":"hex","tfr_locator":"hex","tfr_keyset_id":n} ) Construct the asset delivery metadata (including ICU keywrap) for a destination without selecting inputs. Arguments: 1. asset_id_or_ticker (string, required) Asset identifier (hex) or ticker 2. address (string, required) Destination address 3. amount (numeric, required) Asset units (raw) to deliver 4. options (json object, optional) Options { "wrapped_key": "hex", (string, optional) Override for auto-generated wrapped key (UTF-8 hex). "suite_id": n, (numeric, optional, default=0) Cryptographic suite ID for keywrap "extras_mask": n, (numeric, optional, default=0) Keywrap extras: 0x01=wrap_commit, 0x02=kc_tag "wrap_commit": "hex", (string, optional) 32-byte wrap commitment "kc_tag": "hex", (string, optional) 16-byte key confirmation tag "zk_proof": "hex", (string, optional) Pre-generated zk proof (optional, informational) "zk_public_inputs": "hex", (string, optional) Pre-generated zk public inputs (optional, informational) "tfr_commit": "hex", (string, optional) 32-byte transfer anchor commitment (required on-chain when policy mandates anchor) "tfr_locator": "hex", (string, optional) Optional off-chain locator bytes; only serialized on-chain if explicitly provided "tfr_keyset_id": n, (numeric, optional) Optional off-chain keyset identifier; only serialized on-chain if explicitly provided } Result: { (json object) "is_native" : true|false, (boolean) Whether delivery is native BTC "asset_id" : "hex", (string, optional) Resolved asset identifier (omitted for native) "units" : n, (numeric) Raw units to deliver "script_pubkey" : "hex", (string) Destination scriptPubKey "vext" : "hex", (string, optional) Asset TLV (empty for native) "tfr_anchor_vext" : "hex", (string, optional) Dedicated TFR anchor TLV for a separate metadata output when tfr_commit is supplied "commitment" : "hex", (string) Commitment hash over delivery parameters "needs_zk_proof" : true|false, (boolean, optional) Policy requires zk proof at spend time "needs_tfr_anchor" : true|false (boolean, optional) Policy requires transfer anchor TLV } Examples: > bitcoin-cli asset.build_delivery_template "0123..." "bcrt1p..." 1000

Signature

asset.build_delivery_template(asset_id_or_ticker: string, address: string, amount: number, options?: object) → any

Code samples

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

Parameters

NameTypeReq.Description
asset_id_or_tickerstringyesAsset identifier (hex) or ticker
addressstringyesDestination address
amountnumberyesAsset units (raw) to deliver
optionsobjectOptions { "wrapped_key": "hex", (string, optional) Override for auto-generated wrapped key (UTF-8 hex). "suite_id": n, (numeric, optional, default=0) Cryptographic suite ID for keywrap "extras_mask": n, (numeric, optional, default=0) Keywrap extras: 0x01=wrap_commit, 0x02=kc_tag "wrap_commit": "hex", (string, optional) 32-byte wrap commitment "kc_tag": "hex", (string, optional) 16-byte key confirmation tag "zk_proof": "hex", (string, optional) Pre-generated zk proof (optional, informational) "zk_public_inputs": "hex", (string, optional) Pre-generated zk public inputs (optional, informational) "tfr_commit": "hex", (string, optional) 32-byte transfer anchor commitment (required on-chain when policy mandates anchor) "tfr_locator": "hex", (string, optional) Optional off-chain locator bytes; only serialized on-chain if explicitly provided "tfr_keyset_id": n, (numeric, optional) Optional off-chain keyset identifier; only serialized on-chain if explicitly provided }

Result

Type:  any

{ (json object) "is_native" : true|false, (boolean) Whether delivery is native BTC "asset_id" : "hex", (string, optional) Resolved asset identifier (omitted for native) "units" : n, (numeric) Raw units to deliver "script_pubkey" : "hex", (string) Destination scriptPubKey "vext" : "hex", (string, optional) Asset TLV (empty for native) "tfr_anchor_vext" : "hex", (string, optional) Dedicated TFR anchor TLV for a separate metadata output when tfr_commit is supplied "commitment" : "hex", (string) Commitment hash over delivery parameters "needs_zk_proof" : true|false, (boolean, optional) Policy requires zk proof at spend time "needs_tfr_anchor" : true|false (boolean, optional) Policy requires transfer anchor TLV }

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

C++ symbol: asset_build_delivery_template