Skip to content

Inputs, outputs, fees, change

You do not have a balance. You have a set of coins, each a fixed amount, each spendable only in full. Every payment consumes some of them entirely and creates new ones. Once you see it this way, most of the surprising behaviour in any Bitcoin wallet stops being surprising.

Inputs, outputs, fee and change in one transactionTwo coins are spent as inputs: one of 3,000,000 satoshis and one of 450,000 satoshis, totalling 3,450,000 satoshis. They produce three results. The recipient receives a new output of 2,000,000 satoshis. A second new output of 1,446,152 satoshis returns to an address the wallet owns, which is the change. The remaining 3,848 satoshis are claimed by whoever mines the block, and that is the fee. The fee is not entered as an amount: it is whatever the inputs exceed the outputs by, and it is chosen indirectly by picking a rate in satoshis per virtual byte. Here 208 virtual bytes at 18.5 satoshis per virtual byte gives 3,848 satoshis. Two consequences are stated. Coins are spent whole, so paying 2,000,000 satoshis from a 3,000,000 satoshi coin does not leave that coin partly spent. And a bigger payment does not cost a bigger fee: the fee follows the size of the transaction in bytes, not the amount being sent.WHAT A PAYMENT IS MADE OFInputs, spent whole3,000,000 satcoin you already owned450,000 satcoin you already owned3,450,000 sat inone txOutputs, newly created2,000,000 satto the person you paid1,446,152 satback to you, as change3,848 satthe fee, claimed by the miner208 vB at 18.5 sat/vBTHE FEE IS NOT A FIELD YOU FILL INIt is whatever the inputs exceed the outputs by.You choose it indirectly, by choosing a rate.COINS ARE SPENT WHOLEPaying 2,000,000 sat out of a 3,000,000 satcoin does not leave that coin part spent.SIZE COSTS, NOT AMOUNTSending 10 BTC costs the same fee assending 0.001 BTC, at the same size.Change is a real output to a real address of yours.A transaction with no change output has given the whole remainder away as fee. Read that line.

The fee is not entered anywhere. It is the difference between what goes in and what comes out. You influence it by choosing a rate in satoshis per virtual byte, and the wallet computes the amount from the size of the transaction it built.

Input. A coin you already own, being spent. It is consumed whole. A transaction can have many.

Output. A new coin being created. One goes to the person you are paying. Usually one comes back to you.

Change. The output that comes back to you. It is a real payment, to a real address of yours, and it is where the remainder of your consumed coins ends up. It is not a leftover in an account somewhere.

Fee. Whatever the inputs exceed the outputs by. Nobody writes it into the transaction. Whoever mines the block claims it.

Your available balance can be lower than your total

Section titled “Your available balance can be lower than your total”

Because some coins are held back as protected, and because a coin cannot be split without spending it. See Protected outputs.

Fees follow size in virtual bytes. A transaction with many inputs is large and therefore expensive, regardless of the amounts involved. Paying from twenty small coins costs much more than paying from one large one.

A missing change output means you gave the remainder away

Section titled “A missing change output means you gave the remainder away”

If the review screen shows inputs of 0.0345 BTC, one output of 0.02 BTC, and no change line, the other 0.0145 BTC is the fee. This is the shape of both a bug and an attack. Reject anything you cannot account for. See Review a transaction.

An output too small to be worth spending later is called dust, and the network will not relay outputs below a threshold. Creating a 200 satoshi change output is not useful: it will cost more than that to spend it. Wallets round it into the fee instead, which is another reason a change line can be absent.

The review screen lists every input and every output, marks which inputs are protected, states the fee once, and shows the resulting net change to your wallet. See Review a transaction for how to read it in order.