[#MuSig2AggregatePubkeys-01] = MuSig2AggregatePubkeys :mrdocs: `MuSig2AggregatePubkeys` overloads == Synopses Declared in `<musig.h>` Compute the full aggregate pubkey from the given participant pubkeys in their current order. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::optional<CPubKey> xref:MuSig2AggregatePubkeys-09.adoc[MuSig2AggregatePubkeys](std::vector<CPubKey> const& pubkeys); ---- [.small]#xref:MuSig2AggregatePubkeys-09.adoc[_» 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::optional<CPubKey> xref:MuSig2AggregatePubkeys-04.adoc[MuSig2AggregatePubkeys]( std::vector<CPubKey> const& pubkeys, xref:secp256k1_musig_keyagg_cache.adoc[secp256k1_musig_keyagg_cache]& keyagg_cache, std::optional<CPubKey> const& expected_aggregate); ---- [.small]#xref:MuSig2AggregatePubkeys-04.adoc[_» 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 [cols="1,4"] |=== | Name| Description | *pubkeys* | The participant public keys, in the order they should be aggregated. | *keyagg_cache* | Output cache populated with the aggregation state for later MuSig2 operations. | *expected_aggregate* | Optional aggregate pubkey to validate the computed result against. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#