Block subsidy, issuance schedule, and cumulative issuance
DefinitionBitcoinSubsidyAmounts are counted in satoshi. One bitcoin is satoshi and satoshi. The mainnet halving interval is blocks.
The Core subsidy at a block height transcribes GetBlockSubsidy at mainnet parameters. With halvings, the subsidy is when , and otherwise the right shift . Heights are nonnegative in the source and the shifted value is nonnegative, so natural numbers represent both exactly; the explicit branch mirrors the source's guard against an undefined shift.
The declarative schedule is
fifty bitcoin halved once per interval with the remainder discarded.
Cumulative issuance below height is the running sum , . The interval sum collects one subsidy per interval. The zero height is , the first height whose subsidy the theorems show to be zero.
These definitions are the inputs for the issuance theorems and for any later ledger-supply argument, which will cite the cumulative issuance as its upper bound.
Formalization Note. All quantities are natural numbers. The shift is Lean's >>> on Nat, which is exact division by a power of two; the recursive definitions are structural so that proofs proceed by induction on height or interval count. Only Std is imported.
import Std
namespace BitcoinSubsidy
/-- `consensus/amount.h`: `COIN{100'000'000}`, the number of satoshis in one bitcoin. -/
def COIN : Nat := 100000000
/-- `consensus/amount.h`: `MAX_MONEY{21'000'000 * COIN}`, the consensus sanity bound on amounts. -/
def MAX_MONEY : Nat := 21000000 * COIN
/-- `kernel/chainparams.cpp`, `CMainParams`: `consensus.nSubsidyHalvingInterval = 210000`. -/
def halvingInterval : Nat := 210000
/-- Transcription of `GetBlockSubsidy` (`validation.cpp`) at mainnet parameters.
Block heights are nonnegative, and the `CAmount` right shift `nSubsidy >>= halvings` acts on the
nonnegative value `50 * COIN`, so it is division by `2 ^ halvings`; the source returns `0`
outright once `halvings >= 64`, where the C++ shift would be undefined. -/
def coreSubsidy (height : Nat) : Nat :=
let halvings := height / halvingInterval
if 64 ≤ halvings then 0 else (50 * COIN) >>> halvings
/-- Declarative issuance schedule: fifty bitcoin, halved once per `halvingInterval` blocks. -/
def specSubsidy (height : Nat) : Nat := (50 * COIN) / 2 ^ (height / halvingInterval)
/-- Total subsidy of all blocks at heights `0, 1, …, n - 1`, as `GetBlockSubsidy` computes it. -/
def issuedBelow : Nat → Nat
| 0 => 0
| n + 1 => issuedBelow n + coreSubsidy n
/-- Sum of the per-interval subsidies for the first `m` intervals. -/
def intervalSum : Nat → Nat
| 0 => 0
| m + 1 => intervalSum m + (50 * COIN) / 2 ^ m
/-- The first height whose subsidy is zero: thirty-three halvings. -/
def zeroHeight : Nat := 33 * halvingInterval
end BitcoinSubsidy
Read-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: definition file Def_BitcoinSubsidy
All objects below live in the natural numbers . Throughout, "" on natural numbers is truncating (floor) division: , and . There are no negative numbers anywhere in this file.
COIN. A fixed natural number constant:
It carries no other structure; it is simply the number one hundred million.
MAX_MONEY. A fixed natural number constant defined as the product
halvingInterval. A fixed natural number constant:
coreSubsidy. A function . For a natural number input (called "height"), first form the truncated quotient
Then the value is defined by a two-way case split on :
- if , the value is ;
- otherwise (i.e. if ), the value is the natural number shifted right by binary digits. On natural numbers a right shift by bits equals truncating division by , so this branch equals
So, written in one formula with :
Edge cases that the definition literally includes: at one has and the value is . For every with the quotient is and the value is likewise ; the quotient increases by exactly each time crosses a multiple of . Because the shift is truncating, for values of at which exceeds the second branch already yields by truncation, independently of the branch. The first branch (value when , i.e. when ) is an explicit case in the definition, not a consequence of the arithmetic. The function is total: every natural number input produces a natural number output.
specSubsidy. A function given by a single formula with no case split:
Here the exponent is a natural number, is natural-number exponentiation (so the divisor is always at least and never zero), and the outer division truncates. Unlike coreSubsidy, there is no special branch at halvings; for arbitrarily large the formula is still evaluated as written, and once the truncating division returns . At the value is .
issuedBelow. A function defined by recursion on its argument:
- base case: ;
- step: .
Unfolding the recursion, for every ,
the sum of over the heights (the empty sum, equal to , when ). Note that the summand added at the step from to is , the subsidy at height itself, so excludes height and includes height . For example . The sum uses coreSubsidy (with its branch), not specSubsidy.
intervalSum. A function defined by recursion:
- base case: ;
- step: .
Equivalently, for every ,
with each term a truncated division, and the empty sum at . This is a sum of one per-interval value for each index ; it does not multiply by or otherwise reference halvingInterval, coreSubsidy, or specSubsidy, and it does not contain the branch. None of the eight theorem files in this bundle mentions intervalSum.
zeroHeight. A fixed natural number constant defined as the product
It is just this number; the name does not by itself impose any property relating it to coreSubsidy (any such relation is the content of separate theorems).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.