[#InferDescriptor]
= InferDescriptor
:mrdocs:

Find a descriptor for the specified `script`, using information from `provider` where possible&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::unique&lowbar;ptr&lt;Descriptor&gt;
InferDescriptor(
    xref:CScript.adoc[CScript] const& script,
    xref:SigningProvider.adoc[SigningProvider] const& provider);
----

== Description

A non&hyphen;ranged descriptor which only generates the specified script will be returned in all circumstances&period;

For public keys with key origin information, this information will be preserved in the returned descriptor&period;

* If all information for solving `script` is present in `provider`, a descriptor will be returned which is IsSolvable() and encapsulates said information&period;
* Failing that, if `script` corresponds to a known address type, an &quot;addr()&quot; descriptor will be returned (which is not IsSolvable())&period;
* Failing that, a &quot;raw()&quot; descriptor is returned&period;

== Return Value

The inferred descriptor for the script&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *script* [in]
| The script to infer a descriptor for&period;
| *provider* [in]
| Source of extra key and script information used during inference&period;
|===


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