[#MutableTransactionSignatureCreator-CreateMuSig2AggregateSig]
= xref:MutableTransactionSignatureCreator.adoc[MutableTransactionSignatureCreator]::CreateMuSig2AggregateSig
:relfileprefix: ../
:mrdocs:

Aggregate MuSig2 partial signatures into a final signature&period;

== Synopsis

Declared in `&lt;script&sol;sign&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
bool
CreateMuSig2AggregateSig(
    std::vector&lt;CPubKey&gt; const& participants,
    std::vector&lt;uint8&lowbar;t&gt;& sig,
    xref:CPubKey.adoc[CPubKey] const& aggregate&lowbar;pubkey,
    xref:CPubKey.adoc[CPubKey] const& script&lowbar;pubkey,
    xref:uint256.adoc[uint256] const* leaf&lowbar;hash,
    std::vector&lt;std::pair&lt;uint256, bool&gt;&gt; const& tweaks,
    xref:SigVersion.adoc[SigVersion] sigversion,
    xref:SignatureData.adoc[SignatureData] const& sigdata) const override;
----

== Return Value

True if the aggregate signature was created&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *participants*
| The participant public keys contributing signatures&period;
| *sig*
| Filled with the produced aggregate signature&period;
| *aggregate&lowbar;pubkey*
| The aggregate public key of the MuSig2 group&period;
| *script&lowbar;pubkey*
| The output key the aggregate key is tweaked to&period;
| *leaf&lowbar;hash*
| The tapleaf hash for a script path spend, or null&period;
| *tweaks*
| The tweaks applied to the aggregate key, with parity flags&period;
| *sigversion*
| The signature serialization version to use&period;
| *sigdata*
| Signature data providing context for the input&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
