[#miniscript-Node] = xref:miniscript.adoc[miniscript]::Node :relfileprefix: ../ :mrdocs: A node in a miniscript expression. == Synopsis Declared in `<script/miniscript.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Key> class Node; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:miniscript/Node/2constructor-06.adoc[`Node`] [.small]#[constructor]# | Constructors | xref:miniscript/Node/2destructor.adoc[`~Node`] [.small]#[destructor]# | Destroys the node, tearing down subexpressions iteratively to avoid deep recursion. | xref:miniscript/Node/operator_assign-00.adoc[`operator=`] | Assignment operators | xref:miniscript/Node/CheckDuplicateKey.adoc[`CheckDuplicateKey`] | Check whether there is no duplicate key across this fragment and all its sub‐fragments. | xref:miniscript/Node/CheckOpsLimit.adoc[`CheckOpsLimit`] | Check the ops limit of this script against the consensus limit. | xref:miniscript/Node/CheckStackSize.adoc[`CheckStackSize`] | Check the maximum stack size for this script against the policy limit. | xref:miniscript/Node/CheckTimeLocksMix.adoc[`CheckTimeLocksMix`] | Check whether there is no satisfaction path that contains both timelocks and heightlocks | xref:miniscript/Node/Clone.adoc[`Clone`] | Creates a deep copy of this node and all its subexpressions. | xref:miniscript/Node/Data.adoc[`Data`] | Accesses the data bytes carried by this expression. | xref:miniscript/Node/DuplicateKeyCheck.adoc[`DuplicateKeyCheck`] | Update duplicate key information in this Node. | xref:miniscript/Node/FindInsaneSub.adoc[`FindInsaneSub`] | Find an insane subnode which has no insane children. Nullptr if there is none. | xref:miniscript/Node/Fragment.adoc[`Fragment`] | Accesses the fragment (node type) of this node. | xref:miniscript/Node/GetExecStackSize.adoc[`GetExecStackSize`] | Return the maximum size of the stack during execution of this script. | xref:miniscript/Node/GetMsCtx.adoc[`GetMsCtx`] | Return the script context for this node. | xref:miniscript/Node/GetOps.adoc[`GetOps`] | Return the maximum number of ops needed to satisfy this script non‐malleably. | xref:miniscript/Node/GetStackSize.adoc[`GetStackSize`] | Return the maximum number of stack elements needed to satisfy this script non‐malleably. | xref:miniscript/Node/GetStaticOps.adoc[`GetStaticOps`] | Return the number of ops in the script (not counting the dynamic ones that depend on execution). | xref:miniscript/Node/GetType.adoc[`GetType`] | Return the expression type. | xref:miniscript/Node/GetWitnessSize.adoc[`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. | xref:miniscript/Node/IsBKW.adoc[`IsBKW`] | Whether this node is of type B, K or W. (That is, anything but V.) | xref:miniscript/Node/IsNonMalleable.adoc[`IsNonMalleable`] | Check whether this script can always be satisfied in a non‐malleable way. | xref:miniscript/Node/IsNotSatisfiable.adoc[`IsNotSatisfiable`] | Whether no satisfaction exists for this node. | xref:miniscript/Node/IsSane.adoc[`IsSane`] | Check whether this node is safe as a script on its own. | xref:miniscript/Node/IsSaneSubexpression.adoc[`IsSaneSubexpression`] | Whether the apparent policy of this node matches its script semantics. Doesn't guarantee it is a safe script on its own. | xref:miniscript/Node/IsSatisfiable.adoc[`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. | xref:miniscript/Node/IsValid.adoc[`IsValid`] | Check whether this node is valid at all. | xref:miniscript/Node/IsValidTopLevel.adoc[`IsValidTopLevel`] | Check whether this node is valid as a script on its own. | xref:miniscript/Node/K.adoc[`K`] | Accesses the k parameter of this node. | xref:miniscript/Node/Keys.adoc[`Keys`] | Accesses the keys used by this expression. | xref:miniscript/Node/NeedsSignature.adoc[`NeedsSignature`] | Check whether this script always needs a signature. | xref:miniscript/Node/Satisfy.adoc[`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). | xref:miniscript/Node/ScriptSize.adoc[`ScriptSize`] | Return the size of the script for this expression (faster than ToScript().size()). | xref:miniscript/Node/Subs.adoc[`Subs`] | Accesses the subexpressions of this node. | xref:miniscript/Node/ToScript.adoc[`ToScript`] | Builds the CScript encoding of this Miniscript expression. | xref:miniscript/Node/ToString-028.adoc[`ToString`] | Produces the textual (policy‐language) representation of this Miniscript. | xref:miniscript/Node/ValidSatisfactions.adoc[`ValidSatisfactions`] | Whether successful non‐malleable satisfactions are guaranteed to be valid. | xref:miniscript/Node/operator_eq.adoc[`operator==`] | Equality testing. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:miniscript/Compare.adoc[miniscript::Compare]` | Compare two miniscript subtrees, using a non‐recursive algorithm. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:miniscript/ForEachNode.adoc[`ForEachNode`] | Unordered traversal of a miniscript node tree. | xref:miniscript/FromScript.adoc[`FromScript`] | Decodes a Miniscript from a Bitcoin Script. | xref:miniscript/FromString.adoc[`FromString`] | Parses a Miniscript from its textual (policy‐language) representation. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#