[#miniscript-Node]
= xref:miniscript.adoc[miniscript]::Node
:relfileprefix: ../
:mrdocs:

A node in a miniscript expression&period;

== Synopsis

Declared in `&lt;script&sol;miniscript&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Key&gt;
class Node;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:miniscript/Node/2constructor-06.adoc[`Node`]         [.small]#[constructor]#
| Constructors
| xref:miniscript/Node/2destructor.adoc[`&#126;Node`] [.small]#[destructor]#
| Destroys the node, tearing down subexpressions iteratively to avoid deep recursion&period;
| xref:miniscript/Node/operator_assign-00.adoc[`operator&equals;`] 
| Assignment operators
| xref:miniscript/Node/CheckDuplicateKey.adoc[`CheckDuplicateKey`] 
| Check whether there is no duplicate key across this fragment and all its sub&hyphen;fragments&period;
| xref:miniscript/Node/CheckOpsLimit.adoc[`CheckOpsLimit`] 
| Check the ops limit of this script against the consensus limit&period;
| xref:miniscript/Node/CheckStackSize.adoc[`CheckStackSize`] 
| Check the maximum stack size for this script against the policy limit&period;
| 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&period;
| xref:miniscript/Node/Data.adoc[`Data`] 
| Accesses the data bytes carried by this expression&period;
| xref:miniscript/Node/DuplicateKeyCheck.adoc[`DuplicateKeyCheck`] 
| Update duplicate key information in this Node&period;
| xref:miniscript/Node/FindInsaneSub.adoc[`FindInsaneSub`] 
| Find an insane subnode which has no insane children&period; Nullptr if there is none&period;
| xref:miniscript/Node/Fragment.adoc[`Fragment`] 
| Accesses the fragment (node type) of this node&period;
| xref:miniscript/Node/GetExecStackSize.adoc[`GetExecStackSize`] 
| Return the maximum size of the stack during execution of this script&period;
| xref:miniscript/Node/GetMsCtx.adoc[`GetMsCtx`] 
| Return the script context for this node&period;
| xref:miniscript/Node/GetOps.adoc[`GetOps`] 
| Return the maximum number of ops needed to satisfy this script non&hyphen;malleably&period;
| xref:miniscript/Node/GetStackSize.adoc[`GetStackSize`] 
| Return the maximum number of stack elements needed to satisfy this script non&hyphen;malleably&period;
| xref:miniscript/Node/GetStaticOps.adoc[`GetStaticOps`] 
| Return the number of ops in the script (not counting the dynamic ones that depend on execution)&period;
| xref:miniscript/Node/GetType.adoc[`GetType`] 
| Return the expression type&period;
| xref:miniscript/Node/GetWitnessSize.adoc[`GetWitnessSize`] 
| Return the maximum size in bytes of a witness to satisfy this script non&hyphen;malleably&period; Note this does not include the witness script push&period;
| xref:miniscript/Node/IsBKW.adoc[`IsBKW`] 
| Whether this node is of type B, K or W&period; (That is, anything but V&period;)
| xref:miniscript/Node/IsNonMalleable.adoc[`IsNonMalleable`] 
| Check whether this script can always be satisfied in a non&hyphen;malleable way&period;
| xref:miniscript/Node/IsNotSatisfiable.adoc[`IsNotSatisfiable`] 
| Whether no satisfaction exists for this node&period;
| xref:miniscript/Node/IsSane.adoc[`IsSane`] 
| Check whether this node is safe as a script on its own&period;
| xref:miniscript/Node/IsSaneSubexpression.adoc[`IsSaneSubexpression`] 
| Whether the apparent policy of this node matches its script semantics&period; Doesn&apos;t guarantee it is a safe script on its own&period;
| xref:miniscript/Node/IsSatisfiable.adoc[`IsSatisfiable`] 
| Determine whether a Miniscript node is satisfiable&period; fn(node) will be invoked for all key, time, and hashing nodes, and should return their satisfiability&period;
| xref:miniscript/Node/IsValid.adoc[`IsValid`] 
| Check whether this node is valid at all&period;
| xref:miniscript/Node/IsValidTopLevel.adoc[`IsValidTopLevel`] 
| Check whether this node is valid as a script on its own&period;
| xref:miniscript/Node/K.adoc[`K`] 
| Accesses the k parameter of this node&period;
| xref:miniscript/Node/Keys.adoc[`Keys`] 
| Accesses the keys used by this expression&period;
| xref:miniscript/Node/NeedsSignature.adoc[`NeedsSignature`] 
| Check whether this script always needs a signature&period;
| xref:miniscript/Node/Satisfy.adoc[`Satisfy`] 
| Produce a witness for this script, if possible and given the information available in the context&period; The non&hyphen;malleable satisfaction is guaranteed to be valid if it exists, and ValidSatisfaction() is true&period; If IsSane() holds, this satisfaction is guaranteed to succeed in case the node&apos;s conditions are satisfied (private keys and hash preimages available, locktimes satisfied)&period;
| xref:miniscript/Node/ScriptSize.adoc[`ScriptSize`] 
| Return the size of the script for this expression (faster than ToScript()&period;size())&period;
| xref:miniscript/Node/Subs.adoc[`Subs`] 
| Accesses the subexpressions of this node&period;
| xref:miniscript/Node/ToScript.adoc[`ToScript`] 
| Builds the CScript encoding of this Miniscript expression&period;
| xref:miniscript/Node/ToString-028.adoc[`ToString`] 
| Produces the textual (policy&hyphen;language) representation of this Miniscript&period;
| xref:miniscript/Node/ValidSatisfactions.adoc[`ValidSatisfactions`] 
| Whether successful non&hyphen;malleable satisfactions are guaranteed to be valid&period;
| xref:miniscript/Node/operator_eq.adoc[`operator&equals;&equals;`] 
| Equality testing&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:miniscript/Compare.adoc[miniscript::Compare]`
| Compare two miniscript subtrees, using a non&hyphen;recursive algorithm&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:miniscript/ForEachNode.adoc[`ForEachNode`]
| Unordered traversal of a miniscript node tree&period;
| xref:miniscript/FromScript.adoc[`FromScript`]
| Decodes a Miniscript from a Bitcoin Script&period;
| xref:miniscript/FromString.adoc[`FromString`]
| Parses a Miniscript from its textual (policy&hyphen;language) representation&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
