[PROPOSAL] OP_TX: generalized covenants reduced to OP_CHECKTEMPLATEVERIFY



Summary:

A proposal has been put forward to add a v1 tapscript opcode for generic covenants, with only OP_SUCCESS if used a-la OP_CHECKTEMPLATEVERIFY. This allows for an obvious use case and clean future expansion. Unknown flag patterns are also OP_SUCCESS, although some potential uses are documented for thoroughness. The lack of OP_CAT has been sidestepped by the first bit, while the latter bit allows for OP_TXHASH semantics and avoiding stack element limits. Several bits are defined, but only those marked with an asterisk have to be defined for this soft fork. The others can have semantics later. The proposal provides an enumeration of what can be committed to, thus making it clear what is not committed. Bits that separate concatenation and hashing provide a simple mechanism for template-style commitments or individual elements' programmatic treatment. The lack of double-hashing of scriptsigs and other fields means that hashing done for SIGHASH_ALL cannot be simply re-used.The OP_SUCCESS semantic is only valid in tapscript v1, which means that this does not allow covenants for v0 segwit or pre-segwit inputs. If covenants prove useful, dedicated opcodes can be provided for those cases like OP_CHECKTEMPLATEVERIFY.


Updated on: 2023-06-15T20:41:49.546747+00:00