Schnorr Multi Signatures
We implement the SpeedyMuSig protocol by E. Crites, C. Komlo and M. Maller described in ePrint 2021/1375 in Fig. 7. Given a group of signers with public/private key pairs , the protocol allows the group to generate a Schnorr signature for an aggregate public key derived from the group's public keys. We use it to generate Schnorr signatures over aggregated spending keys, which are used inside of circuits to validate the public inputs.
The Schnorr signatures produced are defined over the Grumpkin curve, using BLAKE2s as random-oracle to derive Fiat-Shamir challenges.
Protocol description
SpeedyMuSig is a two round multi-party computation.
Setup
Each user with signing key-pair generates a Proof of Possession which is a variant of a Schnorr proof of knowledge of the discrete logarithm of a group element. Its purpose is to attest that actually knows the secret key associated to the public key such that .
The users share their public keys and associated proofs , and verify the proofs. If all checks succeed, the aggregated public key can be computed as .
The proof of possession implementation follows the specification in the paper and can be instantiated over any curve and hash function used as random oracle. We deviate slightly from the paper since we implement the signature variant where we send (defined as (e,s)
in the code) instead of . These representations are equivalent.
We disallow the usage of the same hash function for both the signature scheme and the proof of knowledge (and later the nonce generation). This is done to ensure that all three hash functions are properly domain separated. To maintain compatibility with the existing circuits, we use BLAKE2s for without domain separation. This means that we cannot use the same function for the other two hash functions, even if we include prefixes for the latter ones. We therefore use the Keccak function, with proper domain separation strings, for and . In both functions, we also pass in the group generator as first argument. We do not apply this to the function as we maintain backwards compatibility with the existing circuit.
Proofs of possession are deterministic, with the nonce derived in a similar was as in our Schnorr implementation using HMAC.
There is a slight bias in the generation of the Fiat-Shamir challenge due to the modular reduction by .
Round 1
Each party generates a random secret nonce pair which is saves in its private state. The parties broadcast the corresponding commitments where and .
This round can be performed in advance and multiple times in order to generate several sets of commitments, so that subsequent signing can be done faster.
Round 2
After receiving a list of commitments from all parties, each party computes their additive share of the final signature's component.
The nonce challenge is computed slightly differently as in the paper, in order to prevent accidental collisions. Indeed, since the length of the message is variable, we add both a fixed prefix and suffix so that the message cannot be interpreted as the nonce from another signing session. We have (we interpret as a field element by reducing modulo , noting the slight bias from the uniform distribution).
The Schnorr challenge is then computed as , which is used to derive the final signature's Fiat-Shamir challenge (using the different hash function).
Each user then computes . At this point, these shares can simply be sent to a single trusted "signature coordinator", along with the public outputs from the first two rounds, who can compute the final signature .
Signature Aggregation
Once all parties have produced their round 2 output , they can either broadcast this value to all other parties so that everyone can produce the final signature, or they can send it to a central coordinator who will produce the final signature.
Given the set of round 1 nonce commitments , and the signature shares , the final signature is computed as follows:
- validate all public keys with their proofs of possession.
- validate round 1 and round 2 messages
- recompute aggregate public key
- recompute values and derive the signature's Fiat-Shamir challenge
- compute the component of the signature as .
The final signature is as defined by the single party Schnorr signature algorithm implementation.
Known issues
Bias in Fiat-Shamir challenges
When the protocol is instantiated over an elliptic curve whose subgroup's order is far from (the range of the output of our hash functions), the field element we obtain from the Fiat-Shamir transform will not exactly follow the uniform distribution over . Applying the modular reduction over the 256-bit hash output (which we assume is uniform) induces a small bias in favor of "smaller" field elements. Therefore, the field element does not actually follow a uniform distribution over .
Since fixing this issue would require circuit changes, we chose to accept this slight bias.
Usage notes
Non-deterministic signatures
Signatures produced with this protocol cannot be made deterministic as there is no easy way of ensuring that all participants are generating their shares of the nonce deterministically. While deterministic signatures are handy in the single party case where the signer may not have access to strong randomness (in the browser for example), multisignature nonces essentially combine each signer's randomness using the unpredictable output of a hash function.
Message ordering
When the parties are broadcasting the round 1 nonce commitements , the signature will only succeed if all parties agree on the same ordering. Otherwise, parties would end up with different values.