[#DeriveTarget]
= DeriveTarget
:mrdocs:

Convert nBits value to target&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;arith&lowbar;uint256&gt;
DeriveTarget(
    unsigned int nBits,
    xref:uint256.adoc[uint256] pow&lowbar;limit);
----

== Return Value

the proof&hyphen;of&hyphen;work target or nullopt if the nBits value is invalid (due to overflow or exceeding pow&lowbar;limit)

== Parameters

[cols="1,4"]
|===
| Name| Description
| *nBits* [in]
| compact representation of the target
| *pow&lowbar;limit* [in]
| PoW limit (consensus parameter)
|===


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