aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2021-02-07 19:18:39 -0800
committerPieter Wuille <pieter@wuille.net>2021-05-24 12:14:16 -0700
commit7cedafc5412857404e9a6c3450b100cb8ee4081a (patch)
tree9ec014407feccbe45190dce5fdb4f77c6203708e /src/pubkey.h
parent90fcac365e1616779b40a69736428435df75fdf2 (diff)
downloadbitcoin-7cedafc5412857404e9a6c3450b100cb8ee4081a.tar.xz
Add tr() descriptor (derivation only, no signing)
This adds a new descriptor with syntax e.g. tr(KEY,{S1,{{S2,S3},S4}) where KEY is a key expression for the internal key and S_i are script expression for the leaves. They have to be organized in nested {A,B} groups, with exactly two elements. tr() only exists at the top level, and inside the script expressions only pk() scripts are allowed for now.
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index 4de1807a7f..152a48dd18 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -237,6 +237,9 @@ public:
/** Construct an x-only pubkey from exactly 32 bytes. */
explicit XOnlyPubKey(Span<const unsigned char> bytes);
+ /** Construct an x-only pubkey from a normal pubkey. */
+ explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(Span<const unsigned char>(pubkey.begin() + 1, pubkey.begin() + 33)) {}
+
/** Verify a Schnorr signature against this public key.
*
* sigbytes must be exactly 64 bytes.