Language

Choose a language

/build/rpc / assets / issuance

sendasset

  • workflowissue-an-asset·step 4 of 5Workflow: issue-an-asset · step 4 of 5

sendasset "asset_id_or_ticker" "address" amount ( {"fee_rate":n,"include_watching":bool,"replaceable":bool,"conf_target":n,"avoid_reuse":bool,"broadcast":bool,"return_skeleton":bool,"return_psbt":bool,"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} ) Send asset units from the wallet, selecting UTXOs and handling change automatically. 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 send 4. options (json object, optional) Options { "fee_rate": n, (numeric, optional) Explicit fee rate in sat/vB "include_watching": bool, (boolean, optional, default=false) Spend solvable watch-only asset UTXOs "replaceable": bool, (boolean, optional, default=true) Signal BIP125 replace-by-fee "conf_target": n, (numeric, optional) Confirmation target (blocks) "avoid_reuse": bool, (boolean, optional, default=true) Avoid spending from reused addresses "broadcast": bool, (boolean, optional, default=true) Broadcast the transaction "return_skeleton": bool, (boolean, optional, default=false) Return unsigned tx skeleton (pre-fee) instead of broadcasting. Includes input/output metadata for covenant assembly. "return_psbt": bool, (boolean, optional, default=false) Return an unsigned PSBT with wallet data and BIP32 derivations instead of signing/broadcasting. "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) ZK proof data for KYC_REQUIRED assets "zk_public_inputs": "hex", (string, optional) Public inputs for ZK proof "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) "txid" : "hex", (string, optional) Transaction id (omitted when return_skeleton=true or return_psbt=true) "hex" : "str", (string, optional) Signed transaction hex (included when broadcast=false, or unsigned tx hex when return_skeleton=true) "psbt" : "str", (string, optional) Unsigned PSBT with wallet annotations (return_psbt=true) "fee" : n, (numeric, optional) Fee paid in BTC (omitted when return_skeleton=true) "asset_id" : "hex", (string, optional) Resolved asset identifier "ticker" : "str", (string, optional) Ticker symbol if known ..., Total asset units consumed (number) when return_skeleton=false, or array of input objects when return_skeleton=true "asset_outputs" : n, (numeric, optional) Total asset units created (when return_skeleton=false) "asset_change" : n, (numeric, optional) Asset units returned to the wallet (when return_skeleton=false) "complete" : true|false, (boolean, optional) Whether the returned skeleton/PSBT is complete (false for return_skeleton/return_psbt) "asset_inputs_total" : n, (numeric, optional) Total asset units in inputs (return_skeleton=true) "asset_outputs_total" : n, (numeric, optional) Total asset units in outputs (return_skeleton=true) "btc_inputs" : [ (json array, optional) BTC funding inputs (return_skeleton=true) { (json object) "txid" : "hex", (string) Input txid "vout" : n (numeric) Input vout }, ... ], "outputs" : [ (json array, optional) Output metadata (return_skeleton=true) ... ], "estimated_fee" : n, (numeric, optional) Estimated fee (return_skeleton=true) "fee_rate" : n, (numeric, optional) Fee rate in sat/vB (return_skeleton=true) "needs_zk_proof" : true|false, (boolean, optional) Whether ZK proof is needed (return_skeleton=true) "needs_tfr_anchor" : true|false, (boolean, optional) Whether TFR anchor is needed (return_skeleton=true) "refund_instructions" : { (json object, optional) Refund instructions if applicable (return_skeleton=true) ... }, "mldsa_signing_info" : { (json object, optional) ML-DSA signing instructions (only when destination is witness v2) "notice" : "str", (string) Notice that destination is ML-DSA address "next_step" : "str", (string) Instructions for next step "ml_dsa_output_index" : n, (numeric) Index of ML-DSA output in transaction "dest_address" : "str", (string) ML-DSA destination address "asset_inputs_detail" : [ (json array) Asset input UTXOs for manual signing { (json object) "txid" : "hex", (string) Input txid "vout" : n, (numeric) Input vout "asset_id" : "hex", (string) Asset ID "asset_units" : n, (numeric) Asset units "amount" : n, (numeric) BTC amount "scriptPubKey" : "hex" (string) scriptPubKey hex }, ... ] } } Examples: > bitcoin-cli sendasset "GOLD" "bc1q..." 50000000 > bitcoin-cli sendasset "GOLD" "bc1q..." 50000000 '{"broadcast":false,"return_psbt":true}'

Signature

sendasset(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":"sendasset","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 send
optionsobjectOptions { "fee_rate": n, (numeric, optional) Explicit fee rate in sat/vB "include_watching": bool, (boolean, optional, default=false) Spend solvable watch-only asset UTXOs "replaceable": bool, (boolean, optional, default=true) Signal BIP125 replace-by-fee "conf_target": n, (numeric, optional) Confirmation target (blocks) "avoid_reuse": bool, (boolean, optional, default=true) Avoid spending from reused addresses "broadcast": bool, (boolean, optional, default=true) Broadcast the transaction "return_skeleton": bool, (boolean, optional, default=false) Return unsigned tx skeleton (pre-fee) instead of broadcasting. Includes input/output metadata for covenant assembly. "return_psbt": bool, (boolean, optional, default=false) Return an unsigned PSBT with wallet data and BIP32 derivations instead of signing/broadcasting. "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) ZK proof data for KYC_REQUIRED assets "zk_public_inputs": "hex", (string, optional) Public inputs for ZK proof "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) "txid" : "hex", (string, optional) Transaction id (omitted when return_skeleton=true or return_psbt=true) "hex" : "str", (string, optional) Signed transaction hex (included when broadcast=false, or unsigned tx hex when return_skeleton=true) "psbt" : "str", (string, optional) Unsigned PSBT with wallet annotations (return_psbt=true) "fee" : n, (numeric, optional) Fee paid in BTC (omitted when return_skeleton=true) "asset_id" : "hex", (string, optional) Resolved asset identifier "ticker" : "str", (string, optional) Ticker symbol if known ..., Total asset units consumed (number) when return_skeleton=false, or array of input objects when return_skeleton=true "asset_outputs" : n, (numeric, optional) Total asset units created (when return_skeleton=false) "asset_change" : n, (numeric, optional) Asset units returned to the wallet (when return_skeleton=false) "complete" : true|false, (boolean, optional) Whether the returned skeleton/PSBT is complete (false for return_skeleton/return_psbt) "asset_inputs_total" : n, (numeric, optional) Total asset units in inputs (return_skeleton=true) "asset_outputs_total" : n, (numeric, optional) Total asset units in outputs (return_skeleton=true) "btc_inputs" : [ (json array, optional) BTC funding inputs (return_skeleton=true) { (json object) "txid" : "hex", (string) Input txid "vout" : n (numeric) Input vout }, ... ], "outputs" : [ (json array, optional) Output metadata (return_skeleton=true) ... ], "estimated_fee" : n, (numeric, optional) Estimated fee (return_skeleton=true) "fee_rate" : n, (numeric, optional) Fee rate in sat/vB (return_skeleton=true) "needs_zk_proof" : true|false, (boolean, optional) Whether ZK proof is needed (return_skeleton=true) "needs_tfr_anchor" : true|false, (boolean, optional) Whether TFR anchor is needed (return_skeleton=true) "refund_instructions" : { (json object, optional) Refund instructions if applicable (return_skeleton=true) ... }, "mldsa_signing_info" : { (json object, optional) ML-DSA signing instructions (only when destination is witness v2) "notice" : "str", (string) Notice that destination is ML-DSA address "next_step" : "str", (string) Instructions for next step "ml_dsa_output_index" : n, (numeric) Index of ML-DSA output in transaction "dest_address" : "str", (string) ML-DSA destination address "asset_inputs_detail" : [ (json array) Asset input UTXOs for manual signing { (json object) "txid" : "hex", (string) Input txid "vout" : n, (numeric) Input vout "asset_id" : "hex", (string) Asset ID "asset_units" : n, (numeric) Asset units "amount" : n, (numeric) BTC amount "scriptPubKey" : "hex" (string) scriptPubKey hex }, ... ] } }

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

C++ symbol: sendasset