MuSig2AggregatePubkeys

MuSig2AggregatePubkeys overloads

Synopses

Declared in <musig.h>

Compute the full aggregate pubkey from the given participant pubkeys in their current order.

std::optional<CPubKey>
MuSig2AggregatePubkeys(std::vector<CPubKey> const& pubkeys);
» more...

Compute the full aggregate pubkey from the given participant pubkeys in their current order. Outputs the secp256k1_musig_keyagg_cache and validates that the computed aggregate pubkey matches an expected aggregate pubkey. This is necessary for most MuSig2 operations.

std::optional<CPubKey>
MuSig2AggregatePubkeys(
    std::vector<CPubKey> const& pubkeys,
    secp256k1_musig_keyagg_cache& keyagg_cache,
    std::optional<CPubKey> const& expected_aggregate);
» more...

Return Value

  • The aggregate public key, or std::nullopt if aggregation fails.
  • The aggregate public key, or std::nullopt if aggregation fails or does not match expected_aggregate.

Parameters

NameDescription
pubkeysThe participant public keys, in the order they should be aggregated.
keyagg_cacheOutput cache populated with the aggregation state for later MuSig2 operations.
expected_aggregateOptional aggregate pubkey to validate the computed result against.