[#ExtractDestination]
= ExtractDestination
:mrdocs:

Parse a scriptPubKey for the destination&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ExtractDestination(
    xref:CScript.adoc[CScript] const& scriptPubKey,
    xref:CTxDestination.adoc[CTxDestination]& addressRet);
----

== Description

For standard scripts that have addresses (and P2PK as an exception), a corresponding CTxDestination is assigned to addressRet&period; For all other scripts&period; addressRet is assigned as a CNoDestination containing the scriptPubKey&period;

== Return Value

True for standard destinations with addresses &hyphen; P2PKH, P2SH, P2WPKH, P2WSH, P2TR and P2W??? scripts&period; False for non&hyphen;standard destinations and those without addresses &hyphen; P2PK, bare multisig, null data, and nonstandard scripts&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *scriptPubKey*
| The output script to parse&period;
| *addressRet*
| Receives the extracted destination&period;
|===


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