Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

LLFourn
Copy link
Owner

@LLFourn LLFourn commented Jun 14, 2022

Users must transition from a AggKey into an Bip340AggKey before starting a signing session. This is the idea:

  1. When it is a AggKey you can only apply ordinary tweaks (i.e. bip32)
  2. When it is a 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.

LLFourn added 2 commits June 13, 2022 14:59
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.
@LLFourn LLFourn marked this pull request as draft June 14, 2022 05:56
/// 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`.
Copy link
Collaborator

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 {
Copy link
Collaborator

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

Copy link
Owner Author

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.
Copy link
Collaborator

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..

@LLFourn
Copy link
Owner Author

LLFourn commented Aug 17, 2022

superseded by #37

@LLFourn LLFourn closed this Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants