Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
ExternalSigner Class Reference

#include <external_signer.h>

Public Member Functions

 ExternalSigner (std::vector< std::string > command, std::string chain, std::string fingerprint, std::string name)
UniValue DisplayAddress (const std::string &descriptor) const
UniValue GetDescriptors (int account)
bool SignTransaction (PartiallySignedTransaction &psbt, std::string &error)

Static Public Member Functions

static bool Enumerate (const std::string &command, std::vector< ExternalSigner > &signers, const std::string &chain)

Public Attributes

std::string m_fingerprint
 Master key fingerprint of the signer.
std::string m_name
 Name of signer.

Private Member Functions

std::vector< std::string > NetworkArg () const

Private Attributes

std::vector< std::string > m_command
 The command which handles interaction with the external signer.
std::string m_chain
 Bitcoin mainnet, testnet, etc.

Detailed Description

Enables interaction with an external signing device or service, such as a hardware wallet. See doc/external-signer.md

Definition at line 18 of file external_signer.h.

Constructor & Destructor Documentation

◆ ExternalSigner()

ExternalSigner::ExternalSigner ( std::vector< std::string > command,
std::string chain,
std::string fingerprint,
std::string name )
Parameters
[in]commandthe command which handles interaction with the external signer
[in]fingerprintmaster key fingerprint of the signer
[in]chain"main", "test", "regtest" or "signet"
[in]namedevice name

Definition at line 19 of file external_signer.cpp.

Here is the caller graph for this function:

Member Function Documentation

◆ DisplayAddress()

UniValue ExternalSigner::DisplayAddress ( const std::string & descriptor) const

Display address on the device. Calls <command> displayaddress --desc <descriptor>.

Parameters
[in]descriptorDescriptor specifying which address to display. Must include a public key or xpub, as well as key origin.

Definition at line 67 of file external_signer.cpp.

Here is the call graph for this function:

◆ Enumerate()

bool ExternalSigner::Enumerate ( const std::string & command,
std::vector< ExternalSigner > & signers,
const std::string & chain )
static

Obtain a list of signers. Calls <command> enumerate.

Parameters
[in]commandthe command which handles interaction with the external signer
[in,out]signersvector to which new signers (with a unique master key fingerprint) are added
chain"main", "test", "regtest" or "signet"
Returns
success

Definition at line 27 of file external_signer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDescriptors()

UniValue ExternalSigner::GetDescriptors ( int account)

Get receive and change Descriptor(s) from device for a given account. Calls <command> getdescriptors --account <account>

Parameters
[in]accountwhich BIP32 account to use (e.g. m/44'/0'/account')
Returns
see doc/external-signer.md

Definition at line 72 of file external_signer.cpp.

Here is the call graph for this function:

◆ NetworkArg()

std::vector< std::string > ExternalSigner::NetworkArg ( ) const
private

Definition at line 22 of file external_signer.cpp.

Here is the caller graph for this function:

◆ SignTransaction()

bool ExternalSigner::SignTransaction ( PartiallySignedTransaction & psbt,
std::string & error )

Sign PartiallySignedTransaction on the device. Calls <command> signtransaction and passes the PSBT via stdin.

Parameters
[in,out]psbtPartiallySignedTransaction to be signed

Definition at line 77 of file external_signer.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_chain

std::string ExternalSigner::m_chain
private

Bitcoin mainnet, testnet, etc.

Definition at line 25 of file external_signer.h.

◆ m_command

std::vector<std::string> ExternalSigner::m_command
private

The command which handles interaction with the external signer.

Definition at line 22 of file external_signer.h.

◆ m_fingerprint

std::string ExternalSigner::m_fingerprint

Master key fingerprint of the signer.

Definition at line 37 of file external_signer.h.

◆ m_name

std::string ExternalSigner::m_name

Name of signer.

Definition at line 40 of file external_signer.h.


The documentation for this class was generated from the following files: