[#CreateMuSig2AggregateSig] = CreateMuSig2AggregateSig :mrdocs: Combine the participants' partial signatures into a final MuSig2 aggregate signature. == Synopsis Declared in `<musig.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::optional<std::vector<uint8_t>> CreateMuSig2AggregateSig( std::vector<CPubKey> const& participants, xref:CPubKey.adoc[CPubKey] const& aggregate_pubkey, std::vector<std::pair<uint256, bool>> const& tweaks, xref:uint256.adoc[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 [cols="1,4"] |=== | Name| Description | *participants* | The participant public keys, in aggregation order. | *aggregate_pubkey* | The aggregate public key of all participants. | *tweaks* | The tweaks to apply to the aggregate key, each with a flag selecting x‐only or ordinary tweaking. | *sighash* | The signature hash being signed. | *pubnonces* | The public nonces from all participants, keyed by public key. | *partial_sigs* | The partial signatures from all participants, keyed by public key. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#