BIP 0327
How can many signers share one key?
Everyone in the group must sign. The blockchain receives one ordinary Schnorr signature, with no list of the people who made it.
Several people can share control of a coin without publishing a signature from each person. MuSig2 combines their public keys into one key. When they agree to spend, they exchange messages and combine their contributions into one signature.1234
Every member of that group must participate. MuSig2 is an n-of-n scheme, not a threshold scheme in which some members can be absent. Its result is an ordinary BIP 340 signature: a verifier checks it just as it would a signature made by one signer.25
Source details
This chapter is an independent explanation, not the proposal itself. Preamble fields are shown as the pinned files record them, without author e-mail addresses. Status is the proposal’s own field. It is 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
Fig. A14.1 Many participants. One signature.
Published key, signature and test message
- Key (x-only)
f68803d6235df99eb72f251d832b52029a64ae2c195a15823bd85f9577478408- Signature
041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef0912f1038025857fedeb3ff696f8b99fa4bb2c5812f6095a2e0004ec99ce18de1e- Test message
599c67ea410d005b9da90817cf03ed3b1c868e4da4edf00a5880b0082c237869
Agree on a key list
Anyone with the full list of public keys can compute the aggregate key. They do not need the signers’ secret keys or an interactive round. But simply adding the public keys is not enough: MuSig2 weights them with coefficients derived from the list.789
Fig. A14.2 Not a plain sum
Exact values
- P1
02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9- P2
03dff1d77f2a671c5f36183726db2341be58feae1da2deced843240f7b502ba659- P3
023590a94e768f8e1815c2f24b4d80a8e3149316c3518ce7b7ad338368d038ca66- Order 1: coefficient of P1
ad0537c883813849e3b95ce5db1d45eb25cc5fae197c4e8759719065932aa183- Order 1: coefficient of P2
0000000000000000000000000000000000000000000000000000000000000001- Order 1: coefficient of P3
f45bb025038e68f050ce4dbf8c63e613678892e2a3e930780afe6293376005c6- Q1 (x-only)
90539eede565f5d054f32cc0c220126889ed1e5d193baf15aef344fe59d4610c- Order 2: coefficient of P3
fe377513ee64aa002b8453468abf9323063f1e5f944d3acbaba8e4b8310ff1e6- Order 2: coefficient of P2
0000000000000000000000000000000000000000000000000000000000000001- Order 2: coefficient of P1
5ccb63d1d231453d642389438f75dbcf860cf91a119d3aaa0ed831453a85a5ff- Q2 (x-only)
6204de8b083426dc6eaf9502d27024d53fc826bf7d2012148a0575435df54b2b- x of P1 + P2 + P3
eb078e96f15991503b6ed678df191a9b252759cc636e22fa32c618e5eff8cdc5
Order matters. Reverse the same key list and the aggregate changes. Applications without a natural ordering can use KeySort so everyone starts from the same list.910
The aggregation equation and the coefficient exception
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.578
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
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
Exchange nonces, then signature shares
A nonce is temporary signing data that must not be reused for another signature. Each signer generates a secret nonce and shares its public part, which in MuSig2 is two points rather than one. The first round exchanges and aggregates these public nonces. This round can happen before the message or the final group of signers is known.4121314
Once the message is known, each signer computes the same session values from the aggregate nonce, aggregate key and message. In the second round, each sends a partial signature. The BIP recommends checking one’s own partial signature before sending it.1516
The partial signatures are added, with an adjustment for any key tweaks. Together with the nonce point’s x coordinate, the sum forms a 64-byte signature checked by an ordinary BIP 340 verifier. The key-path witness contains no participant list.3517
Step through the first signing session from the shared key list to the finished signature. Watch each signer’s contribution arrive, then see them combine. The result can be checked as an ordinary Schnorr signature.45617
Fig. A14.3 A signing session, round by round
Static view: the first vector with every stage and the aggregated values shown. With JavaScript you can choose among 4 published vectors, step through the rounds and hide the aggregated values.
Stage 5 of 5, Aggregate signature. Add the partial signatures and the tweak adjustment. Pair the result with R’s x coordinate to form the 64-byte signature. BIP 340 verification accepts it.
Exact values for this stage
2 signers. Stage 5 of 5: Aggregate signature. Signer 1: public key 03935f972da013f80ae011890fa89b67a27b7be6ccb24d3274d18b2d4067f261a9; coefficient a1482da489d1a3d3616cbd2b055eb477593f24242e2662ad6342b22549485be9; public nonce 036e5ee6e28824029fea3e8a9ddd2c8483f5af98f7177c3af3cb6f47caf8d94ae9 and 02dba67e4a1f3680826172da15afb1a8ca85c7c5cc88900905c8dc8c328511b53e; partial signature b15d2cd3c3d22b04dae438ce653f6b4ecf042f42cfded7c41b64aaf9b4af53fb, which passes PartialSigVerify. Signer 2: public key 02d2dc6f5df7c56acf38c7fa0ae7a759ae30e19b37359dfde015872324c7ef6e05; coefficient 1 (the second distinct key); public nonce 03e4f798da48a76eec1c9cc5ab7a880ffba201a5f064e627ec9cb0031d1d58fc51 and 03e06180315c5a522b7ec7c08b69dcd721c313c940819296d0a7ab8e8795ac1f00; partial signature 6193d6ac61b354e9105bbdc8937a3454a6d705b6d57322a5a472a02ce99fcb64, which passes PartialSigVerify. Aggregate key Q f68803d6235df99eb72f251d832b52029a64ae2c195a15823bd85f9577478408. Aggregate nonce 0341432722c5cd0268d829c702cf0d1cbce57033eed201fd335191385227c3210c 03d377f2d258b64aadc0e16f26462323d701d286046a2ea93365656afd9875982b. b 85fece05d0d96a07f69aa244c027fd07f58ec3f57d7f986f5e283ff82883a1ae; R 03041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef09, odd y, so every signer negates its secret nonces; e ae965946b00879b405f551ddff7dba6b916bddc49b86abdec5c6e0614813e7e4. Signature 041da22223ce65c92c9a0d6c2cac828aaf1eee56304fec371ddf91ebb2b9ef0912f1038025857fedeb3ff696f8b99fa4bb2c5812f6095a2e0004ec99ce18de1e; BIP 340 verification accepts it for key f68803d6235df99eb72f251d832b52029a64ae2c195a15823bd85f9577478408 and message 599c67ea410d005b9da90817cf03ed3b1c868e4da4edf00a5880b0082c237869.
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, every partial signature passes PartialSigVerify, and noble’s BIP 340 verifier accepts the signature.
The session equations and the exceptional nonce
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₂, where R₁ and R₂ are the two points of the aggregate nonce. The challenge 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.615
In the second round each signer sends a partial signature. It is a single number, s = k₁ + b·k₂ + e·a·d, built from its two secret nonces, its coefficient and its secret key. Signs are adjusted so the final nonce and key have even y. The BIP recommends that a signer verify its own result before sending it.16
Child-key and Taproot tweaks
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 vectors in Fig. A14.3 carry tweaks.19
Use a secret nonce once
MuSig2 has a requirement that single-signer BIP 340 signing does not. The secret nonces must come from a good random generator. They must not be derived deterministically from the session, because an active adversary could then trick a signer into reusing one.20
Never run Sign twice with the same secret nonce. BIP 327 states that two partial signatures from one nonce make it possible to extract the signer’s secret key.14
Two partial signatures made with the same secret nonce can expose the signer’s secret key. BIP 327 allows Sign to erase the secret nonce after reading it, and requires an all-zero nonce to be rejected. The illustrated implementation uses that rule to refuse a second signing attempt.14
Fig. A14.4 A nonce is used once
NonceGen can also take the secret key, aggregate key and message when they are already known. The BIP recommends these extra inputs as defense in depth against accidental repetition of the random value. They do not replace fresh randomness.21
The exception for one stateless signer
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. That signer may sign deterministically. The published deterministic-signing vectors are among those this site’s model reproduces.622
Why two rounds, and why Taproot
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.8
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.2323
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.13524
MuSig2 produces BIP 340 signatures only. It does not work with ECDSA, and it cannot make progress without every signer whose key contributed to the aggregate.225
Find the contribution that failed
A participant can stop a session by sending a bad contribution. Checking each partial signature helps identify which participant caused the failure. That conclusion depends on the BIP’s conditions: messages must arrive untampered, nonce aggregation must be honest, and every partial signature must be checked.1826
Fig. A14.5 Checking partial signatures
Exact values
- Published valid partial signature (signer 1)
012abbcb52b3016ac03ad82395a1a415c48b93def78718e62a7a90052fe224fb- Wrong signature (which is equal to the negation of valid signature) (signer 1)
fed54434ad4cfe953fc527dc6a5e5be8f6234907b7c187559557ce87a0541c46- Wrong signer (signer 2)
012abbcb52b3016ac03ad82395a1a415c48b93def78718e62a7a90052fe224fb- Signature exceeds group size (signer 1)
fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141- Invalid pubnonce (signer 1)
012abbcb52b3016ac03ad82395a1a415c48b93def78718e62a7a90052fe224fb- Invalid pubkey (signer 1)
012abbcb52b3016ac03ad82395a1a415c48b93def78718e62a7a90052fe224fb
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. If every partial signature passes, their sum is a valid Schnorr signature.18
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.27
The signers cooperate off chain so that the chain needs only their aggregate key and ordinary Schnorr signature. The compact result still depends on every member taking part.235
Evidence
Each numbered marker in the text points here, and the ↩ links lead back to the text. Quotes are verbatim
from the BIP files at commit 3a10b5b, wiki markup
included. Links open the exact lines. Labels say what kind of statement each entry is: a rule, the
author’s rationale, history, a test vector, or our own inference.
-
↩ a b 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.
-
↩ a b c d e 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.)
-
↩ a b c d e f Author’s rationale The authors argue a MuSig2 Taproot output publishes one key, and spending it requires one cooperatively produced 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.
BIP 327 L38–39 BIP 327 L39 BIP 327 L41
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
As a side effect, the number ''n'' of signers is not limited by any consensus rules when using MuSig2.
MuSig2 Taproot outputs are indistinguishable for a blockchain observer from regular, single-signer Taproot outputs even though they are actually controlled by multiple signers.
-
↩ a b c d 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.
BIP 327 L83–85 BIP 327 L85 BIP 327 L87–91
Quoted source text (3)
'''First broadcast round:''' The signers start the signing session by running ''NonceGen'' to compute ''secnonce'' and ''pubnonce''.
Then, the signers broadcast their ''pubnonce'' to each other and run ''NonceAgg'' to compute an aggregate nonce.
'''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.
-
↩ a b c d e f g 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.
-
↩ a b c d e f 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 ===
-
↩ a b c d e 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).
BIP 327 L305–306 BIP 327 L334–337 BIP 327 L58
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>''
* Let ''L = HashKeys(pk<sub>1..u</sub>)'' * If ''pk' = pk2'': ** Return 1 * Return ''int(hash<sub>KeyAgg coefficient</sub>(L || pk')) mod n''
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).
-
↩ a b c 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.
BIP 327 L45–46 BIP 327 L47 BIP 327 L48 BIP 327 L48
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]
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).
However, this comes at the cost of having no ability to generate nonces deterministically and the requirement to securely handle signing state.
'''Low complexity''': MuSig2 has a substantially lower computational and implementation complexity than alternative schemes like [https://eprint.iacr.org/2020/1057 MuSig-DN].
-
↩ a b c d 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.
-
↩ 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.
-
↩ 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.
BIP 327 L121–125 BIP 327 L125 BIP 327 L128–131
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.
Moreover, it is often impossible to tell at key aggregation which signer is to blame for the duplicate
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.
-
↩ 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.
and applies to an optimized scheme variant where the signers' nonces consist of only two points. This proposal uses the latter, optimized scheme variant.
-
↩ 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.
-
↩ a b c d 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.
-
↩ a b c 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.
BIP 327 L427–434 BIP 327 L429–431 BIP 327 L434 BIP 327 L738–740
Quoted source text (4)
* Let ''b = int(hash<sub>MuSig/noncecoef</sub>(aggnonce || xbytes(Q) || m)) mod n''
* Let ''R' = R<sub>1</sub> + b⋅R<sub>2</sub>'' * If ''is_infinite(R'): ** Let final nonce ''R = G''
* Let ''e = int(hash<sub>BIP0340/challenge</sub>(xbytes(R) || xbytes(Q) || m)) mod n''
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.
-
↩ a b 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.
BIP 327 L457 BIP 327 L466 BIP 327 L469 BIP 327 L469
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>' ''
* Let ''s = (k<sub>1</sub> + b⋅k<sub>2</sub> + e⋅a⋅d) mod n''
* If ''PartialSigVerifyInternal(psig, pubnonce, pk, session_ctx)'' (see below) returns failure, fail
It is recommended but can be omitted if the computation cost is prohibitive.
-
↩ a b c 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)''
-
↩ 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.
BIP 327 L504 BIP 327 L182–185 BIP 327 L185
Quoted source text (3)
* Fail if ''s⋅G ≠ Re<sub>⁎</sub> + e⋅a⋅g'⋅P''
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.
However, if ''PartialSigVerify'' succeeds for all partial signatures then ''PartialSigAgg'' will return a valid Schnorr signature.
-
↩ 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.
-
↩ 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].
-
↩ 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.
However, the protection provided by the optional arguments should only be viewed as a last resort.
-
↩ 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.
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.
-
↩ 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
-
↩ 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.
-
↩ 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.
-
↩ 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''.
then the algorithm run by the honest party will output the index of exactly one malicious signer.
-
↩ 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.