From an empty ledger, total value never exceeds the subsidies issued
ProvedBitcoinUtxo.ledger_boundFor every subsidy function , starting height , and sequence of blocks whose transactions have pairwise distinct txids within each block, if connecting them from the empty UTXO set succeeds,
Here connectChain applies the transcribed ConnectBlock accounting — CheckTransaction, the BIP30 check, CheckTxInputs, fee accumulation, UpdateCoins, and the coinbase bound — at consecutive heights.
This is the supply bound of the ledger: fees move value between outputs, unspendable outputs destroy it, and the only creation is the coinbase, bounded by fees plus subsidy. With the mainnet GetBlockSubsidy and (the genesis coinbase is never connected), the right-hand side is below by the subsidy mission's bound.
Formalization Note. The subsidy is a parameter, so the statement does not depend on the schedule. Distinct txids within a block stand for collision-freedom of transaction hashes, which an abstract id type cannot supply; the BIP30 check is modeled as enforced.
import Definitions.Def_BitcoinUtxo open BitcoinUtxo
theorem BitcoinUtxo.ledger_bound {T : Type} [DecidableEq T] (subsidy : Nat → Int) (blocks : List (List (Tx T))) (h : Nat)
(u' : UtxoSet T) (hnd : ∀ b ∈ blocks, (b.map Tx.txid).Nodup)
(hc : connectChain subsidy [] h blocks = some u') :
totalValue u' ≤ subsidySum subsidy h blocks.length := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back of BitcoinUtxo.ledger_bound.
Let be any type with decidable equality. A UTXO set over is a finite ordered list of pairs (outpoint, coin), where an outpoint is with , , and a coin carries an output (integer , Boolean ), a height and a Boolean . denotes the coin of the first entry of at outpoint , or "none". is the integer sum of over all entries of , with . A transaction has fields , (a list of outpoints), (a list of outputs with integer values and unspendable flags) and a Boolean ; a block is a list of transactions; is the sum of the output values of . and .
For , is "some " exactly when: (i) is non-empty, is true, every transaction in has false, and every transaction of has non-empty and , duplicate-free , all output values in and all partial sums of output values (from , in order) in ; (ii) for every and every , has no entry at ; (iii) processing left to right from succeeds, where a coinbase-flagged transaction is applied without any check or fee change by adding, for , the coin (output , height , flag true) at — removing any entry at that outpoint and prepending the new one, or doing nothing if is unspendable — and a non-coinbase transaction requires that every input outpoint have an entry in the current set, that no input coin be a coinbase coin with (truncated natural subtraction, so any coinbase coin of height is rejected), that each input value and each running total of input values be in , that the input total satisfy , that and that the new accumulated fee , after which every entry at each input outpoint is removed and the outputs are added at height with flag false as above; (iv) for the final accumulated fee . Then is "some " exactly when there are sets with for each (fees discarded); for it is "some ". And , equal to for .
The theorem states: for every type with decidable equality, every function , every list of blocks over , every height and every UTXO set over , if
- for every block occurring in , the list of transaction ids of has no duplicates (distinctness within each block only; ids may repeat across different blocks);
- , i.e. connecting the blocks in order at heights starting from the empty UTXO set succeeds and yields ;
then
a non-strict integer inequality.
There is no explicit keysNodup hypothesis (the starting set is the empty list, which has no outpoints). For the second hypothesis forces and the conclusion reads . The function is arbitrary and may take negative values; the conclusion does not assert that the outpoints of are distinct, nor anything about fees.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.