Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The BIP16 exception block enforces no script flags

Proved
BitcoinActivation.bip16_exception

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

bitcoinbitcoin-mainnetconsensusformal-verificationscript-flagssoft-fork-activation

For every height h<363,725h < 363{,}725h<363,725 — in particular the exception block's height 170,060170{,}060170,060 — the flags of the BIP16 exception block are SCRIPT_VERIFY_NONE: the exception base is empty and no height-gated rule is active.

Preamble
import Definitions.Def_BitcoinActivation
Formal statement
theorem BitcoinActivation.bip16_exception (height : Nat) (h : height < 363725) :
    BitcoinActivation.blockScriptFlags height .bip16Block = BitcoinActivation.noFlags := by sorry
Source
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: GetBlockScriptFlags, src/validation.cpp lines 2249-2288: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/validation.cpp#L2249; DeploymentActiveAt / DeploymentActiveAfter (buried), src/deploymentstatus.h; BuriedDeployment and DeploymentHeight, src/consensus/params.h; CMainParams BIP34Height, BIP65Height, BIP66Height, CSVHeight, SegwitHeight, script_flag_exceptions, src/kernel/chainparams.cpp; LOCKTIME_VERIFY_SEQUENCE, src/consensus/consensus.h; nLockTimeFlags in ConnectBlock, src/validation.cpp line 2478
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: BitcoinActivation.bip16_exception

Binders and hypothesis. Universally quantified over one natural number h∈Nh \in \mathbb{N}h∈N ("height"), with the single hypothesis

h<363725h < 363725h<363725

(strict). So the covered heights are exactly h∈{0,1,…,363724}h \in \{0, 1, \dots, 363724\}h∈{0,1,…,363724}; nothing is asserted for h≥363725h \ge 363725h≥363725.

Conclusion. An equality of records in the seven-field Boolean record type ScriptFlags\mathsf{ScriptFlags}ScriptFlags (fields in order p2sh,witness,taproot,dersig,cltv,csv,nulldummy\mathsf{p2sh}, \mathsf{witness}, \mathsf{taproot}, \mathsf{dersig}, \mathsf{cltv}, \mathsf{csv}, \mathsf{nulldummy}p2sh,witness,taproot,dersig,cltv,csv,nulldummy):

blockScriptFlags(h,bip16Block)  =  noFlags=⟨F,F,F,F,F,F,F⟩.\mathsf{blockScriptFlags}(h, \mathsf{bip16Block}) \;=\; \mathsf{noFlags} = \langle \mathsf{F},\mathsf{F},\mathsf{F},\mathsf{F},\mathsf{F},\mathsf{F},\mathsf{F}\rangle .blockScriptFlags(h,bip16Block)=noFlags=⟨F,F,F,F,F,F,F⟩.

Here bip16Block\mathsf{bip16Block}bip16Block is one of the three labels of the type ScriptException={none,bip16Block,taprootBlock}\mathsf{ScriptException} = \{\mathsf{none}, \mathsf{bip16Block}, \mathsf{taprootBlock}\}ScriptException={none,bip16Block,taprootBlock}. Record equality means all seven fields agree.

Unfolding the left-hand side. By definition, blockScriptFlags(h,e)\mathsf{blockScriptFlags}(h, e)blockScriptFlags(h,e) starts from f=exceptionBase(e)f = \mathsf{exceptionBase}(e)f=exceptionBase(e) and keeps f.p2sh,f.witness,f.taprootf.\mathsf{p2sh}, f.\mathsf{witness}, f.\mathsf{taproot}f.p2sh,f.witness,f.taproot, while setting

dersig=f.dersig∨[ 363725≤h ],cltv=f.cltv∨[ 388381≤h ],csv=f.csv∨[ 419328≤h ],nulldummy=f.nulldummy∨[ 481824≤h ],\mathsf{dersig} = f.\mathsf{dersig} \lor [\,363725 \le h\,],\quad \mathsf{cltv} = f.\mathsf{cltv} \lor [\,388381 \le h\,],\quad \mathsf{csv} = f.\mathsf{csv} \lor [\,419328 \le h\,],\quad \mathsf{nulldummy} = f.\mathsf{nulldummy} \lor [\,481824 \le h\,],dersig=f.dersig∨[363725≤h],cltv=f.cltv∨[388381≤h],csv=f.csv∨[419328≤h],nulldummy=f.nulldummy∨[481824≤h],

with ∨\lor∨ Boolean OR and [ P ][\,P\,][P] the Boolean value of the decidable inequality PPP. For e=bip16Blocke = \mathsf{bip16Block}e=bip16Block, f=exceptionBase(bip16Block)=noFlagsf = \mathsf{exceptionBase}(\mathsf{bip16Block}) = \mathsf{noFlags}f=exceptionBase(bip16Block)=noFlags, all seven fields false\mathsf{false}false. Thus the left-hand side is

⟨F, F, F, [ 363725≤h ], [ 388381≤h ], [ 419328≤h ], [ 481824≤h ]⟩.\big\langle \mathsf{F},\ \mathsf{F},\ \mathsf{F},\ [\,363725 \le h\,],\ [\,388381 \le h\,],\ [\,419328 \le h\,],\ [\,481824 \le h\,]\big\rangle .⟨F, F, F, [363725≤h], [388381≤h], [419328≤h], [481824≤h]⟩.

What the statement asserts, concretely. For every h<363725h < 363725h<363725, all four Boolean tests [ 363725≤h ][\,363725 \le h\,][363725≤h], [ 388381≤h ][\,388381 \le h\,][388381≤h], [ 419328≤h ][\,419328 \le h\,][419328≤h], [ 481824≤h ][\,481824 \le h\,][481824≤h] equal false\mathsf{false}false, so that the whole record equals the all-false record. The threshold 363725363725363725 in the hypothesis is the tabulated height of the label derSig\mathsf{derSig}derSig, the smallest of the four heights consulted by blockScriptFlags\mathsf{blockScriptFlags}blockScriptFlags. The height 227931227931227931 of heightInCB\mathsf{heightInCB}heightInCB plays no role in this statement.

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