Implement Taproot validation (BIP 341)

This includes key path spending and script path spending, but not the
Tapscript execution implementation (leaf 0xc0 remains unemcumbered in
this commit).

Includes constants for various aspects of the consensus rules suggested
by Jeremy Rubin.
This commit is contained in:
Pieter Wuille
2020-09-11 14:33:45 -07:00
parent 0664f5fe1f
commit 8bbed4b7ac
6 changed files with 90 additions and 7 deletions

View File

@@ -56,6 +56,7 @@ typedef enum ScriptError_t
/* softfork safeness */
SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS,
SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,
SCRIPT_ERR_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION,
/* segregated witness */
SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH,
@@ -70,6 +71,7 @@ typedef enum ScriptError_t
SCRIPT_ERR_SCHNORR_SIG_SIZE,
SCRIPT_ERR_SCHNORR_SIG_HASHTYPE,
SCRIPT_ERR_SCHNORR_SIG,
SCRIPT_ERR_TAPROOT_WRONG_CONTROL_SIZE,
/* Constant scriptCode */
SCRIPT_ERR_OP_CODESEPARATOR,