MuSig2 correctness with honest signers
ProvedBitcoinMuSig.musig2_correctHonest partial signatures sum to a signature satisfying the Schnorr equation for the aggregate key.
import Definitions.Def_BitcoinMuSig open BitcoinMuSig BitcoinSig BitcoinTaproot
theorem BitcoinMuSig.musig2_correct {ι K M : Type*} [CommRing K] [AddCommGroup M] [Module K M]
(S : Finset ι) (G : M) (d k₁ k₂ a : ι → K) (b e g gacc tacc ε : K) :
(∑ i ∈ S, (ε * k₁ i + b * (ε * k₂ i) + e * a i * (g * gacc * d i)) + e * g * tacc) • G =
ε • (∑ i ∈ S, k₁ i • G + b • ∑ i ∈ S, k₂ i • G) +
e • (g • (gacc • ∑ i ∈ S, a i • (d i • G) + tacc • G)) := 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: BitcoinMuSig.musig2_correct
Source file: Thm_BitcoinMuSig_musig2_correct.lean (one theorem; it builds on the MuSig definition file, which itself uses the secp256k1 signature and Taproot definition files).
Statement. Let be an arbitrary index type, an arbitrary commutative ring and an arbitrary additive commutative group with a -module structure. For every finite set (possibly empty), every , all families (written ) and all scalars (no hypotheses),
On the left, the term is added once, outside the sum over . On the right, is added once to times the sum (it is not inside the sum, and does not multiply it).
Definitions used, unfolded
The generic algebraic setting
- (where present) is an arbitrary type of indices, with no structure assumed (it may be empty, infinite, etc.).
- is an arbitrary commutative ring (with ; it may be the zero ring).
- is an arbitrary additive commutative group equipped with a -module structure: a scalar multiplication , written , satisfying the module axioms with respect to the given addition of (, , , , , ). may be the trivial group.
- A finite set of indices (where present) may be empty; empty sums are .
- Nothing from the Bitcoin definition files enters this statement: in particular, the letter is a universally quantified element of , not the secp256k1 generator.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.