Bitcoin Change Outputs Explained: Address Reuse, Fees, and Wallet Accounting
Bitcoin transactions consume whole UTXOs. When selected inputs exceed the recipient amount plus the miner fee, a wallet may create a change output that returns the remainder to a script it controls. Change is a normal part of Bitcoin accounting, not a second payment charged to the sender.
Worked example
Suppose a wallet selects a 100,000-satoshi UTXO and wants to send 60,000 satoshis. If the final miner fee is 500 satoshis, the remaining 39,500 satoshis can become change. The equation is 100,000 = 60,000 + 39,500 + 500.
If the transaction uses a different number of inputs, outputs, or signing paths, its virtual size changes and the 500-satoshi assumption must be recalculated. An estimated fee is not necessarily the final fee.
Where change goes
Hierarchical deterministic wallets commonly separate external receiving addresses from internal change addresses. In BIP84, for example, the change branch conventionally uses /1/* while external receiving addresses use /0/*. A change address is still controlled by the same wallet, but it is not necessarily one of the addresses shown to a payer.
A wallet should not reuse a recipient address as a change address merely for convenience. Fresh change scripts reduce unnecessary address reuse, though transaction graph analysis may still identify likely change outputs using heuristics.
What if change is too small?
A wallet may omit a tiny change output if it would be uneconomic or violate local relay dust policy. The remainder then increases the transaction fee. This must be an intentional and bounded decision: accidentally discarding substantial change can create an unexpectedly high fee.
The dust threshold depends on the output script and the relay policy's estimate of its future spending cost. It is not one universal Bitcoin consensus amount.
Fee subtraction and send-max
Some wallet interfaces subtract the fee from the requested recipient amount; others add the fee on top of that amount. These are different user contracts and must be documented clearly. A send-max transaction generally consumes selected inputs and pays the remainder, minus fees, to the destination without a change output.
Avoiding accounting bugs
A wallet must never count change as external expenditure. When a transaction is unconfirmed, its change may also be unconfirmed. Replacements and reorganizations can alter which outputs remain spendable, so the wallet should reconcile against current chain and mempool state rather than assuming a broadcast transaction is final.
Primary references
BIP84 — Derivation Scheme for P2WPKH: https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
Bitcoin developer transaction guide: https://developer.bitcoin.org/devguide/transactions.html
Bitcoin Core wallet source: https://github.com/bitcoin/bitcoin/tree/master/src/wallet
