Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Descriptor Struct Referenceabstract

Interface for parsed descriptor objects. More...

#include <descriptor.h>

Public Member Functions

virtual ~Descriptor ()=default
 
virtual bool IsRange () const =0
 Whether the expansion of this descriptor depends on the position.
 
virtual bool IsSolvable () const =0
 Whether this descriptor has all information about signing ignoring lack of private keys.
 
virtual std::string ToString () const =0
 Convert the descriptor back to a string, undoing parsing.
 
virtual bool IsSingleType () const =0
 Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo)
 
virtual bool ToPrivateString (const SigningProvider &provider, std::string &out) const =0
 Convert the descriptor to a private string.
 
virtual bool Expand (int pos, const SigningProvider &provider, std::vector< CScript > &output_scripts, FlatSigningProvider &out, DescriptorCache *write_cache=nullptr) const =0
 Expand a descriptor at a specified position.
 
virtual bool ExpandFromCache (int pos, const DescriptorCache &read_cache, std::vector< CScript > &output_scripts, FlatSigningProvider &out) const =0
 Expand a descriptor at a specified position using cached expansion data.
 
virtual void ExpandPrivate (int pos, const SigningProvider &provider, FlatSigningProvider &out) const =0
 Expand the private key for a descriptor at a specified position, if possible.
 
virtual std::optional< OutputTypeGetOutputType () const =0
 

Detailed Description

Interface for parsed descriptor objects.

Descriptors are strings that describe a set of scriptPubKeys, together with all information necessary to solve them. By combining all information into one, they avoid the need to separately import keys and scripts.

Descriptors may be ranged, which occurs when the public keys inside are specified in the form of HD chains (xpubs).

Descriptors always represent public information - public keys and scripts - but in cases where private keys need to be conveyed along with a descriptor, they can be included inside by changing public keys to private keys (WIF format), and changing xpubs by xprvs.

Reference documentation about the descriptor language can be found in doc/descriptors.md.

Definition at line 89 of file descriptor.h.

Constructor & Destructor Documentation

◆ ~Descriptor()

virtual Descriptor::~Descriptor ( )
virtualdefault

Member Function Documentation

◆ Expand()

virtual bool Descriptor::Expand ( int  pos,
const SigningProvider provider,
std::vector< CScript > &  output_scripts,
FlatSigningProvider out,
DescriptorCache write_cache = nullptr 
) const
pure virtual

Expand a descriptor at a specified position.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]providerThe provider to query for private keys in case of hardened derivation.
[out]output_scriptsThe expanded scriptPubKeys.
[out]outScripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider).
[out]write_cacheCache data necessary to evaluate the descriptor at this point without access to private keys.

◆ ExpandFromCache()

virtual bool Descriptor::ExpandFromCache ( int  pos,
const DescriptorCache read_cache,
std::vector< CScript > &  output_scripts,
FlatSigningProvider out 
) const
pure virtual

Expand a descriptor at a specified position using cached expansion data.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]read_cacheCached expansion data.
[out]output_scriptsThe expanded scriptPubKeys.
[out]outScripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider).

◆ ExpandPrivate()

virtual void Descriptor::ExpandPrivate ( int  pos,
const SigningProvider provider,
FlatSigningProvider out 
) const
pure virtual

Expand the private key for a descriptor at a specified position, if possible.

Parameters
[in]posThe position at which to expand the descriptor. If IsRange() is false, this is ignored.
[in]providerThe provider to query for the private keys.
[out]outAny private keys available for the specified pos.

◆ GetOutputType()

virtual std::optional< OutputType > Descriptor::GetOutputType ( ) const
pure virtual
Returns
The OutputType of the scriptPubKey(s) produced by this descriptor. Or std::nullopt if indeterminate (multiple or none)

◆ IsRange()

virtual bool Descriptor::IsRange ( ) const
pure virtual

Whether the expansion of this descriptor depends on the position.

◆ IsSingleType()

virtual bool Descriptor::IsSingleType ( ) const
pure virtual

Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo)

◆ IsSolvable()

virtual bool Descriptor::IsSolvable ( ) const
pure virtual

Whether this descriptor has all information about signing ignoring lack of private keys.

This is true for all descriptors except ones that use raw or addr constructions.

◆ ToPrivateString()

virtual bool Descriptor::ToPrivateString ( const SigningProvider provider,
std::string &  out 
) const
pure virtual

Convert the descriptor to a private string.

This fails if the provided provider does not have the relevant private keys.

◆ ToString()

virtual std::string Descriptor::ToString ( ) const
pure virtual

Convert the descriptor back to a string, undoing parsing.


The documentation for this struct was generated from the following file: