[#FlatSigningProvider]
= FlatSigningProvider
:mrdocs:

A signing provider backed by plain in&hyphen;memory maps of keys and scripts&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct FlatSigningProvider final
    : xref:SigningProvider.adoc[SigningProvider]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:SigningProvider.adoc[SigningProvider]`
| An interface to be implemented by keystores that support signing&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:FlatSigningProvider/DeleteMuSig2Session.adoc[`DeleteMuSig2Session`]  [.small]#[virtual]#
| Delete the state stored for a MuSig2 signing session&period;
| xref:FlatSigningProvider/GetAllMuSig2ParticipantPubkeys.adoc[`GetAllMuSig2ParticipantPubkeys`]  [.small]#[virtual]#
| Return all known MuSig2 aggregate pubkeys and their participants&period;
| xref:FlatSigningProvider/GetCScript.adoc[`GetCScript`]  [.small]#[virtual]#
| Look up a script by its script id&period;
| xref:FlatSigningProvider/GetKey-03.adoc[`GetKey`] 
| Look up a private key by its key id&period;
| xref:SigningProvider/GetKeyByXOnly.adoc[`GetKeyByXOnly`] 
| Look up a private key by any key id derived from an x&hyphen;only pubkey&period;
| xref:FlatSigningProvider/GetKeyOrigin.adoc[`GetKeyOrigin`]  [.small]#[virtual]#
| Look up the origin information for a key&period;
| xref:SigningProvider/GetKeyOriginByXOnly.adoc[`GetKeyOriginByXOnly`] 
| Look up key origin info by any key id derived from an x&hyphen;only pubkey&period;
| xref:FlatSigningProvider/GetMuSig2ParticipantPubkeys.adoc[`GetMuSig2ParticipantPubkeys`]  [.small]#[virtual]#
| Return the MuSig2 participant pubkeys for an aggregate pubkey&period;
| xref:FlatSigningProvider/GetMuSig2SecNonce.adoc[`GetMuSig2SecNonce`]  [.small]#[virtual]#
| Retrieve the MuSig2 secret nonce for a signing session&period;
| xref:FlatSigningProvider/GetPubKey-00.adoc[`GetPubKey`] 
| Look up a public key by its key id&period;
| xref:SigningProvider/GetPubKeyByXOnly.adoc[`GetPubKeyByXOnly`] 
| Look up a public key by any key id derived from an x&hyphen;only pubkey&period;
| xref:FlatSigningProvider/GetTaprootBuilder.adoc[`GetTaprootBuilder`]  [.small]#[virtual]#
| Look up the Taproot builder for an output key&period;
| xref:FlatSigningProvider/GetTaprootSpendData.adoc[`GetTaprootSpendData`]  [.small]#[virtual]#
| Look up the Taproot spend data for an output key&period;
| xref:SigningProvider/HaveCScript.adoc[`HaveCScript`]  [.small]#[virtual]#
| Report whether a script with the given id is known&period;
| xref:FlatSigningProvider/HaveKey-01.adoc[`HaveKey`] 
| Report whether a private key with the given id is known&period;
| xref:FlatSigningProvider/Merge.adoc[`Merge`] 
| Merge the contents of another provider into this one&period;
| xref:FlatSigningProvider/SetMuSig2SecNonce.adoc[`SetMuSig2SecNonce`]  [.small]#[virtual]#
| Store a MuSig2 secret nonce for a signing session&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:FlatSigningProvider/aggregate_pubkeys.adoc[`aggregate&lowbar;pubkeys`] 
| MuSig2 aggregate pubkeys and their participants&period;
| xref:FlatSigningProvider/keys.adoc[`keys`] 
| Known private keys keyed by key id&period;
| xref:FlatSigningProvider/musig2_secnonces.adoc[`musig2&lowbar;secnonces`] 
| Optional store of MuSig2 secret nonces&period;
| xref:FlatSigningProvider/origins.adoc[`origins`] 
| Key origin info keyed by key id&period;
| xref:FlatSigningProvider/pubkeys.adoc[`pubkeys`] 
| Known public keys keyed by key id&period;
| xref:FlatSigningProvider/scripts.adoc[`scripts`] 
| Known scripts keyed by script id&period;
| xref:FlatSigningProvider/tr_trees.adoc[`tr&lowbar;trees`] 
| Map from output key to Taproot tree (which can then make the TaprootSpendData)&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:AddAndGetDestinationForScript.adoc[`AddAndGetDestinationForScript`]
| Get a destination of the requested type (if possible) to the specified script&period; This function will automatically add the script (and any other necessary scripts) to the keystore&period;
| xref:GetKeyForDestination.adoc[`GetKeyForDestination`]
| Return the CKeyID of the key involved in a script (if there is a unique one)&period;
| xref:IsSegWitOutput.adoc[`IsSegWitOutput`]
| Check whether a scriptPubKey is known to be segwit&period;
| xref:ProduceSignature.adoc[`ProduceSignature`]
| Produce a script signature using a generic signature creator&period;
| xref:SignPSBTInput.adoc[`SignPSBTInput`]
| Signs a PSBTInput, verifying that all provided data matches what is being signed&period;
| xref:UpdatePSBTOutput.adoc[`UpdatePSBTOutput`]
| Updates a PSBTOutput with information from provider&period;
|===


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