[#CreateMuSig2Nonce]
= CreateMuSig2Nonce
:mrdocs:

Generate a MuSig2 public nonce for a signing session and store the matching secret nonce&period;

== Synopsis

Declared in `&lt;musig&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::vector&lt;uint8&lowbar;t&gt;
CreateMuSig2Nonce(
    xref:MuSig2SecNonce.adoc[MuSig2SecNonce]& secnonce,
    xref:uint256.adoc[uint256] const& sighash,
    xref:CKey.adoc[CKey] const& our&lowbar;seckey,
    xref:CPubKey.adoc[CPubKey] const& aggregate&lowbar;pubkey,
    std::vector&lt;CPubKey&gt; const& pubkeys);
----

== Return Value

The serialized public nonce to share with the other participants&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *secnonce*
| Output holder that receives the secret nonce for this session&period;
| *sighash*
| The signature hash that will be signed in this session&period;
| *our&lowbar;seckey*
| This participant&apos;s secret key&period;
| *aggregate&lowbar;pubkey*
| The aggregate public key of all participants&period;
| *pubkeys*
| The participant public keys, in aggregation order&period;
|===


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