Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

MuSig2 aggregation on secp256k1's group

Proved
BitcoinMuSig.musig2_partialSigAgg_secp256k1

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

bip327bip340bitcoinelliptic-curveformal-verificationfrostmathlibmultisignaturemusig2schnorrsecp256k1

musig2_partialSigAgg on Mathlib's points of WWW with generator Gpt and integer scalars.

Preamble
import Definitions.Def_BitcoinMuSig
open BitcoinMuSig BitcoinSig BitcoinTaproot
Formal statement
theorem BitcoinMuSig.musig2_partialSigAgg_secp256k1 {ι : Type*} (S : Finset ι) (X R₁ R₂ : ι → W.Point)
    (a s : ι → ℤ) (b e g gacc tacc ε : ℤ) (Q : W.Point)
    (hQ : Q = gacc • ∑ i ∈ S, a i • X i + tacc • Gpt)
    (hpart : ∀ i ∈ S, s i • Gpt = ε • (R₁ i + b • R₂ i) + (e * a i * (g * gacc)) • X i) :
    (∑ i ∈ S, s i + e * g * tacc) • Gpt = ε • (∑ 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_secp256k1

Source file: Thm_BitcoinMuSig_musig2_partialSigAgg_secp256k1.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 and S⊆ιS \subseteq \iotaS⊆ι any finite set (possibly empty). Let X,R1,R2:ι→W(Fp)X, R_1, R_2 : \iota \to W(\mathbb{F}_p)X,R1​,R2​:ι→W(Fp​) be arbitrary families of curve points (written Xi,R1,i,R2,iX_i, R_{1,i}, R_{2,i}Xi​,R1,i​,R2,i​), a,s:ι→Za, s : \iota \to \mathbb{Z}a,s:ι→Z arbitrary families of integers, b,e,g,gacc,tacc,ε∈Zb, e, g, \mathit{gacc}, \mathit{tacc}, \varepsilon \in \mathbb{Z}b,e,g,gacc,tacc,ε∈Z arbitrary integers, and Q∈W(Fp)Q \in W(\mathbb{F}_p)Q∈W(Fp​). All scalars are ordinary integers (no reduction mod nnn), acting on the group W(Fp)W(\mathbb{F}_p)W(Fp​) by integer multiples. Assume

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

Then

(∑i∈Ssi+e g tacc)⋅Gpt=ε⋅(∑i∈SR1,i+b⋅∑i∈SR2,i)+e⋅(g⋅Q),\Big(\sum_{i\in S} s_i + e\,g\,\mathit{tacc}\Big)\cdot G_{\mathrm{pt}} = \varepsilon\cdot\Big(\sum_{i\in S} R_{1,i} + b\cdot\sum_{i\in S} R_{2,i}\Big) + e\cdot(g\cdot Q),(i∈S∑​si​+egtacc)⋅Gpt​=ε⋅(i∈S∑​R1,i​+b⋅i∈S∑​R2,i​)+e⋅(g⋅Q),

where on the left the integer e g tacce\,g\,\mathit{tacc}egtacc is added once to the integer sum ∑i∈Ssi\sum_{i\in S} s_i∑i∈S​si​.

Definitions used, unfolded

Constants

  • p=2256−232−977p = 2^{256} - 2^{32} - 977p=2256−232−977 is a fixed natural number (the field modulus).
  • n=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141n = \mathtt{0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141}n=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 is a fixed natural number (written in hexadecimal).
  • Gx=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798G_x = \mathtt{0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798}Gx​=0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 and Gy=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8G_y = \mathtt{0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8}Gy​=0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8 are fixed natural numbers (GyG_yGy​ is even: its last hexadecimal digit is 888).

The Mathlib curve WWW and its point group W(Fp)W(\mathbb{F}_p)W(Fp​)

  • Fp\mathbb{F}_pFp​ denotes Mathlib's Z/pZ\mathbb{Z}/p\mathbb{Z}Z/pZ. For a natural number xxx, (x:Fp)(x : \mathbb{F}_p)(x:Fp​) is its residue x mod px \bmod pxmodp. The definition file registers, as a global instance, the fact that ppp is prime (proved there by a Lucas–Pratt certificate); this instance is what makes Z/pZ\mathbb{Z}/p\mathbb{Z}Z/pZ a field, which Mathlib needs to put a group structure on curve points.
  • WWW is the Weierstrass curve over Fp\mathbb{F}_pFp​ with coefficients a1=a2=a3=a4=0a_1 = a_2 = a_3 = a_4 = 0a1​=a2​=a3​=a4​=0 and a6=7a_6 = 7a6​=7, i.e. the curve
y2=x3+7.y^2 = x^3 + 7 .y2=x3+7.
  • W(Fp)W(\mathbb{F}_p)W(Fp​) is Mathlib's type of points of WWW: a point is either the point at infinity, written 000, or an affine point (x,y)∈Fp2(x, y) \in \mathbb{F}_p^2(x,y)∈Fp2​ with y2=x3+7y^2 = x^3 + 7y2=x3+7 (carrying a proof that it is nonsingular). It is equipped with Mathlib's chord-and-tangent addition, which makes it an additive commutative group with neutral element 000 and negation −(x,y)=(x,−y)-(x, y) = (x, -y)−(x,y)=(x,−y), −0=0-0 = 0−0=0.
  • For k∈Nk \in \mathbb{N}k∈N and P∈W(Fp)P \in W(\mathbb{F}_p)P∈W(Fp​), k⋅P=P+⋯+Pk \cdot P = P + \dots + Pk⋅P=P+⋯+P (kkk summands, 0⋅P=00 \cdot P = 00⋅P=0). For k∈Zk \in \mathbb{Z}k∈Z, k⋅Pk \cdot Pk⋅P is the usual integer multiple (k⋅P=−(∣k∣⋅P)k \cdot P = -(|k|\cdot P)k⋅P=−(∣k∣⋅P) for k<0k<0k<0).
  • Gpt∈W(Fp)G_{\mathrm{pt}} \in W(\mathbb{F}_p)Gpt​∈W(Fp​) is the affine point (Gx mod p, Gy mod p)(G_x \bmod p,\ G_y \bmod p)(Gx​modp, Gy​modp).
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