Struct schnorr_fun::musig::AggKey
source · pub struct AggKey<T> { /* private fields */ }
Expand description
A list of keys aggregated into a single key.
Created using MuSig::new_agg_key
.
The AggKey
can’t be serialized but it’s very efficient to re-create it from the initial list of keys.
Implementations§
source§impl<T: Copy> AggKey<T>
impl<T: Copy> AggKey<T>
sourcepub fn agg_public_key(&self) -> Point<T>
pub fn agg_public_key(&self) -> Point<T>
The aggregate key.
Note that before using it as a key in a system that accepts “x-only” keys like [BIP341]
you must call into_xonly_key
and use that aggregate key.
source§impl AggKey<Normal>
impl AggKey<Normal>
sourcepub fn into_xonly_key(self) -> AggKey<EvenY>
pub fn into_xonly_key(self) -> AggKey<EvenY>
Convert the key into a BIP340 AggKey.
This is the BIP340 x-only version of the key which you can put in a segwitv1 output and create/verify BIP340 signatures under.
sourcepub fn tweak(self, tweak: Scalar<impl Secrecy, impl ZeroChoice>) -> Option<Self>
pub fn tweak(self, tweak: Scalar<impl Secrecy, impl ZeroChoice>) -> Option<Self>
Add a scalar tweak
to aggregate MuSig public 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_xonly_key
.
It is not appropriate for doing taproot tweaking which must be done on an AggKey
with EvenY
public key in BIP340 form, see into_xonly_key
.
§Return value
In the erroneous case that the tweak is exactly equal to the negation of the aggregate
secret key it returns None
.