An empty signature is a clean false
ProvedBitcoinTaproot.checksig_emptyAn executed OP_CHECKSIG with an empty signature and a 32-byte key pushes false (the empty vector), consumes no weight, and performs no signature check — the construction that makes OP_CHECKSIGADD thresholds work.
import Definitions.Def_BitcoinTaproot import Definitions.Def_BitcoinScript open BitcoinTaproot BitcoinSer BitcoinSig BitcoinVerify open BitcoinScript hiding Bytes Byte
theorem BitcoinTaproot.checksig_empty (c : TapCtx) (ed : ExecData) (ts : TapState) (pubkey : Bytes) (rest : List Bytes)
(hs : ts.st.stack = pubkey :: [] :: rest) (hpk : pubkey.length = 32) :
BitcoinTaproot.tapExecOp c ed true BitcoinScript.OP_CHECKSIG ts =
some { ts with st := { ts.st with stack := BitcoinScript.boolBytes false :: rest } } := by sorryRead-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: BitcoinTaproot.checksig_empty
Binders. : a TapCtx record (flags cltv, csv, nulldummy; transaction ; list of outputs; index ); : an ExecData record; : a TapState record with fields (interpreter state: main stack, alt stack, condition stack, op count), , ; : a byte string; : a list of byte strings.
Hypotheses.
- — the main stack, top first, has on top, then the empty byte string, then ;
- .
Conclusion.
where is OP_CHECKSIG and is the empty byte string (vchFalse). All other fields — the alt stack, condition stack and op count of , and , , of — are those of .
Unfolded. In the opcode is neither OP_IF nor OP_NOTIF, so the second branch applies: the stack must match (here ), else the result would be . Then is computed, with equal to except codeseparatorPos . That function sets , here ; if else , here unchanged; it returns if (not the case), if (not the case), and for it returns only if , which is false since is false — so no signature verification is performed and the result is . Back in , since the opcode is not OP_CHECKSIGVERIFY, the new state has stack and .
Edge cases the quantifiers include. negative (no failure, since the budget test requires ); empty; a 32-byte that is not a valid x-only key (never inspected); arbitrary transaction, , and ; the condition stack of may be non-empty or contain false (the function is called with the execute flag true regardless).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.