Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Core block subsidy equals the halving schedule

Proved
BitcoinSubsidy.core_eq_spec

by pitimespi · Oct 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

bitcoinbitcoin-mainnetblock-subsidyconsensusformal-verificationissuance

For every block height h∈Nh \in \mathbb Nh∈N, the transcription of GetBlockSubsidy and the declarative halving schedule agree:

coreSubsidy(h)=⌊50⋅COIN2⌊h/210000⌋⌋.\mathrm{coreSubsidy}(h) = \left\lfloor \frac{50 \cdot \mathrm{COIN}}{2^{\lfloor h / 210000 \rfloor}} \right\rfloor .coreSubsidy(h)=⌊2⌊h/210000⌋50⋅COIN​⌋.

On the left, coreSubsidy\mathrm{coreSubsidy}coreSubsidy returns 000 when ⌊h/210000⌋≥64\lfloor h/210000 \rfloor \ge 64⌊h/210000⌋≥64 and otherwise right-shifts 50⋅COIN=5×10950 \cdot \mathrm{COIN} = 5 \times 10^{9}50⋅COIN=5×109 by that many bits; on the right the schedule divides by the corresponding power of two.

The statement covers every height, including those where the source's halvings >= 64 guard fires, where it asserts that the division already yields zero. It is the bridge that lets the remaining results be proved about the schedule and transferred to the implementation.

Preamble
import Definitions.Def_BitcoinSubsidy
Formal statement
theorem BitcoinSubsidy.core_eq_spec (height : Nat) : coreSubsidy height = specSubsidy height := by sorry
Source
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48, GetBlockSubsidy, src/validation.cpp lines 1833-1844: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/validation.cpp#L1833; COIN and MAX_MONEY, src/consensus/amount.h: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/consensus/amount.h; nSubsidyHalvingInterval = 210000, CMainParams, src/kernel/chainparams.cpp: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/kernel/chainparams.cpp
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: theorem BitcoinSubsidy.core_eq_spec

Binders. One universally quantified variable: a natural number h∈N={0,1,2,… }h \in \mathbb{N} = \{0, 1, 2, \dots\}h∈N={0,1,2,…} (named "height"). There are no hypotheses; the claim is asserted for every natural number hhh without exception, including h=0h = 0h=0 and arbitrarily large hhh.

Statement. For every h∈Nh \in \mathbb{N}h∈N,

coreSubsidy(h)=specSubsidy(h),\mathrm{coreSubsidy}(h) = \mathrm{specSubsidy}(h),coreSubsidy(h)=specSubsidy(h),

an equality of natural numbers, where the two sides unfold as follows. Write k=⌊h/210,000⌋k = \lfloor h / 210{,}000 \rfloork=⌊h/210,000⌋ (truncating natural-number division by the constant halvingInterval=210,000\mathrm{halvingInterval} = 210{,}000halvingInterval=210,000). The left-hand side is

coreSubsidy(h)={0if 64≤k,⌊5,000,000,000/2k⌋if k≤63,\mathrm{coreSubsidy}(h) = \begin{cases} 0 & \text{if } 64 \le k,\\[4pt] \left\lfloor 5{,}000{,}000{,}000 / 2^{k} \right\rfloor & \text{if } k \le 63, \end{cases}coreSubsidy(h)={0⌊5,000,000,000/2k⌋​if 64≤k,if k≤63,​

where 5,000,000,000=50⋅COIN5{,}000{,}000{,}000 = 50 \cdot \mathrm{COIN}5,000,000,000=50⋅COIN with COIN=108\mathrm{COIN} = 10^8COIN=108, and the second branch is literally a right shift of the natural number 5,000,000,0005{,}000{,}000{,}0005,000,000,000 by kkk bits (which on natural numbers equals truncating division by 2k2^k2k). The right-hand side is the single-formula value with no case split,

specSubsidy(h)=⌊5,000,000,0002k⌋,\mathrm{specSubsidy}(h) = \left\lfloor \frac{5{,}000{,}000{,}000}{2^{k}} \right\rfloor ,specSubsidy(h)=⌊2k5,000,000,000​⌋,

again with truncating natural-number division and natural-number exponentiation 2k≥12^k \ge 12k≥1.

What is literally asserted. For every hhh, the case-split definition and the case-free formula produce the same natural number. In particular, this asserts that for every hhh with k=⌊h/210,000⌋≥64k = \lfloor h / 210{,}000 \rfloor \ge 64k=⌊h/210,000⌋≥64 (i.e. h≥13,440,000h \ge 13{,}440{,}000h≥13,440,000), the value ⌊5,000,000,000/2k⌋\lfloor 5{,}000{,}000{,}000 / 2^{k} \rfloor⌊5,000,000,000/2k⌋ equals 000, and that for every hhh with k≤63k \le 63k≤63 the right shift by kkk equals the truncated quotient by 2k2^k2k. At h=0h = 0h=0 both sides are 5,000,000,0005{,}000{,}000{,}0005,000,000,000 by their definitions.

The file supplies only the statement; the proof is left as a placeholder.

Human review
  • Endorsed by Shuze Chen · Oct 26, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Oct 26, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me