-
Notifications
You must be signed in to change notification settings - Fork 29
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] two phase key aggregation #97
Conversation
Since we do the negation check when we create them
so that before finalizing into an "AggKey" you can apply ordinary b32 type tweaks. After finalization you apply only "XOnly" taproot style tweaks.
/// This is how you embed a taproot commitment into a key. | ||
/// The resulting key is equal to the existing key plus `tweak * G`. The tweak mutates the | ||
/// public key while still allowing the original set of signers to sign under the new key. | ||
/// This function is appropriate for doing [BIP32] tweaks before calling `into_bip340_key`. |
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.
Thinking maybe move these two lines on top of the ones above? Just to be sure people see it and don't use the wrong tweak
/// The `XOnly` aggregated key for the keylist. | ||
pub fn agg_public_key(&self) -> XOnly { | ||
self.agg_key.to_xonly() | ||
impl AggKey { |
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.
Could rename AggKey
to MuSigKey
like we are planning with FrostKey
which I quite like. But maybe this makes Bip340MuSigKey
too long
With frost we will also have a Bip340FrostKey
/ Bip340AggKey
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.
Yeah let's apply the same thing to FROST and see what naming we like best. I think what you've suggested is right.
/// Tweak the aggregate MuSig public key with a scalar so that the resulting key is equal to the | ||
/// existing key plus `tweak * G`. The tweak mutates the public key while still allowing | ||
/// the original set of signers to sign under the new key. | ||
/// Add a scalar `tweak` to aggregate MuSig public key. |
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.
Both tweaks functions take scalar tweaks as inputs so perhaps this isn't the best description. But I also do not like ordinary
tweaks..
superseded by #37 |
Users must transition from a
AggKey
into anBip340AggKey
before starting a signing session. This is the idea:AggKey
you can only apply ordinary tweaks (i.e. bip32)Bip340Aggkey
you can only apply "xonly" tweaks. (i.e. taproot)The code and spec makes way more sense to me now. We are down to a single
needs_negation
boolean we keep around. We can't implement all the spec tests for this since one test requires a ordinary tweak after a "xonly" tweak. I think I'll suggest removing that from the spec.