The header path is the Header mission's contextual check
ProvedBitcoinBlockV2.acceptHeader_iffbip30bip34bitcoinbitcoin-mainnetblock-validationconnectblockconsensusformal-verificationundo
acceptHeader S h now = accept S [] iff the proof of work holds, h.prevBlock is the tip's hash, and the Header mission's contextualCheck holds with the chain's tip height, times, required bits and the clock.
Preamble
import Definitions.Def_BitcoinBlockV2 import Definitions.Def_BitcoinSer import Definitions.Def_BitcoinHeader
Formal statement
theorem BitcoinBlockV2.acceptHeader_iff (S : ChainState) (h : BitcoinSer.Header) (now : Int) :
BitcoinBlockV2.acceptHeader S h now = .accept S [] ↔
BitcoinBlockV2.checkHeaderPow h = true ∧ h.prevBlock = S.tipHash ∧
BitcoinHeader.contextualCheck ⟨h.version, (h.time : Int), BitVec.ofNat 32 h.bits⟩ S.tipHeight
(S.timesTo S.tipHeight) S.requiredBits now = true := by sorrySource
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: AcceptBlockHeader, CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, CheckMerkleRoot, CheckWitnessMalleation, ContextualCheckBlock, ConnectBlock, GetBlockScriptFlags, IsBIP30Repeat, IsBIP30Unspendable, UpdateCoins, DisconnectBlock, ApplyTxInUndo, src/validation.cpp: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/validation.cpp; CheckTransaction (consensus/tx_check.cpp); IsFinalTx, GetLegacySigOpCount, GetP2SHSigOpCount, GetTransactionSigOpCost, CheckTxInputs (consensus/tx_verify.cpp); CScript::GetSigOpCount, IsUnspendable (script/script.cpp, script.h); CountWitnessSigOps (script/interpreter.cpp); AddCoin, SpendCoin, AddCoins (coins.cpp); GetBlockProof (chain.cpp); GetWitnessCommitmentIndex, GetBlockWeight (consensus/validation.h); CMainParams (kernel/chainparams.cpp)
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.