On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos <javierpmateos@gmail.com> wrote:
The solution of splitting the string and using OP_CAT only
works if the exact position of the substring is known. How would a case
be handled where the substring could be in any position
Whoever
produces the signature/witness for spending the coin always knows the
position already, so the script can always be modified to instead take
that position as an additional input.
This is a
general principle: the point of scripts is verifying provided
information, not computing it. As another example, this means that there
is no need for a division or square root opcode if one has a
multiplication opcode.
--
Pieter