Hash160 outputs 20 bytes
ProvedBitcoinSer.hash160_lengthFor every message: .
import Definitions.Def_BitcoinSer
theorem BitcoinSer.hash160_length (m : Bytes) : (BitcoinSer.hash160 m).length = 20 := 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.hash160_length
Binders and hypothesis. A single byte string , universally quantified, with no restriction (empty or of any length). No hypotheses.
Conclusion. The composite hash applied to is a byte string of length exactly 20:
Unfolding. By definition : the file's SHA-256 is applied first, producing (by its definition) a 32-byte string, and the file's RIPEMD-160 is applied to that. The statement, however, only requires the outer function's output length. is defined as: pad with (append , then zeros to reach 56 mod 64, then the 8 little-endian bytes of the bit length ); cut into 64-byte chunks; fold over the chunks starting from the 5-word initial state , where each compression runs two independent 80-step lines (left and right) over the chunk's 16 little-endian words, using the 80-entry index tables and 80-entry rotation tables, and recombines the two results with the input state by the five cross-sums ; finally the five 32-bit state words are each emitted as 4 little-endian bytes.
The length claim thus reduces to: five concatenated outputs of , each of a word value and hence of length 4, total . Neither the number of chunks nor the inner SHA-256 value affects this. Since the inner input to RIPEMD-160 is always the 32-byte SHA-256 output, the RIPEMD-160 stage always processes exactly one 64-byte padded chunk (32 + 1 + 23 + 8 = 64), but the theorem does not depend on or state this.
What is not said. Nothing about the byte values, agreement with any standard Hash160/RIPEMD-160, or any test vector. Nothing about the length of on its own (only the composite is named), nor of (that is sha256_length), nor . No injectivity or collision statement. No statement that the padded input has a multiple-of-64 length. The theorem fixes only the output length, 20, for every input .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.