This document summarizes requirements for a nested MuSig or nested FROST scheme. In a nested multi- or threshold-signature scheme the signers are organized in a tree instead of a multiset. It is important to note that the ideas and concepts presented in this document are a collective effort, drawing from the knowledge and expertise of various individuals.
- "multisig" Lightning where a node is split into multiple sub-signers. For example, the signing policy of the node could be 2-of-2 or 2-of-3.
- A "federation" consisting of multiple parties that jointly operate a Lightning node (e.g. Fedimint).
Here we'd have a t-of-n signing policy for potentially large
t
andn
. Also we have thatt > 2/3*n
because the federation would presumably run some asynchronous Byzantine failure tolerant consensus protocol.
Since all applications have trees of height 2, we use the term "multisig signers" to refer to the signers in the deepest level of the tree unless noted otherwise.
Otherwise, it wouldn't be very attractive to run a multisig Lightning node as it decreases the availability compared to the singlesig case. In the case of a n-of-n signing policy for a multisig Lightning node, this requirement implies that the signers do not only have backups but also reliable failover. T-of-n policies will benefit from using ROAST for robustness.
For all known applications, the signing tree has height two: there's a 2-of-2 on the top level and each of the two keys can be some t-of-n aggregate. Would it useful if each of those keys is again an aggregate? If not, the nesting scheme and security proof can be simplified.
Sequential signing is when there's always only one nonce "in-flight" for the signer, i.e., the signer does not broadcast a new nonce before having signed with an already broadcasted nonce. Sequential signing corresponds to the following sequence:
nonce <- NonceGen
Broadcast nonce
sig <- Sign(seckey, nonce, ...)
nonce <- NonceGen
Broadcast nonce
sig <- Sign(seckey, nonce, ...)
...
Concurrent signing is when there are multiple nonces in-flight, for example:
nonce1 <- NonceGen
Broadcast nonce
nonce2 <- NonceGen
Broadcast nonce2
sig1 <- Sign(seckey, nonce1, ...)
sig2 <- Sign(seckey, nonce2, ...)
Concurrent signing is also in effect when the signer signs for a differently tweaked seckey with multiple in-flight nonces (if the tweak is known to the attacker). For example, the following is not sequential signing:
nonce1 <- NonceGen
Broadcast nonce1
nonce2 <- NonceGen
Broadcast nonce2
sig1 <- Sign(seckey1, nonce1, ...)
sig2 <- Sign(seckey2, nonce2, ...)
if seckey1 = tweak(seckey, tweak1)
and seckey2 = tweak(seckey, tweak2)
.
But it would be sequential signing if the seckey1
and seckey2
were each drawn independently uniformly at random.
If multisig Lightning only required sequential signing, the signing scheme and security proof would be significantly simpler.
Lightning has an additional important requirement: After sending the signature nonce of the multisig to the channel counterparty and the counterparty replies with a partial signature, the multisig signers store the partial signature and may only complete it much later. At that later point, the local signers must be able to complete the signature. We can't generally guarantee this in FROST because one of the multisig signers who contributed to the nonce can just refuse to sign. N-of-n MuSig with good backups/failover obviously does not suffer from this problem. Delayed signing may not be a requirement in eltoo.
It is not possible that the signers immediately complete the partial signature from the counterparty and store it until needed. The reason is that this signature is only needed in some circumstances and can lead to loss of funds when used in the wrong circumstances. In particular, a malicious multisig signer could use the completed signature to broadcast a revoked state.
On the other hand, the multisig signers' must always be able to complete the signature. They cannot just "close the channel" if that fails. One could argue that in this regard multisig-LN is more fragile than singlesig, for which it is already difficult enough to broadcast transactions in a timely manner.
There are, however, a couple of potential solutions to this problem:
- It would be possible to use distributed key generation (DKG) for the nonce such that
t
-of-n
can reconstruct the nonce. This would then be similar to the classic Stinson & Strobl (7 round?) threshold signature protocol. At nonce generation time it requires that all signers are online and a secure broadcast channel (a.k.a reliable broadcast) between them. - Another possibility is to have the signers verifiably encrypt their nonces to each other. Assume a 2-of-3 where one signer is offline at nonce generation and signing time. The two online signers send an encrypted secret nonce to the other online signer, such that the ciphertext can be decrypted by the offline signer and can be verified to be the encryption of the sending signer's public partial nonce. The online signers ACK the channel counterparty's signature only when they've received the (valid) encrypted nonce. Once the offline signer comes online and one of the online signers goes down, the previously offline signer receives the ciphertext from the remaining functioning online signer and decrypts it. This allows them to produce a signature. The communcation complexity of this approach grows exponentially with larger
t
andn
. There are a couple of possible options for verifiable encryption:- Classic cut-and-choose which is rather inefficient (maybe ~100ms per verifiable encryption for prover and verifier).
- Batched cut-and-choose: 100 verifiable encryptions at the 128-bit security level it takes around 750ms for the prover and 250ms for the verifier
- Juggling: This could require very roughly and unoptimized about
256*( El-Gamal-{encryption,decryption}, rangeproof{,-verify}, signature{,-verify}, scalar_mul)
for the prover {verifier}. Benchmarks indicate 138ms for each verifiable encryption, which would be very slow.
- It may be possible to ignore the delayed signing requirement by having the multisig signers sign immediately when receiving the partial signature from the counterparty but don't output the plain signature. Instead they encrypt the signature to the t-of-n while signing. To do this, the multisig signers would create an adaptor signature that can be combined with the counterparty's partial signature after adapting it with the discrete log
t
of some adaptorT
. This adaptor would need to be created through some distributed key generation protocol that will allow t-of-n multisig signers to recovert
. But then it appears as if there's no benefit of this technique over running a DKG for the nonce. - Another option for a t-of-n is to send all partial nonces from all
n
signers to the other side of the LN channel, who replies with one signature for each subset oft
partial nonces, (requiringn
chooset
many signatures in total). Then every subset oft
signers has a signature it can complete at a later time. This requires all signers to be online at nonce generation time. Besides the possible blowup of communication complexity for largen
, the downside is that this protocol would "leak into the state machine": the other side of the channel must be aware oft
andn
. - If we accept that the protocol leaks into the Lightning state machine, then another option is to replace the t-of-n FROST with a n-of-n MuSig but additionally commit to a backup script path that allows spending with the t-of-n. But this is far from simple and "requires significantly extending the Lightning protocol".
The inconvenience of having all signers be present at nonce generation time can be mitigated by pregenerating nonces during key setup. Moreover, since the signers are only going to produce one delayed signature per channel, it should be possible to use just use a single nonce for all delayed signatures in a channel. This requires exceptional care to avoid reusing nonces.
There's a problem with above solutions (including Stinson-Strobl and verifiable encryption) in a 2-of-3 that's somewhat related to the potential BFT requirement.
If an honest signer A
goes offline and comes online again, a malicious signer M
who stayed online may refuse to relay the nonces which were committed to while A
was offline (or verifiable encryptions thereof) to A
.
Also, M
could try to send verifiable encryptions of nonces that have already been used in signing.
If the signers would know which size t
subset of n
signers would produce a signature before generating the nonce, then the nested signing scheme would (presumably) end up being slightly simpler (because otherwise the signers in the multisig need an extra local nonce coefficient b_extra
for concurrent security).
In Lightning, the answer to this question according to the Delayed Signing requirement seems to be no and the same answer holds for Fedimint.
Does the Lightning application need Byzantine failure tolerant (BFT) consensus between the multisig signers?
To see why this might be necessary, consider the following scenario where the owner of the 2-of-3 Lightning multisig wants to open a channel. To do that, one of the multisig signers proposes a transaction to the other signers. If that proposer is malicious it could create two transactions with non-overlapping inputs, send transaction 1 to cosigner 1 and transaction 2 to cosigner 2 for signing. This results in two valid, non-conflicting transactions that can end up on chain even though the owner only requested a single channel opening. This couldn't happen if the signers would run a protocol that establishes consensus on the transactions to sign.
Note that in this particular example, the signers could use some sort of deterministic coin selection to make sure that the two transactions would conflict because they share inputs. However, it's possible to imagine scenarios in LN where using the blockchain to prevent Byzantine failures does not work. For example, the malicious signer may control a different node from which it tries to send a payment through the multisig node. Perhaps the malicious signer can trick one cosigner to route it through channel 1 and the other cosigner to route through channel 2, which would result in two outbound HTLCs for just single inbound HTLC. This would be prevented if the signers had consensus on their state. Maybe there are other very subtle issues that arise if they don't.
Another way to state the problem is to look at a 2-of-3 where honest signers go offline at unfortunate times. Assume a scenario where we have honest signers A and B and malicious signer M. If A is offline for a while and comes online at the same time as B goes offline, then M can lie to A about what the latest state is. In this case, A could refuse to sign unless it can be synced to the latest state from two other signers.
If BFT consensus is necessary, then 2-of-3 doesn't work because it's impossible in an asynchronous setting. For f
faulty signers need n=3*f+1
and t=f+1
, so for f=1
we need 2-of-4 threshold signing. But it could simplify dealing with the previous requirements (e.g., BFT consensus somewhat simplifies the DKG)?
2-of-3 is a special case where we can use MuSig instead of FROST and thereby avoid distributed key generation (H/T @real-or-random).
This works by starting the key setup process with regular MuSig key aggregation between the three signers.
Assume that the signers are numbered 0, 1, 2.
Every signer i
sends their signing key to signer i + 1 mod 3
.
When signer i
receives the signing key from i - 1 mod 3
it sends an ACK to i + 1 mod 3
.
The signer is ready to sign once it receives the signing key and an ACK from i - 1 mod 3
.
After this key setup, every subset of two signers can sign for the 3-of-3 multisig because the signing key of the missing signer is known to one signer in the subset.
I think you can have a dissociation between backup: i.e the primary device crash hosting the
1-of-2
, there is an assumption the user will take manual recovery action (e.g re-derive the key from a seed backup on a new mobile) from failover, where there is an assumption under a threshold of faults/corruptions), the off-chain system can keep going without external interruption of operational continuity (e.g for a Lightning routing node HTLC forwarding). And still, you might have recovery flow blurring the line, such as "cloud node", where the Lightning node is hosted on a third-party infrastructure, e.g there is an encrypted backup of the secret key which is delivered to the end-user on a "human-friendly" password ?I think if your consider latency performance of the threshold/multisig scheme for the enteprise node use-case, not only concurrency
but also robustness as defined by ROAST matters. As you would like at least one of the concurrent session to outcome a valid signature
if the signer threshold is met. Now latency of the signing scheme itself might not matter as the worst-performance bottleneck might your
network connection between your signing share servers. For multiple backups on the FROST layer, assuming a mobile deployment, it's unclear where those redundant backups are laying, like if the primary device is offline this could strongly imply the user does not avail network connectivity ?
To determinate who is signing, I think a simple deployment can envision to have the entity performing the signature aggregtor role electing the set of signer in a client-server fashion. A more advanced deployment could be to hedge the election server fault could be to rely on consensus algorithms such as Raft/Honey Badger.
I don't know if there is an unified security proof existent for aggregated key nesting (e.g nesting a FROST
2-of-3
in a3-of-3
) ? IIRC, the MuSig2 libsecp256k1-zkp implem with the two-points nonce variant is proven under the AGM model and FROST scheme presents proofs only under the DL assumption only.If the joint signature scheme would like to match today deployment of "plainscript" multi-sig, I think higher shares bound can be thought
of like
3-of-5
or5-of-7
, beyond I would say there is an operational complexity issue with handling signing devices hardware cycles. I think the large federation threshold as deployed for side-chains (e.g11-of-15
) have a high operational continuity disruption cost (e.g inability to move sidechain tip forward) and in this context ROAST for robustness sounds valuable. For deployment like Lightning entreprise nodes and things like Fedimint, the operational continuity disruption cost sounds less-defined ?For Lightning, in that context the tweak operational and security model sounds to me to require better definition ? Like if they consume only local client source of entropies/states, or if we assume the
per_commitment_point
channel to be included (e.g could be a source of uniqueness forsecp256k1_musig_nonce_gen
'sextra_input
). For fedimint, if there is a Lightning HTLC-to-ecash swap, the swap invoice could be included.I think this is reasonable assumption that the tweaks can be known, and even partially forgeable by the attacker. With Taproot, one can have a wallet where the Taproot tapleaves can be composed by trust-minimized participants.
I think the answer is yes for Lightning if we assume only channel signing operations matters. If the HTLC/offers onions signing is included, there might have more Fedimint-like flows to consider.
For the classic 7-round threshold signature protocol, I think the main downside is the latency hit, if latency matters as a dimension for the Lightning enterprise node, large sidechains federation, fedimint flows. On announcing all the nonces to the other side of the LN channel, I think this interferes with any "packet-level" channel type upgrade like point-time-locked-contract or DLC-over-Lightning, and probably will be a restriction of some flows. Requiring all the signers to be online at noncegen time can be lightweighted if we batch the nonce generation on the channel-level (e.g every 1000 states with a new BOLT2-like message the state machine already strictly order the states), however if you assume backup signing offline device, with restraint access (e.g "cold storage" operational complexity), this could be too much restrictive ?
Fallbacking on a 2-of-2 MuSig which commits to a backup script path that allows spending with any combination of a
n-of-n
musig interferes with the Lightning state machine (and I think a lot of new latency on the network-wide propagation of HTLCs). Script path consumes more witness weights, which is a change in term of fee-bumping reserves management. So this direction sounds to me a "ugh" too. A puren-of-n
MuSig sounds to re-include in your operational/security model all the hardware faults, I think ?I think the verifiable encrypted secret direction suffers too from a fault-tolerance downgrade if the offline signer finalizing the
signature gets down, you would like fast failover, at least I think for the large federation use-case.
I don't think eltoo changes fundamentally this "partial signature finalization" issue, as the update mechanism still assume counter-signing
by both counterparties. Or you might have weird workarounds such as assigning one eltoo state to each signer, though sounds to classify
in the "significantly extending the Lightning protocol" category ?
Depends how much latency matters for Lightning application, and the operational cost of component fallback such as the signature aggregator/producer. If yes, I think BFT consensus help with previous requirements such as the signature producer getting down, or if only client-server flows should be considered ?