Bitcoin
Public Member Functions | List of all members
Descriptor Struct Referenceabstract

#include <descriptor.h>

Inheritance diagram for Descriptor:
anonymous_namespace{descriptor.cpp}::DescriptorImpl anonymous_namespace{descriptor.cpp}::AddressDescriptor anonymous_namespace{descriptor.cpp}::ComboDescriptor anonymous_namespace{descriptor.cpp}::MultisigDescriptor anonymous_namespace{descriptor.cpp}::PKDescriptor anonymous_namespace{descriptor.cpp}::PKHDescriptor anonymous_namespace{descriptor.cpp}::RawDescriptor anonymous_namespace{descriptor.cpp}::SHDescriptor anonymous_namespace{descriptor.cpp}::WPKHDescriptor anonymous_namespace{descriptor.cpp}::WSHDescriptor

Public Member Functions

virtual ~Descriptor ()=default
 
virtual bool IsRange () const =0
 
virtual bool IsSolvable () const =0
 
virtual std::string ToString () const =0
 
virtual bool ToPrivateString (const SigningProvider &provider, std::string &out) const =0
 
virtual bool Expand (int pos, const SigningProvider &provider, std::vector< CScript > &output_scripts, FlatSigningProvider &out, std::vector< unsigned char > *cache=nullptr) const =0
 
virtual bool ExpandFromCache (int pos, const std::vector< unsigned char > &cache, std::vector< CScript > &output_scripts, FlatSigningProvider &out) const =0
 
virtual void ExpandPrivate (int pos, const SigningProvider &provider, FlatSigningProvider &out) const =0
 

Detailed Description

Interface for parsed descriptor objects.

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,
std::vector< unsigned char > *  cache = nullptr 
) const
pure virtual

Expand a descriptor at a specified position.

pos: the position at which to expand the descriptor. If IsRange() is false, this is ignored. provider: the provider to query for private keys in case of hardened derivation. output_script: the expanded scriptPubKeys will be put here. out: scripts and public keys necessary for solving the expanded scriptPubKeys will be put here (may be equal to provider). cache: vector which will be overwritten with cache data necessary to-evaluate the descriptor at this point without access to private keys.

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ ExpandFromCache()

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

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

pos: the position at which to expand the descriptor. If IsRange() is false, this is ignored. cache: vector from which cached expansion data will be read. output_script: the expanded scriptPubKeys will be put here. out: scripts and public keys necessary for solving the expanded scriptPubKeys will be put here (may be equal to provider).

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ 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.

pos: the position at which to expand the descriptor. If IsRange() is false, this is ignored. provider: the provider to query for the private keys. out: any private keys available for the specified pos will be placed here.

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ IsRange()

virtual bool Descriptor::IsRange ( ) const
pure virtual

Whether the expansion of this descriptor depends on the position.

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ 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.

Implemented in anonymous_namespace{descriptor.cpp}::RawDescriptor, anonymous_namespace{descriptor.cpp}::AddressDescriptor, and anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ 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.

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.

◆ ToString()

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

Convert the descriptor back to a string, undoing parsing.

Implemented in anonymous_namespace{descriptor.cpp}::DescriptorImpl.


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