Skip to content
BIP ATLAS

BIP 0327

How can many signers share one key?

MuSig2 turns several public keys into one, and two rounds of messages into one ordinary BIP 340 signature. Nothing in a key-path spend shows there was more than one signer.

A coin that needs three people to agree can be locked with a script that checks three signatures. That works, but it puts three keys and three signatures on chain, and tells everyone that three people were involved. BIP 327, assigned in 2022 and recorded as deployed, offers another way: a multi-signature scheme called MuSig2, in which the signers combine their keys into one and produce one signature together.123

The result is an ordinary BIP 340 key and an ordinary BIP 340 signature. The authors’ primary motivation is letting people using different software jointly control a Taproot output and spend it through its key path; they argue this is more compact, cheaper to verify and more private than an n-of-n script that checks every signer. The standard also supports tweaking the aggregate key, for BIP 32 child keys and for BIP 341 Taproot commitments.3456

Source revision
bitcoin/bips @ 3a10b5b
Source checked
1 October 2026
Review state
Draft — independent technical review applied; awaiting human sign-off
Source details

This chapter is an independent explanation, not the proposals themselves. Preamble fields are shown as recorded in the pinned files, with author e-mail addresses omitted. Status is the proposal’s own field, not an endorsement or a sign of consensus.

BIP 327: MuSig2 for BIP340-compatible Multi-Signatures

BIP
327
Title
MuSig2 for BIP340-compatible Multi-Signatures
Authors
Jonas Nick
Tim Ruffing
Elliott Jin
Status
Deployed
Type
Informational
Assigned
2022-03-22
License
BSD-3-Clause
Version
1.0.4

Pinned source · Reader view on bips.dev
SHA-256 918555f9d67bf4c1124b004f43e7cfa2436570ce46466f06f83f836f58e8ff7c
Git blob 117d6c7b6363514723928655fed2aabf75f18dfc

FIG. A14.1 Not a plain sum

Order P1, P2, P3

  1. ad0537c883…2aa183·P1
  2. 1·P2
  3. f45bb02503…6005c6·P3

Q = 90539eede5…d4610c

Order P3, P2, P1

  1. fe377513ee…0ff1e6·P3
  2. 1·P2
  3. 5ccb63d1d2…85a5ff·P1

Q = 6204de8b08…f54b2b

Plain sum (not MuSig2)

P1 + P2 + P3

= eb078e96f1…f8cdc5

Keys and both aggregates from BIP 327 key_agg_vectors.json (cases 0 and 1), recomputed by the tested model. The second distinct key in each list gets coefficient 1. The plain sum, computed for contrast, matches neither.

Three published keys aggregated in two orders, each key weighted by its coefficient, beside what simply adding the keys would give.789

One key from many

Key aggregation needs no interaction. Given the list of everyone’s public keys, anyone can compute the aggregate: Q = a₁·P₁ + a₂·P₂ + … + aᵤ·Pᵤ. Each coefficient aᵢ is a tagged hash of a hash of the whole key list together with that signer’s own key. The input keys are ordinary 33-byte compressed keys; the output is a 32-byte BIP 340 key.5710

The coefficients are what make this different from adding keys together: each hashed coefficient depends on the entire list as well as on the key it multiplies. The figure above shows the effect on BIP 327’s own three-key example: the plain sum of the keys matches neither aggregate.79

It also shows that order matters. The same three keys in reverse order give a different aggregate key, because the list hash changes. Applications without a natural order for their signers can sort the keys first with KeySort.89

One coefficient is fixed. The second distinct key in the list always gets coefficient 1, an optimization the BIP calls MuSig2*, which saves one point multiplication. The same key may even appear twice; the algorithms handle it, and the BIP recommends omitting duplicate checks to simplify error handling; at that point it is often impossible to tell which signer copied whom. Applications may still reject duplicates, for instance when one owner runs several devices.711

Two rounds

Signing takes two rounds of messages. In the first, each signer generates a secret nonce and sends the public part, which in MuSig2 is two points rather than one. The public nonces are added up, point by point, into an aggregate nonce. This round can even happen before anyone knows the message or the final set of signers.121314

Every signer then computes the same session values. A nonce coefficient b is hashed from the aggregate nonce, the aggregate key and the message; the final nonce is R = R₁ + b·R₂; and e is the usual BIP 340 challenge for R, the key and the message. If R₁ + b·R₂ is the point at infinity, which signals a dishonest signer or aggregator, the BIP uses the generator G instead: signing can then continue, and the culprit is caught when partial signatures are verified. One of its signing vectors exercises exactly that case.1516

FIG. A14.2 A signing session, round by round Interactive

A · Interactive

Static view: the first vector with every stage shown. With JavaScript you can choose among 4 published vectors and step through the rounds.

  1. 1 Key aggregation
  2. 2 Round 1: nonces
  3. 3 Session values
  4. 4 Round 2: partial signatures
  5. 5 Aggregate signature

The partial signatures are summed, plus a term for the tweaks. The result is a 64-byte signature checked by plain BIP 340 verification.

SignerPublic key · coefficientPublic nonce (R₁, R₂)Partial signature
103935f972d…f261a9a = a1482da489…485be9036e5ee6e2…d94ae902dba67e4a…11b53eb15d2cd3c3…af53fb✓ verifies for this signer
202d2dc6f5d…ef6e05a = 1 (second distinct key)03e4f798da…58fc5103e0618031…ac1f006193d6ac61…9fcb64✓ verifies for this signer

Aggregated values

key-list hash L
e50159861a…c725d8
aggregate key Q
f68803d6235df99eb72f251d832b52029a64ae2c195a15823bd85f9577478408Q has even y
aggregate nonce
0341432722…c3210c 03d377f2d2…75982b
nonce coefficient b
85fece05d0…83a1ae
final nonce R
03041da222…b9ef09odd y: every signer negates its secret nonces k₁, k₂
challenge e
ae965946b0…13e7e4
signature (R, s)
041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef0912f1038025857fedeb3ff696f8b99fa4bb2c5812f6095a2e0004ec99ce18de1e
BIP 340 verify
✓ valid for key f68803d623…478408 and message 599c67ea41…237869

Source: BIP 327 sig_agg_vectors.json, case 0 (line 50). Recomputed at build time by the tested MuSig2 model; the aggregate nonce and signature equal the vector’s, and noble’s BIP 340 verifier accepts the signature.

B · Worked example

BIP 327’s first signature-aggregation vector: 2 signers, one message, from public keys to a single signature.

123456
  1. 2 plain public keys, each with a coefficient

    signer 1 key · a
    03935f972da013f80ae011890fa89b67a27b7be6ccb24d3274d18b2d4067f261a9 · a1482da489d1a3d3616cbd2b055eb477593f24242e2662ad6342b22549485be9
    signer 2 key · a
    02d2dc6f5df7c56acf38c7fa0ae7a759ae30e19b37359dfde015872324c7ef6e05 · 1

    a = H(L ‖ key) mod n, except the second distinct key, which gets 1.

  2. Aggregate key Q = Σ aᵢ·Pᵢ

    Q (x-only)
    f68803d6235df99eb72f251d832b52029a64ae2c195a15823bd85f9577478408

    One BIP 340 public key; nothing in it shows how many signers there are.

  3. Round 1: two-point nonces, summed

    signer 1 nonce
    036e5ee6e28824029fea3e8a9ddd2c8483f5af98f7177c3af3cb6f47caf8d94ae9 02dba67e4a1f3680826172da15afb1a8ca85c7c5cc88900905c8dc8c328511b53e
    signer 2 nonce
    03e4f798da48a76eec1c9cc5ab7a880ffba201a5f064e627ec9cb0031d1d58fc51 03e06180315c5a522b7ec7c08b69dcd721c313c940819296d0a7ab8e8795ac1f00
    aggregate nonce
    0341432722c5cd0268d829c702cf0d1cbce57033eed201fd335191385227c3210c 03d377f2d258b64aadc0e16f26462323d701d286046a2ea93365656afd9875982b
  4. Session: b, R = R₁ + b·R₂, challenge e

    b
    85fece05d0d96a07f69aa244c027fd07f58ec3f57d7f986f5e283ff82883a1ae
    R
    03041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef09
    e
    ae965946b00879b405f551ddff7dba6b916bddc49b86abdec5c6e0614813e7e4
  5. Round 2: partial signatures, each verified

    signer 1 s
    b15d2cd3c3d22b04dae438ce653f6b4ecf042f42cfded7c41b64aaf9b4af53fb ✓
    signer 2 s
    6193d6ac61b354e9105bbdc8937a3454a6d705b6d57322a5a472a02ce99fcb64 ✓
  6. Sum them: an ordinary BIP 340 signature

    signature
    041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef0912f1038025857fedeb3ff696f8b99fa4bb2c5812f6095a2e0004ec99ce18de1e

    BIP 340 verification accepts it for Q and the message.

Source: BIP 327 sig_agg_vectors.json, case 0; recomputed by the tested MuSig2 model and verified with noble.

The four signature-aggregation vectors published with BIP 327, recomputed stage by stage. Every partial signature is checked, and the final signature passes BIP 340 verification.121516171819

In the second round each signer sends a partial signature: a single number, s = k₁ + b·k₂ + e·a·d, built from its two secret nonces, its coefficient and its secret key, with signs adjusted so the final nonce and key have even y. The BIP recommends that a signer verify its own result before sending it.20

Adding the partial signatures, plus a term for any tweaks, gives s, and the pair of R’s x coordinate and s is the signature: 64 bytes, verified exactly like any single-signer BIP 340 signature. For a key-path spend, the verifier never learns there was more than one signer.3518

The aggregate key can be tweaked along the way. A plain tweak derives child keys in the manner of BIP 32; an x-only tweak adds a Taproot commitment, so the same output can be spent either with the group’s signature or through a script path. Two of the figure’s vectors carry tweaks.19

The rule that cannot bend

MuSig2 has a requirement that single-signer BIP 340 signing does not. The secret nonces must come from a good random generator, and they must not be derived deterministically from the session, because an active adversary could then trick a signer into reusing one.21

Reuse is the catastrophic case. The BIP says Sign must not be executed twice with the same secret nonce, because the secret key can be extracted from the two partial signatures. It allows an implementation to overwrite the secret nonce with zeros once Sign has read it, and an all-zero nonce is rejected; this site’s model does exactly that, and its tests confirm a second signing attempt fails.22

Giving NonceGen the secret key, the aggregate key and the message when they are already known is recommended as defense in depth. It makes an accidental repeat of the random value much less harmful. The BIP is clear that this is only a last resort.23

Keeping a secret nonce between rounds is state, and state is where mistakes happen. The BIP allows one exception: a single signer may be stateless, waiting until it has everyone else’s nonces and the full session before generating its own and signing at once, and that signer may sign deterministically. The published deterministic-signing vectors are among those this site’s model reproduces.1624

The authors list what this costs: MuSig2 cannot generate nonces deterministically, and implementations have to handle signing state securely. Compared with MuSig-DN, they say MuSig2 is substantially less complex; compared with three-round schemes such as MuSig1, it needs only two rounds.10

When someone misbehaves

A disruptive signer can always make a session fail by sending garbage. MuSig2 makes such aborts identifiable. Each partial signature can be checked against that signer’s own key and nonce with PartialSigVerify, and the one that fails names the culprit. That guarantee holds under conditions the BIP spells out: messages arrive untampered, nonce aggregation is done honestly, and every partial signature is verified. Then an honest party’s failing check names exactly one malicious signer.1725

FIG. A14.3 Checking partial signatures
  • ✓ acceptedPublished valid partial signaturesigner 1 · 012abbcb52…e224fb · s·G = Re + e·a·g·P holds
  • ✕ rejectedWrong signature (which is equal to the negation of valid signature)signer 1 · fed54434ad…541c46 · s·G = Re + e·a·g·P does not hold
  • ✕ rejectedWrong signersigner 2 · 012abbcb52…e224fb · s·G = Re + e·a·g·P does not hold
  • ✕ rejectedSignature exceeds group sizesigner 1 · ffffffffff…364141 · s is not below the group order n
  • ✕ blamedInvalid pubnoncesigner 1 · 012abbcb52…e224fb · blames signer 1 for an invalid pubnonce
  • ✕ blamedInvalid pubkeysigner 1 · 012abbcb52…e224fb · blames signer 1 for an invalid pubkey

Cases from BIP 327 sign_verify_vectors.json; each verdict recomputed by the tested PartialSigVerify, and the build fails unless it matches the vector.

BIP 327’s partial-signature cases: a valid one, three that fail the check, and two that point at a bad public nonce or key.1617

Partial signatures are not signatures in their own right. The BIP points out that an adversary can forge one without the matching secret key; the check exists only to assign blame. What it does guarantee is the useful part: if every partial signature passes, their sum is a valid Schnorr signature.17

The rounds can also run through an untrusted aggregator that collects and combines everyone’s messages. A malicious aggregator can make the session fail, but cannot forge a signature, even working with all but one of the signers.26

The scheme’s limits are part of its definition. It is n-of-n: every signer who contributed a key must take part in signing, so it is not a threshold scheme. And it produces BIP 340 signatures only; it is not compatible with ECDSA, the signatures traditionally used in Bitcoin.227

Evidence

Each numbered marker in the text points here, and the ↩ links lead back to every place that cites an entry. Quotes are verbatim from the BIP files at commit 3a10b5b, including their wiki markup; links open the exact lines; the quoted text sits under each entry. Labels say what kind of statement each is: a rule, the author’s rationale, history, a test vector, or our own inference.

  1. ↩ History BIP 327 (Jonas Nick, Tim Ruffing, Elliott Jin) was assigned in 2022 and is recorded as Deployed; it is Informational.

    Quoted source text (1)

    Title: MuSig2 for BIP340-compatible Multi-Signatures Authors: Jonas Nick <jonasd.nick@gmail.com> Tim Ruffing <crypto@timruffing.de> Elliott Jin <elliott.jin@gmail.com> Status: Deployed Type: Informational Assigned: 2022-03-22

    BIP 327, lines 3–9
  2. ↩ a b Rule MuSig2 lets several signers create one aggregate public key and cooperatively produce ordinary Schnorr signatures under it; signing needs all of them: it is n-of-n, not a t-of-n threshold scheme.

    Quoted source text (1)

    MuSig2 is a multi-signature scheme that allows multiple signers to create a single aggregate public key and cooperatively create ordinary Schnorr signatures valid under the aggregate public key. Signing requires interaction between ''all'' signers involved in key aggregation. (MuSig2 is a ''n-of-n'' multi-signature scheme and not a ''t-of-n'' threshold-signature scheme.)

    BIP 327, lines 30–32
  3. ↩ a b c Author’s rationale The authors argue a MuSig2 output is essentially one key and one signature, more compact and cheaper to verify than an n-of-n OP_CHECKSIGADD policy, with no consensus limit on n, and indistinguishable on chain from a single-signer Taproot output.

    Quoted source text (3)

    The on-chain footprint of a MuSig2 Taproot output is essentially a single BIP340 public key, and a transaction spending the output only requires a single signature cooperatively produced by all signers. This is '''more compact''' and has '''lower verification cost''' than each signer providing an individual public key and signature

    BIP 327, lines 38–39

    As a side effect, the number ''n'' of signers is not limited by any consensus rules when using MuSig2.

    BIP 327, line 39

    MuSig2 Taproot outputs are indistinguishable for a blockchain observer from regular, single-signer Taproot outputs even though they are actually controlled by multiple signers.

    BIP 327, line 41
  4. ↩ Author’s rationale The authors' primary motivation is letting users of different software jointly control Taproot outputs, spent through the key path with a MuSig2 signature.

    Quoted source text (1)

    The primary motivation is to create a standard that allows users of different software projects to jointly control Taproot outputs ([https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki BIP341]). Such an output contains a public key which, in this case, would be the aggregate of all users' individual public keys. It can be spent using MuSig2 to produce a signature for the key-based spending path.

    BIP 327, lines 34–36
  5. ↩ a b c Rule The aggregate key is a BIP 340 x-only key and the final signature passes BIP 340 verification for it; the individual keys fed to aggregation are plain 33-byte compressed keys.

    Quoted source text (1)

    In this proposal, the aggregate public key is a BIP340 X-only public key, and the signature output at the end of the signing protocol is a BIP340 signature that passes BIP340 verification for the aggregate public key and a message. The individual public keys that are input to the key aggregation algorithm are ''plain'' public keys in compressed format.

    BIP 327, line 52
  6. ↩ Rule BIP 327 standardizes the MuSig2 multi-signature scheme, compatible with BIP 340 public keys and signatures, with tweaking for BIP 32 child keys and BIP 341 Taproot outputs.

    Quoted source text (1)

    This document proposes a standard for the [https://eprint.iacr.org/2020/1261.pdf MuSig2] multi-signature scheme. The standard is compatible with [https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki BIP340] public keys and signatures.

    BIP 327, lines 20–22
  7. ↩ a b c d Rule KeyAgg computes Q = a₁·P₁ + … + aᵤ·Pᵤ, where each coefficient aᵢ is a tagged hash of the hash of the whole key list and the key itself, except that the second distinct key gets coefficient 1 (the MuSig2* optimization, saving a point multiplication).

    Quoted source text (3)

    ** Let ''a<sub>i</sub> = KeyAggCoeffInternal(pk<sub>1..u</sub>, pk<sub>i</sub>, pk2)''. * Let ''Q = a<sub>1</sub>⋅P<sub>1</sub> + a<sub>2</sub>⋅P<sub>2</sub> + ... + a<sub>u</sub>⋅P<sub>u</sub>''

    BIP 327, lines 305–306

    * Let ''L = HashKeys(pk<sub>1..u</sub>)'' * If ''pk' = pk2'': ** Return 1 * Return ''int(hash<sub>KeyAgg coefficient</sub>(L || pk')) mod n''

    BIP 327, lines 334–337

    The optimization consists of assigning the constant key aggregation coefficient ''1'' to the second distinct key in the list of individual public keys to be aggregated (as well as to any key identical to this key).

    BIP 327, line 58
  8. ↩ a b Rule The aggregate key depends on the order of the keys; KeySort can sort them when the application has no canonical order.

    Quoted source text (1)

    The aggregate public key produced by ''KeyAgg'' (regardless of the type) depends on the order of the individual public keys. If the application does not have a canonical order of the signers, the individual public keys can be sorted with the ''KeySort'' algorithm to ensure that the aggregate public key is independent of the order of signers.

    BIP 327, lines 118–119
  9. ↩ a b c Test vector For BIP 327's three-key vector, the aggregate key differs when the same keys are given in reverse order, and neither equals the plain sum of the keys (checked by a test and at build time).

    Quoted source text (1)

    The aggregate public key produced by ''KeyAgg'' (regardless of the type) depends on the order of the individual public keys.

    BIP 327, line 118
  10. ↩ a b Author’s rationale The authors list its features: non-interactive key aggregation, two communication rounds (fewer than three-round schemes such as MuSig1), a security proof under the AOMDL assumption, and substantially lower complexity than MuSig-DN, at the cost of no deterministic nonces and signing state that must be handled securely.

    Quoted source text (4)

    * '''Simple Key Setup''': Key aggregation is non-interactive and fully compatible with BIP340 public keys. * '''Two Communication Rounds''': MuSig2 is faster in practice than previous three-round multi-signature schemes such as [https://eprint.iacr.org/2018/068.pdf MuSig1]

    BIP 327, lines 45–46

    MuSig2 has been [https://eprint.iacr.org/2020/1261.pdf proven existentially unforgeable] under the algebraic one-more discrete logarithm (AOMDL) assumption (instead of the discrete logarithm assumption required for single-signer Schnorr signatures).

    BIP 327, line 47

    However, this comes at the cost of having no ability to generate nonces deterministically and the requirement to securely handle signing state.

    BIP 327, line 48

    '''Low complexity''': MuSig2 has a substantially lower computational and implementation complexity than alternative schemes like [https://eprint.iacr.org/2020/1057 MuSig-DN].

    BIP 327, line 48
  11. ↩ Rule The same key may appear more than once; the algorithms handle it, and the BIP recommends omitting duplicate checks to simplify error handling, noting it is often impossible then to tell which signer is to blame. Applications may still reject duplicates, for example when one owner runs several signing devices.

    Quoted source text (3)

    The same individual public key is allowed to occur more than once in the input of ''KeyAgg'' and ''KeySort''. This is by design: All algorithms in this proposal handle multiple signers who (claim to) have identical individual public keys properly, and applications are not required to check for duplicate individual public keys. In fact, applications are recommended to omit checks for duplicate individual public keys in order to simplify error handling.

    BIP 327, lines 121–125

    Moreover, it is often impossible to tell at key aggregation which signer is to blame for the duplicate

    BIP 327, line 125

    While the algorithms in this proposal are able to handle duplicate individual public keys, there are scenarios where applications may choose to abort when encountering duplicates. For example, we can imagine a scenario where a single entity creates a MuSig2 setup with multiple signing devices.

    BIP 327, lines 128–131
  12. ↩ a b Rule Signing takes two broadcast rounds: each signer runs NonceGen and broadcasts a public nonce, which are aggregated with NonceAgg; then each runs Sign and broadcasts a partial signature, and PartialSigAgg combines them into a signature that passes BIP 340 verification if all were honest.

    Quoted source text (3)

    '''First broadcast round:''' The signers start the signing session by running ''NonceGen'' to compute ''secnonce'' and ''pubnonce''.

    BIP 327, lines 83–85

    Then, the signers broadcast their ''pubnonce'' to each other and run ''NonceAgg'' to compute an aggregate nonce.

    BIP 327, line 85

    '''Second broadcast round:''' At this point, every signer has the required data to sign, which, in the algorithms specified below, is stored in a data structure called [[#session-context|Session Context]]. Every signer computes a partial signature by running ''Sign'' with the secret signing key, the ''secnonce'' and the session context. Then, the signers broadcast their partial signatures to each other and run ''PartialSigAgg'' to obtain the final signature. If all signers behaved honestly, the result passes [https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki BIP340] verification.

    BIP 327, lines 87–91
  13. ↩ Author’s rationale Each signer's nonce is two elliptic curve points; the authors chose the two-point variant, whose proof uses the random oracle plus algebraic group model.

    Quoted source text (2)

    In this proposal, each signer's nonce consists of two elliptic curve points.

    BIP 327, line 59

    and applies to an optimized scheme variant where the signers' nonces consist of only two points. This proposal uses the latter, optimized scheme variant.

    BIP 327, lines 757–759
  14. ↩ Rule The first round, exchanging nonces, can happen before the message or the exact set of signers is known.

    Quoted source text (1)

    The first communication round, exchanging the nonces, can happen before the message or the exact set of signers is determined.

    BIP 327, line 54
  15. ↩ a b Rule Session values: the nonce coefficient b is a tagged hash of the aggregate nonce, the aggregate key and the message; the final nonce is R = R₁ + b·R₂; and e is the BIP 340 challenge for R, Q and the message. If R₁ + b·R₂ is the point at infinity, which signals a dishonest aggregator or signer, R is set to G so that signing continues and the culprit is revealed when partial signatures are verified.

    Quoted source text (4)

    * Let ''b = int(hash<sub>MuSig/noncecoef</sub>(aggnonce || xbytes(Q) || m)) mod n''

    BIP 327, lines 427–434

    * Let ''R' = R<sub>1</sub> + b⋅R<sub>2</sub>'' * If ''is_infinite(R'): ** Let final nonce ''R = G''

    BIP 327, lines 429–431

    * Let ''e = int(hash<sub>BIP0340/challenge</sub>(xbytes(R) || xbytes(Q) || m)) mod n''

    BIP 327, line 434

    If the nonce aggregator provides ''aggnonce = bytes(33,0) || bytes(33,0)'', either the nonce aggregator is dishonest or there is at least one dishonest signer (except with negligible probability). If signing aborted in this case, it would be impossible to determine who is dishonest. Therefore, signing continues so that the culprit is revealed when collecting and verifying partial signatures.

    BIP 327, lines 738–740
  16. ↩ a b c d Test vector This site's MuSig2 model, a transcription of BIP 327's reference code on audited curve arithmetic, reproduces every case in the BIP's eight JSON vector files, including the error cases with the same blamed signer or message; the four published signature-aggregation sessions aggregate to the published signatures, which noble's BIP 340 verifier accepts.

    Quoted source text (1)

    === Test Vectors and Reference Code ===

    BIP 327, lines 524–526
  17. ↩ a b c d Rule PartialSigVerify checks s·G = Re + e·a·g′·P for one signer, using that signer's own public nonce; its only purpose is identifiable aborts. Partial signatures are not signatures and can be forged, but if all verify, the aggregate is a valid Schnorr signature.

    Quoted source text (3)

    * Fail if ''s⋅G &ne; Re<sub>⁎</sub> + e⋅a⋅g'⋅P''

    BIP 327, line 504

    The only purpose of the algorithm ''PartialSigVerify'' is to ensure identifiable aborts, and it is not necessary to use it when identifiable aborts are not desired. In particular, partial signatures are ''not'' signatures. An adversary can forge a partial signature, i.e., create a partial signature without knowing the secret key for the claimed individual public key.

    BIP 327, lines 182–185

    However, if ''PartialSigVerify'' succeeds for all partial signatures then ''PartialSigAgg'' will return a valid Schnorr signature.

    BIP 327, line 185
  18. ↩ a b Rule PartialSigAgg adds the partial signatures and e·g·tacc, the tweak term, and returns xbytes(R) followed by the 32-byte sum: a 64-byte signature.

    Quoted source text (1)

    * Let ''s = s<sub>1</sub> + ... + s<sub>u</sub> + e⋅g⋅tacc mod n'' * Return ''sig = ''xbytes(R) || bytes(32, s)''

    BIP 327, lines 520–521
  19. ↩ a b Rule Plain tweaking derives child aggregate keys as in BIP 32; x-only tweaking adds a BIP 341 Taproot commitment, so an output can be spent with a MuSig2 signature or through a script path.

    Quoted source text (1)

    Plain tweaking can be used to derive child public keys from an aggregate public key using [https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki BIP32]. On the other hand, X-only tweaking is required for Taproot tweaking per [https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki BIP341]. A Taproot-tweaked public key commits to a ''script path'', allowing users to create transaction outputs that are spendable either with a MuSig2 multi-signature or by providing inputs that satisfy the script path.

    BIP 327, lines 201–203
  20. ↩ Rule Each partial signature is s = k₁ + b·k₂ + e·a·d mod n, with the secret nonces negated if R has odd y and the key negated as Q and the tweaks require; the BIP recommends that a signer verify its own partial signature before releasing it, a check that can be omitted if too costly.

    Quoted source text (4)

    * Let ''k<sub>1</sub> = k<sub>1</sub>', k<sub>2</sub> = k<sub>2</sub>' '' if ''has_even_y(R)'', otherwise let ''k<sub>1</sub> = n - k<sub>1</sub>', k<sub>2</sub> = n - k<sub>2</sub>' ''

    BIP 327, line 457

    * Let ''s = (k<sub>1</sub> + b⋅k<sub>2</sub> + e⋅a⋅d) mod n''

    BIP 327, line 466

    * If ''PartialSigVerifyInternal(psig, pubnonce, pk, session_ctx)'' (see below) returns failure, fail

    BIP 327, line 469

    It is recommended but can be omitted if the computation cost is prohibitive.

    BIP 327, line 469
  21. ↩ Rule NonceGen must have a high-quality random generator; unlike BIP 340 signing, the nonces must not be derived deterministically from the session parameters, or active adversaries can trick a signer into reusing one.

    Quoted source text (1)

    '''IMPORTANT''': ''NonceGen'' must have access to a high-quality random generator to draw an unbiased, uniformly random value ''rand' ''. In contrast to BIP340 signing, the values ''k<sub>1</sub>'' and ''k<sub>2</sub>'' '''must not be derived deterministically''' from the session parameters because otherwise active adversaries can [https://medium.com/blockstream/musig-dn-schnorr-multisignatures-with-verifiably-deterministic-nonces-27424b5df9d6#e3b6 trick the victim into reusing a nonce].

    BIP 327, lines 135–136
  22. ↩ a b Rule Sign must not be executed twice with the same secret nonce, since the secret key can then be extracted from the two partial signatures; implementations may erase the secret nonce after use, and an all-zero one is invalid.

    Quoted source text (1)

    '''IMPORTANT''': The ''Sign'' algorithm must '''not''' be executed twice with the same ''secnonce''. Otherwise, it is possible to extract the secret signing key from the two partial signatures output by the two executions of ''Sign''. To avoid accidental reuse of ''secnonce'', an implementation may securely erase the ''secnonce'' argument by overwriting it with 64 zero bytes after it has been read by ''Sign''. A ''secnonce'' consisting of only zero bytes is invalid for ''Sign'' and will cause it to fail.

    BIP 327, lines 95–98
  23. ↩ Rule Passing the secret key, aggregate key and message to NonceGen when known is recommended as defense in depth, but only as a last resort against a bad random value.

    Quoted source text (2)

    Therefore, it is recommended to provide the optional arguments ''sk'', ''aggpk'', and ''m'' if these session parameters are already determined during nonce generation.

    BIP 327, line 140

    However, the protection provided by the optional arguments should only be viewed as a last resort.

    BIP 327, line 143
  24. ↩ Rule Signers are normally stateful, keeping the secret nonce between rounds, but one signer can be stateless: it waits for everyone else's nonces and the session parameters, then generates its nonce and signs at once, and may sign deterministically.

    Quoted source text (2)

    In general, MuSig2 signers are stateful in the sense that they first generate ''secnonce'' and then need to store it until they receive the other signers' ''pubnonces'' or the ''aggnonce''. However, it is possible for one of the signers to be stateless.

    BIP 327, lines 157–161

    Stateless signers may want to consider signing deterministically (see [[#modifications-to-nonce-generation|Modifications to Nonce Generation]]) to remove the reliance on the random number generator in the ''NonceGen'' algorithm.

    BIP 327, line 161
  25. ↩ Rule Aborts are identifiable when contributions are not tampered with, nonce aggregation is honest, and every partial signature is verified; then an honest party's failing algorithm names exactly one malicious signer.

    Quoted source text (2)

    Aborts are identifiable for an honest party if the following conditions hold in a signing session: * The contributions received from all signers have not been tampered with (e.g., because they were sent over authenticated connections). * Nonce aggregation is performed honestly (e.g., because the honest signer performs nonce aggregation on its own or because the aggregator is trusted). * The partial signatures received from all signers are verified using the algorithm ''PartialSigVerify''.

    BIP 327, lines 168–173

    then the algorithm run by the honest party will output the index of exactly one malicious signer.

    BIP 327, line 173
  26. ↩ Rule An untrusted aggregator can collect and combine nonces and partial signatures; a malicious one can make the session fail but cannot forge a signature, even colluding with all but one signer.

    Quoted source text (1)

    A malicious aggregator can force the signing session to fail to produce a valid Schnorr signature but cannot negatively affect the unforgeability of the scheme, i.e., even a malicious aggregator colluding with all but one signer cannot forge a signature.

    BIP 327, line 93
  27. ↩ Rule MuSig2 is compatible with BIP 340, not with the ECDSA signatures traditionally used in Bitcoin.

    Quoted source text (1)

    This document proposes a standard for the MuSig2 multi-signature scheme that is compatible with [https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki BIP340]. MuSig2 is ''not'' compatible with ECDSA signatures traditionally used in Bitcoin.

    BIP 327, lines 774–775