CreateMuSig2AggregateSig

Combine the participants' partial signatures into a final MuSig2 aggregate signature.

Synopsis

Declared in <musig.h>

std::optional<std::vector<uint8_t>>
CreateMuSig2AggregateSig(
    std::vector<CPubKey> const& participants,
    CPubKey const& aggregate_pubkey,
    std::vector<std::pair<uint256, bool>> const& tweaks,
    uint256 const& sighash,
    std::map<CPubKey, std::vector<uint8_t>> const& pubnonces,
    std::map<CPubKey, uint256> const& partial_sigs);

Return Value

The final aggregate signature, or std::nullopt if combining fails.

Parameters

NameDescription
participantsThe participant public keys, in aggregation order.
aggregate_pubkeyThe aggregate public key of all participants.
tweaksThe tweaks to apply to the aggregate key, each with a flag selecting x-only or ordinary tweaking.
sighashThe signature hash being signed.
pubnoncesThe public nonces from all participants, keyed by public key.
partial_sigsThe partial signatures from all participants, keyed by public key.