Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

MuSig2 partial-signature aggregation in any module

Proved
BitcoinMuSig.musig2_partialSigAgg

by pitimespi · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

bip327bip340bitcoinelliptic-curveformal-verificationfrostmathlibmultisignaturemusig2schnorrsecp256k1

Over any commutative ring KKK and KKK-module: if every partial signature satisfies siG=ε(R1,i+bR2,i)+(e ai g gacc)Xis_iG = \varepsilon(R_{1,i} + bR_{2,i}) + (e\,a_i\,g\,g_{acc})X_isi​G=ε(R1,i​+bR2,i​)+(eai​ggacc​)Xi​ and Q=gacc∑aiXi+taccGQ = g_{acc}\sum a_iX_i + t_{acc}GQ=gacc​∑ai​Xi​+tacc​G, then (∑si+e g tacc)G=ε(∑R1,i+b∑R2,i)+e(gQ)(\sum s_i + e\,g\,t_{acc})G = \varepsilon(\sum R_{1,i} + b\sum R_{2,i}) + e(gQ)(∑si​+egtacc​)G=ε(∑R1,i​+b∑R2,i​)+e(gQ): the BIP340 equation for the aggregate.

Preamble
import Definitions.Def_BitcoinMuSig
open BitcoinMuSig BitcoinSig BitcoinTaproot
Formal statement
theorem BitcoinMuSig.musig2_partialSigAgg {ι K M : Type*} [CommRing K] [AddCommGroup M] [Module K M]
    (S : Finset ι) (G : M) (X R₁ R₂ : ι → M) (a s : ι → K) (b e g gacc tacc ε : K) (Q : M)
    (hQ : Q = gacc • ∑ i ∈ S, a i • X i + tacc • G)
    (hpart : ∀ i ∈ S, s i • G = ε • (R₁ i + b • R₂ i) + (e * a i * (g * gacc)) • X i) :
    (∑ i ∈ S, s i + e * g * tacc) • G = ε • (∑ i ∈ S, R₁ i + b • ∑ i ∈ S, R₂ i) + e • (g • Q) := by sorry
Source
BIP327 MuSig2 for BIP340-compatible multi-signatures (KeyAgg, ApplyTweak, NonceAgg, GetSessionValues, PartialSigVerifyInternal, PartialSigAgg): https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki; BIP340 Schnorr signatures; RFC 9591 FROST (Lagrange-coefficient aggregation); secp256k1 (SEC 2); Mathlib's WeierstrassCurve.Affine group law; the signature mission's executable curve (BitcoinSig.padd, pmul, schnorrVerify)
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: BitcoinMuSig.musig2_partialSigAgg

Source file: Thm_BitcoinMuSig_musig2_partialSigAgg.lean (one theorem; it builds on the MuSig definition file, which itself uses the secp256k1 signature and Taproot definition files).

Statement. Let ι\iotaι be an arbitrary index type, KKK an arbitrary commutative ring and MMM an arbitrary additive commutative group with a KKK-module structure. Let S⊆ιS \subseteq \iotaS⊆ι be any finite set (possibly empty), G∈MG \in MG∈M, X,R1,R2:ι→MX, R_1, R_2 : \iota \to MX,R1​,R2​:ι→M arbitrary families (written Xi,R1,i,R2,iX_i, R_{1,i}, R_{2,i}Xi​,R1,i​,R2,i​), a,s:ι→Ka, s : \iota \to Ka,s:ι→K arbitrary families of scalars, b,e,g,gacc,tacc,ε∈Kb, e, g, \mathit{gacc}, \mathit{tacc}, \varepsilon \in Kb,e,g,gacc,tacc,ε∈K arbitrary scalars, and Q∈MQ \in MQ∈M. Assume

  1. Q=gacc(∑i∈SaiXi)+tacc GQ = \mathit{gacc}\Big(\sum_{i\in S} a_i X_i\Big) + \mathit{tacc}\,GQ=gacc(∑i∈S​ai​Xi​)+taccG (the tacc G\mathit{tacc}\,GtaccG term is outside both the sum and the factor gacc\mathit{gacc}gacc);
  2. for every i∈Si \in Si∈S:  si G=ε(R1,i+b R2,i)+(e ai (g⋅gacc))Xi\ s_i\,G = \varepsilon\big(R_{1,i} + b\,R_{2,i}\big) + \big(e\,a_i\,(g\cdot\mathit{gacc})\big) X_i si​G=ε(R1,i​+bR2,i​)+(eai​(g⋅gacc))Xi​.

Then

(∑i∈Ssi+e g tacc)G=ε(∑i∈SR1,i+b∑i∈SR2,i)+e (g Q),\Big(\sum_{i\in S} s_i + e\,g\,\mathit{tacc}\Big) G = \varepsilon\Big(\sum_{i\in S} R_{1,i} + b\sum_{i\in S} R_{2,i}\Big) + e\,(g\,Q),(i∈S∑​si​+egtacc)G=ε(i∈S∑​R1,i​+bi∈S∑​R2,i​)+e(gQ),

where on the left e g tacce\,g\,\mathit{tacc}egtacc is added once, outside the sum. No other relation among the variables is assumed.

Definitions used, unfolded

The generic algebraic setting

  • ι\iotaι (where present) is an arbitrary type of indices, with no structure assumed (it may be empty, infinite, etc.).
  • KKK is an arbitrary commutative ring (with 111; it may be the zero ring).
  • MMM is an arbitrary additive commutative group equipped with a KKK-module structure: a scalar multiplication K×M→MK \times M \to MK×M→M, written kxkxkx, satisfying the module axioms with respect to the given addition of MMM (1x=x1x = x1x=x, (kl)x=k(lx)(kl)x = k(lx)(kl)x=k(lx), k(x+y)=kx+kyk(x+y) = kx + kyk(x+y)=kx+ky, (k+l)x=kx+lx(k+l)x = kx + lx(k+l)x=kx+lx, 0x=00x = 00x=0, k0=0k0 = 0k0=0). MMM may be the trivial group.
  • A finite set SSS of indices (where present) may be empty; empty sums are 000.
  • Nothing from the Bitcoin definition files enters this statement: in particular, the letter GGG is a universally quantified element of MMM, not the secp256k1 generator.
Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me