From 7cedafc5412857404e9a6c3450b100cb8ee4081a Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 7 Feb 2021 19:18:39 -0800 Subject: 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. --- src/pubkey.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pubkey.h') 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 bytes); + /** Construct an x-only pubkey from a normal pubkey. */ + explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(Span(pubkey.begin() + 1, pubkey.begin() + 33)) {} + /** Verify a Schnorr signature against this public key. * * sigbytes must be exactly 64 bytes. -- cgit v1.2.3