aboutsummaryrefslogtreecommitdiff
path: root/src/script/standard.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2021-06-04 15:06:16 -0700
committerPieter Wuille <pieter@wuille.net>2021-06-18 11:28:47 -0700
commitd637a9b397816e34652d0c4d383308e39770737a (patch)
treefde3fcc1ca404e53e353b8883c95c64a4fa1479b /src/script/standard.h
parentc7388e5ada394b7fe94d6263fb02e9dd28ab367e (diff)
Taproot descriptor inference
Diffstat (limited to 'src/script/standard.h')
-rw-r--r--src/script/standard.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/standard.h b/src/script/standard.h
index 285dd4c116..ac4e2f3276 100644
--- a/src/script/standard.h
+++ b/src/script/standard.h
@@ -327,4 +327,12 @@ public:
TaprootSpendData GetSpendData() const;
};
+/** Given a TaprootSpendData and the output key, reconstruct its script tree.
+ *
+ * If the output doesn't match the spenddata, or if the data in spenddata is incomplete,
+ * std::nullopt is returned. Otherwise, a vector of (depth, script, leaf_ver) tuples is
+ * returned, corresponding to a depth-first traversal of the script tree.
+ */
+std::optional<std::vector<std::tuple<int, CScript, int>>> InferTaprootTree(const TaprootSpendData& spenddata, const XOnlyPubKey& output);
+
#endif // BITCOIN_SCRIPT_STANDARD_H