Bitcoin Core  27.99.0
P2P Digital Currency
Namespaces | Classes | Typedefs | Enumerations | Functions
miniscript Namespace Reference

Namespaces

 internal
 

Classes

class  Type
 This type encapsulates the miniscript type system properties. More...
 
struct  Node
 A node in a miniscript expression. More...
 

Typedefs

using Opcode = std::pair< opcodetype, std::vector< unsigned char > >
 
template<typename Key >
using NodeRef = std::shared_ptr< const Node< Key > >
 

Enumerations

enum class  Fragment {
  JUST_0 , JUST_1 , PK_K , PK_H ,
  OLDER , AFTER , SHA256 , HASH256 ,
  RIPEMD160 , HASH160 , WRAP_A , WRAP_S ,
  WRAP_C , WRAP_D , WRAP_V , WRAP_J ,
  WRAP_N , AND_V , AND_B , OR_B ,
  OR_C , OR_D , OR_I , ANDOR ,
  THRESH , MULTI , MULTI_A
}
 The different node types in miniscript. More...
 
enum class  Availability { NO , YES , MAYBE }
 
enum class  MiniscriptContext { P2WSH , TAPSCRIPT }
 

Functions

constexpr Type operator""_mst (const char *c, size_t l)
 Literal operator to construct Type objects. More...
 
template<typename Key , typename... Args>
NodeRef< Key > MakeNodeRef (Args &&... args)
 Construct a miniscript node as a shared_ptr. More...
 
constexpr bool IsTapscript (MiniscriptContext ms_ctx)
 Whether the context Tapscript, ensuring the only other possibility is P2WSH. More...
 
template<typename Ctx >
NodeRef< typename Ctx::Key > FromString (const std::string &str, const Ctx &ctx)
 
template<typename Ctx >
NodeRef< typename Ctx::Key > FromScript (const CScript &script, const Ctx &ctx)
 

Typedef Documentation

◆ NodeRef

template<typename Key >
using miniscript::NodeRef = typedef std::shared_ptr<const Node<Key> >

Definition at line 187 of file miniscript.h.

◆ Opcode

using miniscript::Opcode = typedef std::pair<opcodetype, std::vector<unsigned char> >

Definition at line 184 of file miniscript.h.

Enumeration Type Documentation

◆ Availability

Enumerator
NO 
YES 
MAYBE 

Definition at line 228 of file miniscript.h.

◆ Fragment

enum miniscript::Fragment
strong

The different node types in miniscript.

Enumerator
JUST_0 

OP_0.

JUST_1 

OP_1.

PK_K 

[key]

PK_H 

OP_DUP OP_HASH160 [keyhash] OP_EQUALVERIFY.

OLDER 

[n] OP_CHECKSEQUENCEVERIFY

AFTER 

[n] OP_CHECKLOCKTIMEVERIFY

SHA256 

OP_SIZE 32 OP_EQUALVERIFY OP_SHA256 [hash] OP_EQUAL.

HASH256 

OP_SIZE 32 OP_EQUALVERIFY OP_HASH256 [hash] OP_EQUAL.

RIPEMD160 

OP_SIZE 32 OP_EQUALVERIFY OP_RIPEMD160 [hash] OP_EQUAL.

HASH160 

OP_SIZE 32 OP_EQUALVERIFY OP_HASH160 [hash] OP_EQUAL.

WRAP_A 

OP_TOALTSTACK [X] OP_FROMALTSTACK.

WRAP_S 

OP_SWAP [X].

WRAP_C 

[X] OP_CHECKSIG

WRAP_D 

OP_DUP OP_IF [X] OP_ENDIF.

WRAP_V 

[X] OP_VERIFY (or -VERIFY version of last opcode in X)

WRAP_J 

OP_SIZE OP_0NOTEQUAL OP_IF [X] OP_ENDIF.

WRAP_N 

[X] OP_0NOTEQUAL

AND_V 

[X] [Y]

AND_B 

[X] [Y] OP_BOOLAND

OR_B 

[X] [Y] OP_BOOLOR

OR_C 

[X] OP_NOTIF [Y] OP_ENDIF

OR_D 

[X] OP_IFDUP OP_NOTIF [Y] OP_ENDIF

OR_I 

OP_IF [X] OP_ELSE [Y] OP_ENDIF.

ANDOR 

[X] OP_NOTIF [Z] OP_ELSE [Y] OP_ENDIF

THRESH 

[X1] ([Xn] OP_ADD)* [k] OP_EQUAL

MULTI 

[k] [key_n]* [n] OP_CHECKMULTISIG (only available within P2WSH context)

MULTI_A 

[key_0] OP_CHECKSIG ([key_n] OP_CHECKSIGADD)* [k] OP_NUMEQUAL (only within Tapscript ctx)

Definition at line 194 of file miniscript.h.

◆ MiniscriptContext

Enumerator
P2WSH 
TAPSCRIPT 

Definition at line 234 of file miniscript.h.

Function Documentation

◆ FromScript()

template<typename Ctx >
NodeRef<typename Ctx::Key> miniscript::FromScript ( const CScript script,
const Ctx &  ctx 
)
inline

Definition at line 2616 of file miniscript.h.

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

◆ FromString()

template<typename Ctx >
NodeRef<typename Ctx::Key> miniscript::FromString ( const std::string &  str,
const Ctx &  ctx 
)
inline

Definition at line 2611 of file miniscript.h.

Here is the caller graph for this function:

◆ IsTapscript()

constexpr bool miniscript::IsTapscript ( MiniscriptContext  ms_ctx)
constexpr

Whether the context Tapscript, ensuring the only other possibility is P2WSH.

Definition at line 240 of file miniscript.h.

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

◆ MakeNodeRef()

template<typename Key , typename... Args>
NodeRef<Key> miniscript::MakeNodeRef ( Args &&...  args)

Construct a miniscript node as a shared_ptr.

Definition at line 191 of file miniscript.h.

◆ operator""_mst()

constexpr Type miniscript::operator""_mst ( const char *  c,
size_t  l 
)
inlineconstexpr

Literal operator to construct Type objects.

The only way to publicly construct a Type is using this literal operator.

Definition at line 153 of file miniscript.h.