ContextualCheckBlock characterized
ProvedBitcoinBlockV2.contextualCheck_iffbip30bip34bitcoinbitcoin-mainnetblock-validationconnectblockconsensusformal-verificationundo
For a non-empty block whose transactions have inputs, contextualCheckBlock S b = true iff ContextSpec S b: every transaction final against the lock-time cutoff (median time past once CSV is active, else the block time), the BIP34 coinbase height prefix when active, the witness commitment rule, and the weight limit.
Preamble
import Definitions.Def_BitcoinBlockV2 import Definitions.Def_BitcoinSer
Formal statement
theorem BitcoinBlockV2.contextualCheck_iff (S : ChainState) (b : BitcoinSer.Block)
(hne : b.vtx ≠ []) (hvin : ∀ tx ∈ b.vtx, tx.vin ≠ []) :
BitcoinBlockV2.contextualCheckBlock S b = true ↔ BitcoinBlockV2.ContextSpec S b := 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.