[#wallet-CWallet-GetExtKey] = xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::GetExtKey :relfileprefix: ../../ :mrdocs: Reconstruct the extended private key for an HD xpub. Returns nullopt when no descriptor has the private key, or the wallet is locked. == Synopsis Declared in `<wallet/wallet.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::optional<CExtKey> GetExtKey(xref:CExtPubKey.adoc[CExtPubKey] const& xpub) const; ---- == Return Value The extended private key, or nullopt if unavailable. == Parameters [cols="1,4"] |=== | Name| Description | *xpub* | The extended public key to reconstruct the private key for. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#