At constant difficulty, Core's chain work is the number of blocks times one block's proof
ProvedBitcoinBackbone.chainWork_const_bitsFor a block-mission chain state all of whose headers carry the same bits: S.chainWork = S.headers.length * blockProof bits. The link between the paper's "length" and Core's nChainWork.
import Definitions.Def_BitcoinBackbone
theorem BitcoinBackbone.chainWork_const_bits (S : BitcoinBlockV2.ChainState) (bits : ℕ)
(h : ∀ hd ∈ S.headers, hd.bits = bits) :
S.chainWork = S.headers.length * BitcoinBlockV2.blockProof bits := 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: BitcoinBackbone.chainWork_const_bits
This declaration is stated inside the BitcoinBackbone namespace but refers only to objects from the block-validation preamble (BitcoinBlockV2, BitcoinSer, BitcoinPow); none of the backbone definitions (executions, chains of abstract blocks, typicality, …) occur in it.
Statement. Let be a chain state: a pair where is a finite list of block headers and is a ledger (unconstrained here and not used by the statement). A header is a record with fields , and (byte strings), , (an unbounded natural number, not a 32-bit word) and . Let and assume every header in the list has that bits-field:
Then
where and multiplication is on natural numbers.
Unfolding . , the natural-number sum of applied to each header's bits-field, in list order; the sum of the empty list is .
Unfolding for . First is reduced to a 32-bit word . From one computes (the top byte) and (the low 23 bits), and the candidate target
The target is rejected (the derivation returns "none") if any of the following holds: (i) and bit of is set ("negative"); (ii) ; (iii) and (, or and , or and ) ("overflow"); (iv) . Then
Since an accepted satisfies , the subtraction is an ordinary one and the division is integer (floor) division.
Edge cases. If the hypothesis is vacuous and both sides are . The hypothesis says nothing about the headers beyond their bits-field: they need not be chained by , need not begin with the genesis header, need not satisfy proof-of-work, and the common value need not encode an acceptable target (if it does not, both sides are ). Two values of that agree modulo give the same , but the hypothesis demands literal equality of the natural numbers . Equality in the conclusion is equality of natural numbers.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.