An empty signature is a clean failure
ProvedBitcoinSig.checkSig_emptyWith the public-key encoding check passing, checkSigPreTapscript … [] pk = some false: an empty signature passes CheckSignatureEncoding and makes CheckECDSASignature return false — a script-level false, not a script error.
import Definitions.Def_BitcoinSig open BitcoinSig BitcoinSer
theorem BitcoinSig.checkSig_empty (f : SigFlags) (tx : Tx) (nIn : Nat) (amount : Int) (v : SigVersion)
(scriptCode pk : Bytes) (hpk : BitcoinSig.checkPubKeyEncoding f v pk = true) :
BitcoinSig.checkSigPreTapscript f tx nIn amount v scriptCode [] pk = some false := 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: BitcoinSig.checkSig_empty
Binders and hypothesis. Universally quantified: a flag record (Booleans dersig, lowS, strictenc, witnessPubkeyType); a transaction ; a natural number ; an integer ; a signature version ; byte strings and . One hypothesis : checkPubKeyEncoding = true. Unfolded: it is not the case that (.strictenc is set and fails isCompressedOrUncompressedPubKey, i.e. is not [65 bytes starting 0x04] and not [33 bytes starting 0x02 or 0x03]), and it is not the case that (.witnessPubkeyType is set, = witnessV0, and is not [33 bytes starting 0x02/0x03]). In particular holds for every (including the empty string) when .strictenc is false and either .witnessPubkeyType is false or = base.
Conclusion.
i.e. the pre-tapscript check with the empty signature returns the verdict "false" (and not a script error "none", and not "true").
Unfolding. The script code used is: for base, the first component of findAndDelete (pushBytes ) — note pushBytes is the single byte 0x00, so every 0x00 byte at an instruction boundary of is removed; for witnessV0, itself. checkSignatureEncoding is true unconditionally (the empty signature is exempt from every encoding check, whatever the flags). With , neither "none" branch fires, so the result is "some" of checkECDSASignature . That function returns false if pubkeyValid is false; otherwise it takes the last byte of the signature, and since the signature is empty there is none, so it returns false. In both cases the Boolean is false, giving "some false". The transaction, index, amount, version and script code are never used beyond this.
What is not said. The statement does not say anything about non-empty signatures. It does not say what happens when fails (then the result is "none"). It does not assert that the empty signature is rejected as a script error — it asserts precisely that it is accepted as a well-formed check that evaluates to false. It does not say anything about the public key beyond the encoding hypothesis; may be garbage (e.g. empty, if the flags allow) and the result is still "some false". It does not mention that the findAndDelete step alters by deleting OP_0 bytes, since the altered script code is never hashed in this case. It does not say anything about witnessV0 amounts (the negative-amount rejection is never reached because the empty-signature check comes first).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.