diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-05-23 18:32:30 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-05-24 12:14:16 -0700 |
commit | 5f6cc8daa83700d1c949d968a5cf0d935be337b7 (patch) | |
tree | a07dcd19162977dd995f9a96d66bcaa2273db343 /src/pubkey.h | |
parent | 2fbfb1becb3c0c109cd7c30b245b51da22039932 (diff) |
Add XOnlyPubKey::CreateTapTweak
Diffstat (limited to 'src/pubkey.h')
-rw-r--r-- | src/pubkey.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h index e5d9d08b52..b9d5f5d622 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -13,6 +13,7 @@ #include <uint256.h> #include <cstring> +#include <optional> #include <vector> const unsigned int BIP32_EXTKEY_SIZE = 74; @@ -251,6 +252,9 @@ public: * Merkle root, and parity. */ bool CheckTapTweak(const XOnlyPubKey& internal, const uint256& merkle_root, bool parity) const; + /** Construct a Taproot tweaked output point with this point as internal key. */ + std::optional<std::pair<XOnlyPubKey, bool>> CreateTapTweak(const uint256* merkle_root) const; + const unsigned char& operator[](int pos) const { return *(m_keydata.begin() + pos); } const unsigned char* data() const { return m_keydata.begin(); } static constexpr size_t size() { return decltype(m_keydata)::size(); } |