Coin Selection

Definition: Coin selection is the process a Bitcoin wallet uses to choose one or more unspent transaction outputs (UTXOs) as inputs for a payment. The selected inputs must cover the recipient outputs and the transaction fee; because UTXOs differ in value, size, and history, the wallet’s choice can affect fees, change, and which on-chain funds are spent together. Coin selection is a wallet policy, not a Bitcoin consensus rule.12

Implementation reference Bitcoin Core wallet coin-selection code. This documents Bitcoin Core’s implementation; other wallets can use different policies.
Directories Bitcoin Directory

How a wallet funds a transaction

Bitcoin tracks spendable value in transaction outputs rather than in a single account balance. A Bitcoin transaction spends earlier outputs as inputs and creates new outputs with spending conditions. A wallet checks the UTXOs it can spend, then selects a set that can fund the requested payment and its estimated fee. Full nodes later check whether the resulting transaction is valid; consensus does not prescribe one universal wallet-selection algorithm.1

For example, a wallet preparing a 0.70 BTC payment might have one 0.80 BTC UTXO or two UTXOs worth 0.45 BTC and 0.40 BTC. Ignoring fees for the arithmetic, either set covers the payment. The two-input option makes a larger transaction than the one-input option, while the remaining value—and therefore possible change—also differs. The wallet must account for the actual input sizes and fee rate before deciding which set to use.2

Fees, change, and future cost

The fee depends partly on transaction size or weight and the fee rate used to compete for block space. Inputs that take more space generally raise the fee at the same rate. Since the selected inputs affect transaction size, fee estimation and coin selection can depend on each other: a wallet may need to evaluate a candidate transaction before it knows the fee it must cover.12

If the chosen inputs are worth more than the payment and fee, the wallet can return the remainder to an address it controls as a change output. That output adds data and cost to the transaction now, and it will require an input when spent later. Some selection strategies therefore compare the cost of creating and later spending change with the cost of selecting different inputs. An exact or near-exact match can avoid change, but it is not automatically best: a wallet may prefer a different set because of fees, privacy, availability, or its own policy.2

Automatic selection and coin control

Most wallets choose inputs automatically using their own rules. Some also provide coin control, which lets a user select particular UTXOs manually or exclude them from an automatic selection. These controls can help a user keep intended funds separate, but a manual choice can also create a larger transaction, more change, or an input combination the user did not intend.

Approach What to understand
Automatic selection The wallet chooses eligible inputs according to its current software, fee assumptions, and policy. Different wallets or versions can make different choices.
Manual coin control The user selects or excludes inputs. This gives more control over grouping, but requires checking the fee, change, and selected funds before signing.

Privacy and limits

Bitcoin inputs are visible in the public transaction. When a transaction spends multiple UTXOs together, observers may infer that they were controlled by the same person or wallet, although this is a heuristic rather than proof. Selection policies can try to avoid some linkages or group particular funds, but those goals may conflict with minimizing fees. Bitcoin Core’s 2018 release notes, for example, describe an optional partial-spend-avoidance setting that grouped outputs paid to the same address even when that choice could increase fees.4

There is no single best selection for every wallet or payment. A strategy may favor a lower immediate fee, avoid creating small outputs, reduce future spending costs, preserve privacy, or suit a service that makes many payments. Those goals can conflict. Bitcoin Core’s current source code contains multiple selection strategies and cost calculations, but that is one implementation, not a rule all Bitcoin wallets must follow.24

History

  • 2016: Mark Erhardt’s master’s thesis, An Evaluation of Coin Selection Strategies, compared wallet-selection approaches and presented a Branch-and-Bound strategy. Bitcoin Core’s source later credited Murch’s Branch-and-Bound algorithm and cited the thesis.32
  • 2018: Bitcoin Core 0.17.0 documented “Coin Selection with Murch’s algorithm” and described optional partial-spend avoidance, illustrating that coin-selection policy can change across software versions and can trade fees against other goals.4

Last updated: 2026-11-12

Related Terms

Related Articles

These articles cover adjacent wallet, Bitcoin fee, collateral, and institutional-custody context.

See Also

Sources