SequenceLocks is the BIP68 specification
ProvedBitcoinBlockV2.sequenceLocks_iffbip30bip34bitcoinbitcoin-mainnetblock-validationconnectblockconsensusformal-verificationundo
sequenceLocksOk u height mtp ltf tx = true iff the BIP68 mission's satisfiesBIP68 holds for the transaction's version, the lock-time flags, the context (height, median times) and the inputs' sequences and coin heights — with no admissibility hypothesis, through the published fold_acceptance.
Preamble
import Definitions.Def_BitcoinBlockV2 import Definitions.Def_BitcoinSer
Formal statement
theorem BitcoinBlockV2.sequenceLocks_iff (u : Ledger) (height : Nat) (mtp : Nat → Nat) (ltf : Nat) (tx : BitcoinSer.Tx) :
BitcoinBlockV2.sequenceLocksOk u height mtp ltf tx = true ↔
BitcoinBIP68.satisfiesBIP68 (BitVec.ofNat 32 tx.version) (BitVec.ofNat 32 ltf) ⟨height, mtp⟩
(tx.vin.map fun i => ⟨BitVec.ofNat 32 i.nSequence, (BitcoinBlockV2.accessCoin u i.prevout).height⟩) := 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.