The TapLeaf and TapBranch tags hash differently
ProvedBitcoinTapSoundness.tapleaf_ne_tapbranchsha256 (ascii "TapLeaf") ≠ sha256 (ascii "TapBranch"), by kernel computation of the model's SHA-256 on the two tags.
Deprecated. Superseded by BitcoinTapSoundnessV2.tapleaf_ne_tapbranch (revision 2, BitcoinTapSoundnessV2): the first revision's collision alternatives were closed propositions, provable by counting; the V2 declarations name the colliding strings and the two 32-byte tweaks explicitly, computed from the inputs. This lemma is unchanged in content and re-uploaded under the V2 namespace so that the revision is self-contained.
import Definitions.Def_BitcoinTapSoundness import Definitions.Def_BitcoinSer import Definitions.Def_BitcoinSig open BitcoinTapSoundness BitcoinSer BitcoinTaproot
theorem BitcoinTapSoundness.tapleaf_ne_tapbranch :
BitcoinSer.sha256 (BitcoinSig.ascii "TapLeaf") ≠ BitcoinSer.sha256 (BitcoinSig.ascii "TapBranch") := 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: BitcoinTapSoundness.tapleaf_ne_tapbranch
Statement. This is a closed statement with no variables and no hypotheses:
That is, the 32-byte SHA-256 digest of the 7-byte ASCII/UTF-8 encoding of the string TapLeaf (bytes ) is not equal, as a byte string, to the 32-byte SHA-256 digest of the 9-byte encoding of the string TapBranch (bytes ).
Unfolded notions.
- is the list of bytes of the UTF-8 encoding of the string ; for these two ASCII strings it is their ASCII bytes.
- is the bundle's own executable implementation of SHA-256: Merkle–Damgård padding (append , then zero bytes until the length is , then the message bit length as 8 big-endian bytes), the standard 64-round compression function with the standard round constants and initial state, and a 32-byte big-endian digest. It is a concrete total function, so both sides of the inequality are specific, computable 32-byte strings.
Edge cases made explicit. Nothing is quantified; the statement is simply the inequality of two particular 32-byte values determined by the implementation. It does not mention tagged hashes, leaves, branches, or the tapleaf/tapbranch hash functions themselves; it compares only the plain SHA-256 digests of the two tag strings.