[#Descriptor]
= Descriptor
:mrdocs:

Interface for parsed descriptor objects&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Descriptor;
----

== Description

Descriptors are strings that describe a set of scriptPubKeys, together with all information necessary to solve them&period; By combining all information into one, they avoid the need to separately import keys and scripts&period;

Descriptors may be ranged, which occurs when the public keys inside are specified in the form of HD chains (xpubs)&period;

Descriptors always represent public information &hyphen; public keys and scripts &hyphen; but in cases where private keys need to be conveyed along with a descriptor, they can be included inside by changing public keys to private keys (WIF format), and changing xpubs by xprvs&period;

Reference documentation about the descriptor language can be found in doc&sol;descriptors&period;md&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:Descriptor/2destructor.adoc[`&#126;Descriptor`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy the descriptor and any subdescriptors it owns&period;
| xref:Descriptor/CanSelfExpand.adoc[`CanSelfExpand`]  [.small]#[virtual]#
| Whether the descriptor can be used to produce its address(es) without needing a cache or private keys&period;
| xref:Descriptor/Expand.adoc[`Expand`]  [.small]#[virtual]#
| Expand a descriptor at a specified position&period;
| xref:Descriptor/ExpandFromCache.adoc[`ExpandFromCache`]  [.small]#[virtual]#
| Expand a descriptor at a specified position using cached expansion data&period;
| xref:Descriptor/ExpandPrivate.adoc[`ExpandPrivate`]  [.small]#[virtual]#
| Expand the private key for a descriptor at a specified position, if possible&period;
| xref:Descriptor/GetKeyCount.adoc[`GetKeyCount`]  [.small]#[virtual]#
| Get the number of key expressions in this descriptor&period; Used only for tests
| xref:Descriptor/GetMaxKeyExpr.adoc[`GetMaxKeyExpr`]  [.small]#[virtual]#
| Get the maximum key expression index&period; Used only for tests
| xref:Descriptor/GetOutputType.adoc[`GetOutputType`]  [.small]#[virtual]#
| Report the output type of the scripts produced by this descriptor&period;
| xref:Descriptor/GetPubKeys.adoc[`GetPubKeys`]  [.small]#[virtual]#
| Return all (extended) public keys for this descriptor, including any from subdescriptors&period;
| xref:Descriptor/HasScripts.adoc[`HasScripts`]  [.small]#[virtual]#
| Whether this descriptor produces any scripts with the Expand functions
| xref:Descriptor/HavePrivateKeys.adoc[`HavePrivateKeys`]  [.small]#[virtual]#
| Whether the given provider has all private keys required by this descriptor&period;
| xref:Descriptor/IsRange.adoc[`IsRange`]  [.small]#[virtual]#
| Whether the expansion of this descriptor depends on the position&period;
| xref:Descriptor/IsSingleType.adoc[`IsSingleType`]  [.small]#[virtual]#
| Whether this descriptor will return at most one scriptPubKey or multiple (aka is or is not combo)
| xref:Descriptor/IsSolvable.adoc[`IsSolvable`]  [.small]#[virtual]#
| Whether this descriptor has all information about signing ignoring lack of private keys&period; This is true for all descriptors except ones that use `raw` or `addr` constructions&period;
| xref:Descriptor/MaxSatisfactionElems.adoc[`MaxSatisfactionElems`]  [.small]#[virtual]#
| Get the maximum size number of stack elements for satisfying this descriptor&period;
| xref:Descriptor/MaxSatisfactionWeight.adoc[`MaxSatisfactionWeight`]  [.small]#[virtual]#
| Get the maximum size of a satisfaction for this descriptor, in weight units&period;
| xref:Descriptor/ScriptSize.adoc[`ScriptSize`]  [.small]#[virtual]#
| Get the size of the scriptPubKey for this descriptor&period;
| xref:Descriptor/ToNormalizedString.adoc[`ToNormalizedString`]  [.small]#[virtual]#
| Convert the descriptor to a normalized string&period; Normalized descriptors have the xpub at the last hardened step&period; This fails if the provided provider does not have the private keys to derive that xpub&period;
| xref:Descriptor/ToPrivateString.adoc[`ToPrivateString`]  [.small]#[virtual]#
| Convert the descriptor to a private string&period; This uses public keys if the relevant private keys are not in the SigningProvider&period; If none of the relevant private keys are available, the output string in the &quot;out&quot; parameter will not contain any private key information, and this function will return &quot;false&quot;&period;
| xref:Descriptor/ToString.adoc[`ToString`]  [.small]#[virtual]#
| Convert the descriptor back to a string, undoing parsing&period;
| xref:Descriptor/Warnings.adoc[`Warnings`]  [.small]#[virtual]#
| Semantic&sol;safety warnings (includes subdescriptors)&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:DescriptorID.adoc[`DescriptorID`]
| Unique identifier that may not change over time, unless explicitly marked as not backwards compatible&period; This is not part of BIP 380, not guaranteed to be interoperable and should not be exposed to the user&period;
| xref:InferDescriptor.adoc[`InferDescriptor`]
| Find a descriptor for the specified `script`, using information from `provider` where possible&period;
|===


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