Merge 3caee16946 into merged_master (Bitcoin PR #19953)

Taproot :D
This commit is contained in:
Andrew Poelstra 2020-12-01 02:54:57 +00:00
commit e765fc93ea
45 changed files with 3034 additions and 139 deletions

View file

@ -48,6 +48,17 @@ 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;
// 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;
// ELEMENTS:
// Number of confirms on parent chain required to confirm on sidechain.
static const unsigned int DEFAULT_PEGIN_CONFIRMATION_DEPTH = 8;
@ -199,6 +210,9 @@ enum opcodetype
OP_NOP9 = 0xb8,
OP_NOP10 = 0xb9,
// Opcode added by BIP 342 (Tapscript)
OP_CHECKSIGADD = 0xba,
OP_INVALIDOPCODE = 0xff,
};
@ -581,4 +595,7 @@ struct CScriptWitness
uint32_t GetSerializedSize() const;
};
/** Test for OP_SUCCESSx opcodes as defined by BIP342. */
bool IsOpSuccess(const opcodetype& opcode);
#endif // BITCOIN_SCRIPT_SCRIPT_H