Update multi-hop-locks to Musig2 #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Musig2 will always be preferred over Musig, so the scriptless script multi-hop-locks construction should use it.
I tried to ensure this was compatible with #24, let me know if I missed something. One subtlety it introduces compared to the previous version is that each participant's (partial) public nonce depends on the tweak, so I made this dependency explicit (without detailing the calculation). This doesn't change the protocol itself as the tweaks are shared beforehand (in the setup phase).
Overall I didn't detail how Musig2 components are calculated (aggregated public key, nonces, etc).
It feels like we simply need to make the dependencies between variables explicit to ensure the protocol works, but we don't need to know the exact formulas.
@jonasnick you were right in our recent discussions, the protocol does introduce a message from the right participant to the left one, which means 0.5 additional RTT compared to the current lightning protocol. I need to do more thinking on that, but you're probably right that we cannot get rid of it, as the left participant needs to wait for a partial signature from the right participant before finalizing the addition of that output otherwise it's unsafe.