Speedy covenants (OP_CAT2)



Summary:

The email discusses the use of `OP_CAT` and `OP_SUBSTR` in Bitcoin Script. The suggestion is to use `OP_SUBSTR` instead of `OP_CAT`, as it will always result in smaller code and one byte as the smallest unit in the script. However, `OP_SUBSTR` can also be used to synthesize an effective `OP_CAT`. Recursive covenants are not caused by the memory allocated by trivial `OP_DUP OP_CAT OP_DUP OP_CAT` repetition. Instead, `OP_CAT` enables recursive covenants because it allows quining to be done. Quining is a technique to pass a script with a copy of its code so that it can enforce the output passed to the exact same input script. `OP_SUBSTR` will enable quining and implement recursive covenants. However, it cannot be enabled unless we are reasonably sure that recursive covenants are safe. Recursive covenants are not Turing-complete but are equivalent to total functional programming with codata.


Updated on: 2023-06-15T20:33:50.728995+00:00