BIP Draft: NestedMuSig2 for BIP340-compatible Signatures #2297

pull BEULAHEVANJALIN wants to merge 5 commits into bitcoin:master from BEULAHEVANJALIN:nested-musig changing 20 files +5789 −0
  1. BEULAHEVANJALIN commented at 9:02 AM on September 21, 2026: none

    This PR proposes NestedMuSig2 for BIP340-compatible Signatures, a BIP draft extending BIP327 MuSig2 to support trees of nested signing groups. Each subgroup participates through its aggregate public key, and the complete tree produces a single BIP340 signature verifiable without knowledge of the internal structure.

    The proposal includes the specification, a Python reference implementation, and test vectors covering nested key and nonce aggregation, signing, partial-signature verification, signature aggregation, and error handling. Multi-level examples and randomized tree tests accompany the vectors.

    Review is particularly welcome on recursive nonce binding, signer session construction, root tweaks, and compatibility with BIP327 in the flat case. The construction remains n-of-n at each aggregation node.

  2. Add BIP draft for nested MuSig2 with reference implementation and test vectors b3b0aa240e
  3. murchandamus added the label New BIP on Sep 21, 2026
  4. murchandamus renamed this:
    Add BIP draft for nested MuSig2 with reference implementation and tes…
    BIP Draft: NestedMuSig2 for BIP340-compatible Signatures
    on Sep 21, 2026
  5. murchandamus commented at 8:27 PM on September 22, 2026: member

    Hi Beulah, thank you for your submission. At first glance your document makes a great impression. I just wanted to let you know that I have seen it, but I will only get around to giving it a full read in a few weeks. I hope some other people will chime in with review here meanwhile.

  6. edilmedeiros commented at 9:15 PM on September 27, 2026: contributor
  7. patrickdugan commented at 11:55 AM on October 9, 2026: none

    Congratulations on your hard work and reaching this milestone!

    I ran a few million tokens over your BIP and got these findings and fixes:

    https://github.com/patrickdugan/bips/blob/nested-musig2-review/nested-musig2-review/FINDINGS.md

    https://github.com/BEULAHEVANJALIN/bips/pull/1

  8. Clarify X-only key encoding in Nested MuSig2 nonce binding docs 4523ee0eed
  9. BEULAHEVANJALIN commented at 6:50 AM on October 15, 2026: none

    @patrickdugan addressing F1. Fixed the inconsistent wording in 4523ee0. I’ve kept the 32-byte xbytes(pubkey) hash input, following BIP327’s convention.

  10. in bip-nested-musig2.mediawiki:153 in 4523ee0eed outdated
     148 | +The root aggregation node uses the same key-aggregation procedure as every other node. Let ''L<sub>0</sub>'' be the sorted list of root-level participant plain public keys. The untweaked root KeyAgg Context is ''keyagg_ctx<sub>0</sub> = KeyAgg(L<sub>0</sub>)''. Without aggregate-key tweaks, the root aggregate public key used for BIP340 verification is ''aggpk = GetXonlyPubkey(keyagg_ctx<sub>0</sub>)''.
     149 | +
     150 | +====Aggregate-Key Tweaking====
     151 | +
     152 | +The Nested MuSig2 construction referenced by this specification does not define aggregate-key tweaking. This specification also supports the BIP327 aggregate-key tweaking mechanism only at the root aggregation node. If the application specifies root-level aggregate-key tweaks, it MUST apply them sequentially to ''keyagg_ctx<sub>0</sub>'' using BIP327 ''ApplyTweak''. Any participants who act as an aggregator at the root level MUST use the same ordered tweak sequence and the same ''is_xonly_t'' value for each tweak. For tweaks ''tweak<sub>1</sub>, ..., tweak<sub>v</sub>'', let ''keyagg_ctx<sub>0,0</sub> = keyagg_ctx<sub>0</sub>'' and, for ''i = 1, ..., v'', ''keyagg_ctx<sub>0,i</sub> = ApplyTweak(keyagg_ctx<sub>0,i−1</sub>, tweak<sub>i</sub>, is_xonly_t<sub>i</sub>)''. Fail if any invocation of ''ApplyTweak'' fails according to BIP327.
     153 | +
    


    IsaqueFranklin commented at 10:26 PM on November 9, 2026:

    This specification also supports the BIP327 aggregate-key tweaking mechanism only at the root aggregation node.

    I saw the explanation in the rationale about it. Is this just to simplify the specification, or is there a deeper cryptographic assumption/problem?


    BEULAHEVANJALIN commented at 10:26 AM on November 21, 2026:

    This is just a simplification. If a non-root level aggregator is allowed to tweak then key aggregation and partialsig aggregation gets complicated.

  11. in bip-nested-musig2.mediawiki:284 in 4523ee0eed outdated
     279 | +* Let ''(Q, gacc, tacc) = keyagg_ctx''.
     280 | +* Let ''b<sub>0</sub> = int(hash<sub>MuSig/noncecoef</sub>(nonce_path[0] || xbytes(Q) || m)) mod n''.
     281 | +* Let ''R'<sub>1</sub> = cpoint_ext(nonce_path[0][0:33])''; if that fails, fail.
     282 | +* Let ''R'<sub>2</sub> = cpoint_ext(nonce_path[0][33:66])''; if that fails, fail.
     283 | +* Let ''R' = R'<sub>1</sub> + b<sub>0</sub>⋅R'<sub>2</sub>''.
     284 | +* If ''R''' is the point at infinity, let ''R = G''. Otherwise, let ''R = R'''.
    


    IsaqueFranklin commented at 6:01 PM on November 18, 2026:

    I believe this should be "If $R'$ is the point at infinity, let $R=G$. Otherwise, let $R=R'$." I believe this is a formatting issue. The mediawiki file clearly shows $R'$, but the rendered text on github shows $R$.


  12. danielabrozzoni commented at 6:23 PM on November 18, 2026: member

    I'm unfortunately not knowledgeable enough to fully review this, but the structure looks good, and the introduction section is well written and understandable :)

    I think you should submit the proposal to the mailing list to receive more feedback, and add the "Discussion:" link to the preamble, as specified in BIP3 (https://github.com/bitcoin/bips/blob/master/bip-0003.md#overview)

  13. in bip-nested-musig2.mediawiki:89 in 4523ee0eed outdated
      84 | +* ''b<sub>0</sub>'' is the root nonce-binding factor computed according to BIP327 from ''out<sub>0</sub>'', the final root X-only aggregate public key, and the message. If root-level aggregate-key tweaks are applied, use the public key after those tweaks.<br>''b<sub>0</sub>'' is the only nonce-binding factor that commits directly to the message.
      85 | +* ''b&#780;'' is the accumulated nonce-binding factor ''b&#780; = b<sub>0</sub>·b<sub>1</sub>·...·b<sub>&Lambda;−1</sub> mod n''.<br>Because this specification uses the BIP327 two-nonce construction, ''b&#780;'' is the coefficient multiplying the leaf signer's second secret nonce in its nested partial-signature equation.
      86 | +* ''c'' is the BIP340 challenge ''c = int(hash<sub>BIP0340/challenge</sub>(xbytes(R) || xbytes(Q) || m)) mod n'', where ''Q'' is the final root aggregate public key and ''R'' is the final effective nonce point.
      87 | +* ''c&#780;'' is the accumulated challenge coefficient ''c&#780; = c·a<sub>0</sub>·a<sub>1</sub>·...·a<sub>&Lambda;−1</sub> mod n''. It is the coefficient multiplying the leaf signer's secret-key contribution.
      88 | +* Let ''out<sub>0</sub> = cbytes_ext(R<sub>1,0</sub>) || cbytes_ext(R<sub>2,0</sub>)''. Compute ''R' = R<sub>1,0</sub> + b<sub>0</sub>·R<sub>2,0</sub>''.<br>If ''R'' is the point at infinity, let ''R = G''; otherwise, let ''R = R''. This is the unchanged BIP327 root effective-nonce rule.<br>Intermediate binding factors do not appear explicitly in this root expression because they have already been incorporated into nested nonce contributions by preceding invocations of ''NonceAggExt''.
      89 | +
    


    IsaqueFranklin commented at 6:43 PM on November 18, 2026:

    I think the infinity check here should refer to $R'$, rather than $R$.

    If R is the point at infinity, let $R = G$; otherwise, let $R = R$.

    Since $R'$ is the actual value computed, the point at infinity check should be performed on $R'$. And if so, $R=G$, otherwise $R=R'$.


  14. IsaqueFranklin commented at 7:17 PM on November 18, 2026: none

    I've finished a first reading, and overall I think the text looks pretty solid. Nice work! Next, I'm planning to take a closer look at the main algorithms over the next few weeks.

    I just think it's missing a general overview section, just like the one in BIP 327, especially the sub-section there about general signing flow. I think this would be a nice-to-have considering that most people reading this BIP won't read the paper, so a general introduction (without getting into much detail) just to build some context before the specification would be interesting.

  15. in bip-nested-musig2.mediawiki:8 in 4523ee0eed outdated
       0 | @@ -0,0 +1,827 @@
       1 | +<pre>
       2 | +  BIP: ?
       3 | +  Title: NestedMuSig2 for BIP340-compatible Signatures
       4 | +  Authors: Beulah Evanjalin <beulahebenezer777@gmail.com>
       5 | +  Status: Draft
       6 | +  Type: Specification
       7 | +  Assigned: ?
       8 | +  License: BSD-3-Clause
    


    jonatack commented at 10:06 PM on November 19, 2026:

    Per BIP 3, please add a Discussion: 2026-11-19: https://groups.google.com/g/bitcoindev/c/eSgxP8NmEnA/m/oSxrtE9jAQAJ header on the line after License.


  16. in bip-nested-musig2.mediawiki:611 in 4523ee0eed outdated
     606 | +
     607 | +Implementers are encouraged to reproduce the test vectors independently rather than treating the Python implementation as an independent proof of the specification.
     608 | +
     609 | +==Security Considerations==
     610 | +
     611 | +NestedMuSig2 is an interactive multi-signature protocol. Its security depends on correct nonce handling, correct recursive computation of key and nonce coefficients, consistent session state, and faithful implementation of the algorithms specified in this document. The security considerations of BIP327 apply in addition to the NestedMuSig2-specific considerations described below.
    


    jonatack commented at 10:10 PM on November 19, 2026:

    Should there be anything in this section about depth bounds / instantiation choices?


    BEULAHEVANJALIN commented at 5:20 PM on November 23, 2026:
  17. jonatack commented at 10:21 PM on November 19, 2026: member

    Concept ACK. The main gap here was the mailing-list discussion (normally required prior to opening a PR here; see this repo's README and BIP 3) and addressing outstanding review feedback (thank you @IsaqueFranklin!)

    Ran the tests locally.

    it's missing a general overview section, just like the one in BIP 327, especially the sub-section there about general signing flow. I think this would be a nice-to-have considering that most people reading this BIP won't read the paper, so a general introduction (without getting into much detail) just to build some context before the specification would be interesting.

    Agree.

  18. Added discussion and overview sections 46c1dbe28f
  19. jonatack added the label PR Author action required on Nov 20, 2026
  20. specify the security considerations for nesting depth cd4a96668b
  21. BEULAHEVANJALIN commented at 5:26 PM on November 23, 2026: none

    Congratulations on your hard work and reaching this milestone!

    I ran a few million tokens over your BIP and got these findings and fixes:

    https://github.com/patrickdugan/bips/blob/nested-musig2-review/nested-musig2-review/FINDINGS.md

    BEULAHEVANJALIN#1 @patrickdugan, I have acknowledged the concerns of F2 here https://github.com/bitcoin/bips/pull/2297/changes/cd4a96668bb3cca1bdfa63fc0bfc12151a43392f

  22. BEULAHEVANJALIN commented at 5:28 PM on November 23, 2026: none

    I've finished a first reading, and overall I think the text looks pretty solid. Nice work! Next, I'm planning to take a closer look at the main algorithms over the next few weeks.

    I just think it's missing a general overview section, just like the one in BIP 327, especially the sub-section there about general signing flow. I think this would be a nice-to-have considering that most people reading this BIP won't read the paper, so a general introduction (without getting into much detail) just to build some context before the specification would be interesting. @IsaqueFranklin, I have added overview section in this commit https://github.com/bitcoin/bips/pull/2297/commits/46c1dbe28fc0815df8ea1c9f57b4b9778e5d7c6a

  23. formatting c0a867d827

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-24 00:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me