A node in a miniscript expression.

Synopsis

Declared in <script/miniscript.h>

template<typename Key>
class Node;

Member Functions

Name

Description

Node [constructor]

Constructors

~Node [destructor]

Destroys the node, tearing down subexpressions iteratively to avoid deep recursion.

operator=

Assignment operators

CheckDuplicateKey

Check whether there is no duplicate key across this fragment and all its sub‐fragments.

CheckOpsLimit

Check the ops limit of this script against the consensus limit.

CheckStackSize

Check the maximum stack size for this script against the policy limit.

CheckTimeLocksMix

Check whether there is no satisfaction path that contains both timelocks and heightlocks

Clone

Creates a deep copy of this node and all its subexpressions.

Data

Accesses the data bytes carried by this expression.

DuplicateKeyCheck

Update duplicate key information in this Node.

FindInsaneSub

Find an insane subnode which has no insane children. Nullptr if there is none.

Fragment

Accesses the fragment (node type) of this node.

GetExecStackSize

Return the maximum size of the stack during execution of this script.

GetMsCtx

Return the script context for this node.

GetOps

Return the maximum number of ops needed to satisfy this script non‐malleably.

GetStackSize

Return the maximum number of stack elements needed to satisfy this script non‐malleably.

GetStaticOps

Return the number of ops in the script (not counting the dynamic ones that depend on execution).

GetType

Return the expression type.

GetWitnessSize

Return the maximum size in bytes of a witness to satisfy this script non‐malleably. Note this does not include the witness script push.

IsBKW

Whether this node is of type B, K or W. (That is, anything but V.)

IsNonMalleable

Check whether this script can always be satisfied in a non‐malleable way.

IsNotSatisfiable

Whether no satisfaction exists for this node.

IsSane

Check whether this node is safe as a script on its own.

IsSaneSubexpression

Whether the apparent policy of this node matches its script semantics. Doesn't guarantee it is a safe script on its own.

IsSatisfiable

Determine whether a Miniscript node is satisfiable. fn(node) will be invoked for all key, time, and hashing nodes, and should return their satisfiability.

IsValid

Check whether this node is valid at all.

IsValidTopLevel

Check whether this node is valid as a script on its own.

K

Accesses the k parameter of this node.

Keys

Accesses the keys used by this expression.

NeedsSignature

Check whether this script always needs a signature.

Satisfy

Produce a witness for this script, if possible and given the information available in the context. The non‐malleable satisfaction is guaranteed to be valid if it exists, and ValidSatisfaction() is true. If IsSane() holds, this satisfaction is guaranteed to succeed in case the node's conditions are satisfied (private keys and hash preimages available, locktimes satisfied).

ScriptSize

Return the size of the script for this expression (faster than ToScript().size()).

Subs

Accesses the subexpressions of this node.

ToScript

Builds the CScript encoding of this Miniscript expression.

ToString

Produces the textual (policy‐language) representation of this Miniscript.

ValidSatisfactions

Whether successful non‐malleable satisfactions are guaranteed to be valid.

operator==

Equality testing.

Friends

Name

Description

miniscript::Compare

Compare two miniscript subtrees, using a non‐recursive algorithm.

Non-Member Functions

Name

Description

ForEachNode

Unordered traversal of a miniscript node tree.

FromScript

Decodes a Miniscript from a Bitcoin Script.

FromString

Parses a Miniscript from its textual (policy‐language) representation.

Created with MrDocs