aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.h
diff options
context:
space:
mode:
authorJohnson Lau <jl2012@xbt.hk>2020-09-11 14:33:10 -0700
committerPieter Wuille <pieter@wuille.net>2020-10-12 17:06:38 -0700
commit5de246ca8159dcffaa4c136a60c8bfed2028e2ee (patch)
tree6360222a98a2f75e01882ad8c01f771b4f4c0b8b /src/script/script.h
parent9eb590894f15ff40806039bfd32972fbc260e30d (diff)
Implement Taproot signature hashing (BIP 341)
This implements the new sighashing scheme from BIP341, with all relevant whole-transaction values precomputed once and cached. Includes changes to PrecomputedTransactionData by Pieter Wuille.
Diffstat (limited to 'src/script/script.h')
-rw-r--r--src/script/script.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/script/script.h b/src/script/script.h
index c1f2b66921..fcf3e29362 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -44,6 +44,11 @@ static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20
// SEQUENCE_FINAL).
static const uint32_t LOCKTIME_MAX = 0xFFFFFFFFU;
+// Tag for input annex. If there are at least two witness elements for a transaction input,
+// and the first byte of the last element is 0x50, this last element is called annex, and
+// has meanings independent of the script
+static constexpr unsigned int ANNEX_TAG = 0x50;
+
template <typename T>
std::vector<unsigned char> ToByteVector(const T& in)
{