A Bitcoin transaction's fee is not a separate field: it is the total value of the transaction's inputs minus the total value of its outputs. Bitcoin Core's consensus code computes the fee this way and rejects as invalid a transaction that spends inputs worth less than its outputs.
Sources and checks
T1Bitcoin Core src/consensus/tx_verify.cpp, Consensus::CheckTxInputsSource code, says this directly
const CAmount txfee_aux = nValueIn - value_out;
Consensus::CheckTxInputs, fee computation, read 2026-11-20
T1Bitcoin Core src/consensus/tx_verify.cpp, Consensus::CheckTxInputsSource code, says this directly
if (nValueIn < value_out) {
Consensus::CheckTxInputs, inputs below outputs check, read 2026-11-20
bitcoin/bitcoin at f498a5a671 contains this text in src/consensus/tx_verify.cpp, and still does on the default branch.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/consensus/tx_verify.cpp | grep -nF 'const CAmount txfee_aux = nValueIn - value_out;'bitcoin/bitcoin at f498a5a671 contains this text in src/consensus/tx_verify.cpp.
Run it yourself
git clone https://github.com/bitcoin/bitcoin && git -C bitcoin show f498a5a6718d9157b6afb85412c3462439117702:src/consensus/tx_verify.cpp | grep -nF 'bad-txns-in-belowout'Checked at block 976,759, 20 Nov 2026, 17:28 UTC: quotes 2/2, code 2/2
History
Nothing is edited silently; every revision keeps what it replaced.
- 20 Nov 2026, 17:28 UTCblock 976,759
Published Revision 1, run 2026-11-20-seed-fees-and-mempool