[#BaseSignatureCreator-CreateMuSig2Nonce]
= xref:BaseSignatureCreator.adoc[BaseSignatureCreator]::CreateMuSig2Nonce
:relfileprefix: ../
:mrdocs:

Create a MuSig2 public nonce for the given participant&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
std::vector&lt;uint8&lowbar;t&gt;
CreateMuSig2Nonce(
    xref:SigningProvider.adoc[SigningProvider] const& provider,
    xref:CPubKey.adoc[CPubKey] const& aggregate&lowbar;pubkey,
    xref:CPubKey.adoc[CPubKey] const& script&lowbar;pubkey,
    xref:CPubKey.adoc[CPubKey] const& part&lowbar;pubkey,
    xref:uint256.adoc[uint256] const* leaf&lowbar;hash,
    xref:uint256.adoc[uint256] const* merkle&lowbar;root,
    xref:SigVersion.adoc[SigVersion] sigversion,
    xref:SignatureData.adoc[SignatureData] const& sigdata) const = 0;
----

== Return Value

The serialized public nonce, empty on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *provider*
| The source of keys and MuSig2 session state&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;
| *part&lowbar;pubkey*
| The participant public key generating the nonce&period;
| *leaf&lowbar;hash*
| The tapleaf hash for a script path spend, or null&period;
| *merkle&lowbar;root*
| The Taproot merkle root, or null for a key path spend&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]#
