Bitcoin Core 28.99.0
P2P Digital Currency
|
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. More... | |
virtual bool | IsSolvable () const =0 |
Whether this descriptor has all information about signing ignoring lack of private keys. More... | |
virtual std::string | ToString (bool compat_format=false) const =0 |
Convert the descriptor back to a string, undoing parsing. More... | |
virtual bool | IsSingleType () const =0 |
Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo) More... | |
virtual bool | ToPrivateString (const SigningProvider &provider, std::string &out) const =0 |
Convert the descriptor to a private string. More... | |
virtual bool | ToNormalizedString (const SigningProvider &provider, std::string &out, const DescriptorCache *cache=nullptr) const =0 |
Convert the descriptor to a normalized string. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual std::optional< OutputType > | GetOutputType () const =0 |
virtual std::optional< int64_t > | ScriptSize () const =0 |
Get the size of the scriptPubKey for this descriptor. More... | |
virtual std::optional< int64_t > | MaxSatisfactionWeight (bool use_max_sig) const =0 |
Get the maximum size of a satisfaction for this descriptor, in weight units. More... | |
virtual std::optional< int64_t > | MaxSatisfactionElems () const =0 |
Get the maximum size number of stack elements for satisfying this descriptor. More... | |
virtual void | GetPubKeys (std::set< CPubKey > &pubkeys, std::set< CExtPubKey > &ext_pubs) const =0 |
Return all (extended) public keys for this descriptor, including any from subdescriptors. More... | |
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 98 of file descriptor.h.
|
virtualdefault |
|
pure virtual |
Expand a descriptor at a specified position.
[in] | pos | The position at which to expand the descriptor. If IsRange() is false, this is ignored. |
[in] | provider | The provider to query for private keys in case of hardened derivation. |
[out] | output_scripts | The expanded scriptPubKeys. |
[out] | out | Scripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider ). |
[out] | write_cache | Cache data necessary to evaluate the descriptor at this point without access to private keys. |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Expand a descriptor at a specified position using cached expansion data.
[in] | pos | The position at which to expand the descriptor. If IsRange() is false, this is ignored. |
[in] | read_cache | Cached expansion data. |
[out] | output_scripts | The expanded scriptPubKeys. |
[out] | out | Scripts and public keys necessary for solving the expanded scriptPubKeys (may be equal to provider ). |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Expand the private key for a descriptor at a specified position, if possible.
[in] | pos | The position at which to expand the descriptor. If IsRange() is false, this is ignored. |
[in] | provider | The provider to query for the private keys. |
[out] | out | Any private keys available for the specified pos . |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Return all (extended) public keys for this descriptor, including any from subdescriptors.
[out] | pubkeys | Any public keys |
[out] | ext_pubs | Any extended public keys |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Whether the expansion of this descriptor depends on the position.
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Whether this descriptor will return one scriptPubKey or multiple (aka is or is not combo)
Implemented in wallet::DummyDescriptor.
|
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 wallet::DummyDescriptor.
|
pure virtual |
Get the maximum size number of stack elements for satisfying this descriptor.
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Get the maximum size of a satisfaction for this descriptor, in weight units.
use_max_sig | Whether to assume ECDSA signatures will have a high-r. |
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Get the size of the scriptPubKey for this descriptor.
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Convert the descriptor to a normalized string.
Normalized descriptors have the xpub at the last hardened step. This fails if the provided provider does not have the private keys to derive that xpub.
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Convert the descriptor to a private string.
This fails if the provided provider does not have the relevant private keys.
Implemented in wallet::DummyDescriptor.
|
pure virtual |
Convert the descriptor back to a string, undoing parsing.
Implemented in wallet::DummyDescriptor.