Skip to content

BIP Draft: NestedMuSig2 for BIP340-compatible Signatures - #2297

Open
BEULAHEVANJALIN wants to merge 3 commits into
bitcoin:masterfrom
BEULAHEVANJALIN:nested-musig
Open

BEULAHEVANJALIN wants to merge 3 commits into
bitcoin:masterfrom
BEULAHEVANJALIN:nested-musig

Conversation

@BEULAHEVANJALIN

Copy link
Copy Markdown

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.

@murchandamus murchandamus changed the title Add BIP draft for nested MuSig2 with reference implementation and tes… BIP Draft: NestedMuSig2 for BIP340-compatible Signatures Sep 21, 2026
@murchandamus

Copy link
Copy Markdown
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.

@edilmedeiros

Copy link
Copy Markdown
Contributor

@IsaqueFranklin

@patrickdugan

Copy link
Copy Markdown

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

@BEULAHEVANJALIN

Copy link
Copy Markdown
Author

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

@danielabrozzoni danielabrozzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@IsaqueFranklin IsaqueFranklin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +152 to +153
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

* Let ''R'<sub>1</sub> = cpoint_ext(nonce_path[0][0:33])''; if that fails, fail.
* Let ''R'<sub>2</sub> = cpoint_ext(nonce_path[0][33:66])''; if that fails, fail.
* Let ''R' = R'<sub>1</sub> + b<sub>0</sub>⋅R'<sub>2</sub>''.
* If ''R''' is the point at infinity, let ''R = G''. Otherwise, let ''R = R'''.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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$.

Comment on lines +88 to +89
* 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''.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'$.

Status: Draft
Type: Specification
Assigned: ?
License: BSD-3-Clause

@jonatack jonatack Nov 19, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jonatack jonatack left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


==Security Considerations==

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jonatack jonatack added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New BIP PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants