Author: Alex Schoof 2022-05-11 23:32:34
Published on: 2022-05-11T23:32:34+00:00
A proposal has been put forth for a v1 tapscript opcode that enables generic covenants. The proposal suggests using an OP_SUCCESS opcode unless it is used a-la OP_CHECKTEMPLATEVERIFY, which provides an obvious use case with clean future expansion. If experience shows that repurposing OP_NOP4 as a shortcut is useful optimization, then it can be done in the future. The proposal builds on Russell O'Connor's TXHASH, with Anthony Towns' modification via extending the opcode. The proposal defines certain bits that only need to be defined for this soft fork, and others can have semantics later. For thoroughness, some future potential uses are documented here. Note that pushing more than 1000 elements on the stack or an element more than 512 bytes will fail due to BIP-342 resource limits. By enumerating what exactly can be committed to, it's absolutely clear what is and isn't committed. The bits which separate concatenation and hashing provide a simple mechanism for template-style (i.e. CTV-style) commitments or programmatic treatment of individual elements (e.g. amounts). The lack of double-hashing of scriptsigs and other fields means we cannot simply reuse hashing done for SIGHASH_ALL. The OP_SUCCESS semantic is only valid in tapscript v1, so this does not allow covenants for v0 segwit or pre-segwit inputs. Dedicated opcodes can be provided for those cases if covenants prove useful.
Updated on: 2023-06-15T20:41:36.103559+00:00