MCPcopy Create free account
hub / github.com/BitVM/BitVM / generate_n_of_n_public_key

Function generate_n_of_n_public_key

bridge/src/contexts/base.rs:23–36  ·  view source on GitHub ↗
(n_of_n_public_keys: &[PublicKey])

Source from the content-addressed store, hash-verified

21}
22
23pub fn generate_n_of_n_public_key(n_of_n_public_keys: &[PublicKey]) -> (PublicKey, XOnlyPublicKey) {
24 let public_keys: Vec<Point> = n_of_n_public_keys
25 .iter()
26 .map(|&public_key| public_key.inner.into())
27 .collect();
28
29 let key_agg_context = KeyAggContext::new(public_keys).unwrap();
30 let aggregated_key: Secp256k1PublicKey = key_agg_context.aggregated_pubkey();
31
32 let n_of_n_public_key = PublicKey::from(aggregated_key);
33 let n_of_n_taproot_public_key = XOnlyPublicKey::from(n_of_n_public_key);
34
35 (n_of_n_public_key, n_of_n_taproot_public_key)
36}

Callers 5

newMethod · 0.85
newMethod · 0.85
newMethod · 0.85
newMethod · 0.85
newMethod · 0.85

Calls 1

intoMethod · 0.45

Tested by

no test coverage detected