Transaction Fees Overview
Transaction Fees: The Implicit Difference
Unlike the amount you send to a recipient, the Transaction Fee in Bitcoin is not written into a specific field. Instead, it is an implicit value derived from the difference between your inputs and your outputs.
1. The Fee Equation
The fundamental rule of Bitcoin accounting is:
Fee = Sum(Input Values) - Sum(Output Values)
-
Inputs: The total value of the UTXOs you are spending.
-
Outputs: The total value you are sending to others, including your own change address.
-
Remainder: Whatever is left over is automatically claimed by the miner who includes your transaction in a block.
2. No "Fee" Field
If you look at the raw hex of a transaction, you will see a list of inputs and a list of outputs, but you will never find a field labeled "Fee: 10,000 sats." Nodes calculate this value on the fly by looking up the values of the previous transactions referenced in the inputs.
3. The Risk of Mistakes
Because the fee is implicit, a mistake in your transaction construction can be fatal.
-
If you have 1.0 BTC in inputs and you only define an output for 0.1 BTC (forgetting your change address), the remaining 0.9 BTC will be treated as a transaction fee.
-
The miner who mines that block will receive that 0.9 BTC as a "tip," and there is no way to reverse the transaction.
4. Why an Implicit System?
By making the fee implicit, the transaction size is kept as small as possible (saving 8 bytes of space). It also ensures that the total supply of Bitcoin can never increase beyond the mathematical cap, as any "lost" value simply goes to the miner or is effectively burned if not claimed.
| Component | Status |
|---|---|
| Input Values | Explicitly stored in previous TXs |
| Output Values | Explicitly stored in current TX |
| Fee Amount | Implicitly calculated by nodes |
In the next section, we will discuss Feerate Calculation (sats/vB).
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: