This guide explains Bitcoin Core fundrawtransaction RPC in plain English. It shows what the command does, what its result means and what it cannot prove.
TL;DR
- What it is: Bitcoin Core 0.16.0 fundrawtransaction added wallet inputs until a raw transaction covered its outputs and fee, left existing inputs unchanged and added at most one change output. It returned funded hex, the fee in BTC and the change position, but did not sign the new inputs.
- Why it matters: fundrawtransaction automates coin selection and change, but it can alter signatures and recipient amounts under explicit options. Safe use verifies solvability, locks, fee units and every output before the final candidate reaches a signer.
- Current position: Bitcoin Core 0.16.0 fundrawtransaction added wallet inputs until a raw transaction covered its outputs and fee, left existing inputs unchanged and added at most one change output.
Bitcoin Core fundrawtransaction RPC in simple English
Bitcoin Core fundrawtransaction RPC: The method preserves supplied inputs and selects more from the wallet as needed. Every existing input’s previous transaction had to be known to the wallet, and selected scripts needed supported forms.
Simple example
A miner is checking Bitcoin Core fundrawtransaction RPC. Verify ownership, confirmation, coin-control restrictions and solvable status before allowing automatic selection, especially across customer or mining-payout pools.
Key terms in plain English
- BIP:
- Bitcoin Improvement Proposal: a document describing a proposed rule, standard or process. Its status must be checked separately.
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- UTXO:
- An unspent transaction output: a piece of bitcoin that can be used as an input to a later transaction.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Existing and added inputs
The method preserves supplied inputs and selects more from the wallet as needed. Every existing input’s previous transaction had to be known to the wallet, and selected scripts needed supported forms. Verify ownership, confirmation, coin-control restrictions and solvable status before allowing automatic selection, especially across customer or mining-payout pools.
Change controls
changeAddress, changePosition or change_type influence the added change output, while a random position is the default. Supplying an address disables change_type. Decode the funded result to identify actual change by script ownership rather than trusting position alone, and verify legacy, wrapped or native type matches downstream backup and monitoring support.
Fee rate and subtraction
feeRate in the historical options is BTC per kilobyte. SubtractFeeFromOutputs deducts the fee equally from listed pre-change output indexes, meaning those recipients receive less. Require explicit commercial approval for subtraction, validate indexes before funding and compare every original and final output in integer satoshis.
Watch-only and scripts
includeWatching can select watch-only inputs, but funding does not provide their signatures. P2SH scripts had to be present through importaddress or addmultisigaddress for fee calculation, and supported watch-only forms were limited. Prove the signer set can complete every selected input before reserving funds or presenting a transaction for approval.
UTXO locks and concurrency
lockUnspents can reserve selected outputs against competing wallet activity. Record and release locks through an idempotent failure path. Without locks, parallel funders can choose the same coins; with abandoned locks, available balance can appear lower indefinitely. Test crashes, timeouts and restart behaviour.
Replaceability and witness mode
replaceable controls BIP 125 signalling, while iswitness overrides heuristic decoding of the supplied transaction. Choose both explicitly when the serialisation and payment policy are known. Added inputs or outputs mean pre-existing signatures may no longer be valid, so always sign the final funded hex afresh.
Final transaction review
Decode the result, fetch every previous output and verify external recipients, exact amounts, change, fee, vsize, locktime, sequences and replaceability. Compare returned fee in BTC against independent satoshi arithmetic and enforce total and rate ceilings. Only then send the candidate to signers under a separate approval.
Frequently asked questions
What is the main point of Bitcoin Core fundrawtransaction RPC?
Bitcoin Core fundrawtransaction RPC: The method preserves supplied inputs and selects more from the wallet as needed.
For Bitcoin Core fundrawtransaction RPC, what should a beginner know about existing and added inputs?
The method preserves supplied inputs and selects more from the wallet as needed.
For Bitcoin Core fundrawtransaction RPC, what should a beginner know about change controls?
changeAddress, changePosition or change_type influence the added change output, while a random position is the default.
For Bitcoin Core fundrawtransaction RPC, what should a beginner know about fee rate and subtraction?
feeRate in the historical options is BTC per kilobyte. SubtractFeeFromOutputs deducts the fee equally from listed pre-change output indexes, meaning those recipients receive less.
Conclusion
fundrawtransaction automates coin selection and change, but it can alter signatures and recipient amounts under explicit options. Safe use verifies solvability, locks, fee units and every output before the final candidate reaches a signer.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.