-
Notifications
You must be signed in to change notification settings - Fork 2.5k
musig2: add WithExternalCombinedNonce option to Sign #2443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
musig2: add WithExternalCombinedNonce option to Sign #2443
Conversation
Pull Request Test Coverage Report for Build 18458584969Details
💛 - Coveralls |
37e656c to
b2594f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you! 🎉
b2594f2 to
824e867
Compare
| // - A combined nonce has been registered via RegisterCombinedNonce | ||
| // | ||
| // If the combined nonce is not yet available, this method returns an error. | ||
| func (s *Session) CombinedNonce() ([PubNonceSize]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this approach is good(allows for more missuse of the nonces i guess) or if we should just return the combined nonce one time only if we register the last pubnonce? (changing RegisterPubNonce sig to return the aggregated nonce, instead of a havAllNonces bool)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each time we sign, we blank out localNonces, which prevents us from signing again directly after unless a new set of local nonces are generated.
This commit adds a new function to musig2.Session, which allows the caller to add an external aggregated nonce to the session.
3099b54 to
21eb99e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎷
This PR adds a new functional option to the Session.Sign function which allows specifying an external combined Nonce. This is useful when a central coordinator aggregates all nonces.
Externally Aggregated Nonces are part of the spec:
https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki#user-content-Nonce_Aggregation