Bitcoin Core  0.18.99
P2P Digital Currency
Enumerations | Functions
descriptor.cpp File Reference
#include <script/descriptor.h>
#include <key_io.h>
#include <pubkey.h>
#include <script/script.h>
#include <script/standard.h>
#include <span.h>
#include <util/bip32.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for descriptor.cpp:

Go to the source code of this file.

Enumerations

enum  DeriveType
 
enum  ParseScriptContext
 

Functions

std::unique_ptr< DescriptorParse (const std::string &descriptor, FlatSigningProvider &out, bool require_checksum)
 Parse a descriptor string. More...
 
std::unique_ptr< DescriptorInferDescriptor (const CScript &script, const SigningProvider &provider)
 Find a descriptor for the specified script, using information from provider where possible. More...
 

Enumeration Type Documentation

◆ DeriveType

enum DeriveType
strong

Definition at line 238 of file descriptor.cpp.

◆ ParseScriptContext

enum ParseScriptContext
strong

Definition at line 625 of file descriptor.cpp.

Function Documentation

◆ InferDescriptor()

std::unique_ptr<Descriptor> InferDescriptor ( const CScript script,
const SigningProvider provider 
)

Find a descriptor for the specified script, using information from provider where possible.

A non-ranged descriptor which only generates the specified script will be returned in all circumstances.

For public keys with key origin information, this information will be preserved in the returned descriptor.

  • If all information for solving script is present in provider, a descriptor will be returned which is IsSolvable() and encapsulates said information.
  • Failing that, if script corresponds to a known address type, an "addr()" descriptor will be returned (which is not IsSolvable()).
  • Failing that, a "raw()" descriptor is returned.

Definition at line 934 of file descriptor.cpp.

Here is the caller graph for this function:

◆ Parse()

std::unique_ptr<Descriptor> Parse ( const std::string &  descriptor,
FlatSigningProvider out,
bool  require_checksum = false 
)

Parse a descriptor string.

Included private keys are put in out.

If the descriptor has a checksum, it must be valid. If require_checksum is set, the checksum is mandatory - otherwise it is optional.

If a parse error occurs, or the checksum is missing/invalid, or anything else is wrong, nullptr is returned.

Definition at line 913 of file descriptor.cpp.

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