Bitcoin Transaction Fees Explained: Sats/vB, Weight, and Change
Bitcoin miners are paid transaction fees denominated in satoshis. For a standard Bitcoin transaction, the absolute fee is the total input value minus the total output value. The fee rate expresses that cost relative to transaction size, commonly in satoshis per virtual byte (sat/vB).
How is the absolute fee calculated?
fee_sat = sum(input_values_sat) - sum(output_values_sat)
A transaction spending 100,000 sat and creating outputs worth 98,500 sat pays a 1,500-sat fee. The fee is not necessarily a separate output: it is the value left unassigned to outputs. Wallet software must also account for dust and spendability constraints when selecting outputs.
Weight units and virtual bytes
SegWit defines transaction weight as 3 × stripped_size + total_size, measured in weight units (WU). Virtual size is the weight divided by four and rounded up to the nearest integer: vsize = ceil(weight / 4). This gives witness bytes a different weight contribution than non-witness bytes.
A fee rate of 5 sat/vB on a transaction of 140 vB corresponds to an absolute fee of 700 sat. This is arithmetic, not a current network recommendation.
Why do input types matter?
The witness and script material required to spend an input affects its size. P2WPKH, P2WSH, and P2TR spending paths can have different weights. In Taproot, a script-path spend may reveal more witness data than a simple key-path spend. Estimating only by the destination address type is unreliable.
What is a change output?
A wallet often spends one or more UTXOs whose combined value exceeds the intended payment and fee. It returns the remainder to a wallet-controlled change output. If the remaining amount would be uneconomical or violate relay policy, the wallet must handle it deliberately rather than silently creating an unusable output.
Fee estimation and confirmation
Mempool demand, transaction weight, and node relay policy influence fee selection and acceptance. A higher fee rate may improve inclusion incentives but cannot guarantee a particular confirmation time. Replace-by-fee and child-pays-for-parent are mechanisms for some fee-bumping situations, with their own constraints.
Primary references
- BIP141: Segregated Witness: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki
- Bitcoin Core estimatesmartfee RPC: https://bitcoincore.org/en/doc/
- Bitcoin Developer Guide: Transactions: https://developer.bitcoin.org/devguide/transactions.html
