A valid target times the clamped timespan never wraps around 2^256
ProvedBitcoinDifficulty.no_wrapbitcoinbitcoin-mainnetconsensusdifficultyformal-verificationproof-of-workretargettimewarp
For powLimit () and (four times the target timespan): . The modular multiplication of arith_uint256 is exact on every valid input.
Preamble
import Definitions.Def_BitcoinDifficulty import Definitions.Def_BitcoinPow open BitcoinDifficulty BitcoinPow
Formal statement
theorem BitcoinDifficulty.no_wrap (t : Nat) (ht : t ≤ BitcoinPow.powLimit) (ts : Nat) (hts : ts ≤ 4838400) :
t * ts < BitcoinPow.width := by sorrySource
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: CalculateNextWorkRequired, GetNextWorkRequired, src/pow.cpp: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/pow.cpp; arith_uint256::SetCompact/GetCompact (arith_uint256.cpp); CMainParams (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 BitcoinDifficulty.no_wrap
Statement
Binders (universally quantified).
- , a natural number;
- , a natural number (named
ts).
Hypotheses.
- (ht) ;
- (hts) (a literal numeral in the statement; it equals , the upper clamp value, but the statement writes the number, not the named constant).
Conclusion.
a strict inequality between natural numbers, where is the constant called width.
Definitions used
Constants (from the imported proof-of-work definitions).
- (the modulus called
width). - (the value called
powLimit). - (the value called
targetTimespan); hence and .
Edge cases and what the quantifiers include
- and are included (then ).
- The statement is pure arithmetic on natural numbers: it does not mention the decoding , the clamp ,
rawNextTarget,calculateNextWork, or any compact word, even though the file imports those definitions. The connection " is a clamped timespan" or " is a decoded target" is not part of the statement. - The largest admitted product is ; since , this is below .
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.