aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/script.h')
-rw-r--r--src/script/script.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/script/script.h b/src/script/script.h
index fcf3e29362..974cde4984 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -49,6 +49,12 @@ static const uint32_t LOCKTIME_MAX = 0xFFFFFFFFU;
// has meanings independent of the script
static constexpr unsigned int ANNEX_TAG = 0x50;
+// Validation weight per passing signature (Tapscript only, see BIP 342).
+static constexpr uint64_t VALIDATION_WEIGHT_PER_SIGOP_PASSED = 50;
+
+// How much weight budget is added to the witness size (Tapscript only, see BIP 342).
+static constexpr uint64_t VALIDATION_WEIGHT_OFFSET = 50;
+
template <typename T>
std::vector<unsigned char> ToByteVector(const T& in)
{
@@ -192,6 +198,9 @@ enum opcodetype
OP_NOP9 = 0xb8,
OP_NOP10 = 0xb9,
+ // Opcode added by BIP 342 (Tapscript)
+ OP_CHECKSIGADD = 0xba,
+
OP_INVALIDOPCODE = 0xff,
};
@@ -560,4 +569,7 @@ struct CScriptWitness
std::string ToString() const;
};
+/** Test for OP_SUCCESSx opcodes as defined by BIP342. */
+bool IsOpSuccess(const opcodetype& opcode);
+
#endif // BITCOIN_SCRIPT_SCRIPT_H