From height 1,983,702 the scan always runs
ProvedBitcoinUniqueness.scan_runs_latebip30bip34bitcoinbitcoin-mainnetcoinbaseconsensusformal-verificationuniqueness
If BIP34_IMPLIES_BIP30_LIMIT ≤ S.nextHeight then ScanRuns S b for every block b.
Preamble
import Definitions.Def_BitcoinUniqueness import Definitions.Def_BitcoinSer open BitcoinUniqueness BitcoinSer BitcoinBlockV2
Formal statement
theorem BitcoinUniqueness.scan_runs_late (S : ChainState) (b : BitcoinSer.Block)
(h : BIP34_IMPLIES_BIP30_LIMIT ≤ S.nextHeight) : BitcoinUniqueness.ScanRuns S b := by sorrySource
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: ConnectBlock (fEnforceBIP30, BIP34_IMPLIES_BIP30_LIMIT), ContextualCheckBlock (the BIP34 height push), src/validation.cpp: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/validation.cpp; CScript::push_int64, CScriptNum::serialize (script/script.h); BIP30, BIP34
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: BitcoinUniqueness.scan_runs_late
Statement. For every chain state (a record of a list of headers and a ledger ) and every block , if
- (the constant is at most the next height of ),
then holds.
Formally:
What ScanRuns says
is, by definition, with and (double-SHA-256 of the serialized header), which unfolds to
where holds iff or for two fixed 32-byte constants, and holds iff has an element at zero-based position (i.e. ) whose header hash equals a fixed 32-byte constant . The block enters only through .
Edge cases and scope
- The block is completely unconstrained: any header, any transaction list (including empty), any hash.
- The chain state is unconstrained apart from the length of its header list; there is no reachability, validity, or well-formedness hypothesis, and the ledger is arbitrary.
- The hypothesis coincides with the second disjunct of the unfolded conclusion, so the statement is of the form "" after unfolding.
- "Height" here is literally the length of the header list, not a field read from any header or from .
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.