The witness-stripped serialization ignores witnesses
ProvedBitcoinSer.serTx_stripFor every transaction: .
import Definitions.Def_BitcoinSer
theorem BitcoinSer.serTx_strip (tx : Tx) : BitcoinSer.serTx false tx = BitcoinSer.serTx false tx.stripWitness := by sorry
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: BitcoinSer.serTx_strip
Binders and hypothesis. A single transaction record (fields: a natural-number version, a list of inputs each carrying an outpoint, a script, a sequence number and a witness list; a list of outputs each carrying an integer value and a script; a natural-number lock time). No restriction on : it need not be well-formed, may have no inputs, may have witnesses, may have out-of-range field values. No hypotheses.
Conclusion. The witness-free serialization of is byte-for-byte the witness-free serialization of its witness-stripped copy:
Unfolding. is with every input's witness list replaced by the empty list; all other fields, including the number and order of inputs, are unchanged. first computes if and are both true, else ; then emits , the two bytes only if , the CompactSize-prefixed list of serialized inputs (each input serialized as outpoint hash bytes, 4-byte index, length-prefixed script, 4-byte sequence — never the witness), the CompactSize-prefixed list of serialized outputs, the per-input witness stacks only if , and finally . With the first argument fixed to false, on both sides regardless of , so neither side contains the marker bytes or the witness section, and the remaining pieces depend only on version, inputs-without-witness, outputs and lock time, all of which stripping leaves untouched. The statement is therefore that the function does not look at the witness field at all; both sides are the same expression after substituting .
Edge cases silently included: with no inputs (both sides begin ); already without witnesses (then and the equation is reflexive); field values that the encoders truncate (both sides truncate identically).
What is not said. Nothing about : in particular it is not claimed that (false when has a witness, since the left side then carries marker and witness bytes), nor that (true by the definitions, but not stated here; compare weight_no_witness). Nothing about hashes (that is txid_strip), lengths, or parsing. Nothing about well-formedness. It is one equality of byte strings, for all , with the mode fixed to false.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.