Rationale
If OP_CAT
was available, it could be used to combine multiple stack elements,
that get verified with OP_CHECKSIGFROMSTACK
as a valid state update.
OP_PAIRCOMMIT
solves this specific problem without introducing a wide range
of potentially controversial new behaviors, such as novel 2-way peg mechanisms.
Alternatives discussed
OP_CAT
allows for fine grained introspection possibly bigint operations and
extending the arithmetic capabilities of bitcoin script using lookup tables.
These would predictably allow for the same functionality as OP_CAT
for
introspection purposes, since verification of a computation is largely
equivalent with carrying it out. Bigint and new arithmetic operations would
be hard or even impossible.
These would be of very limited general use and hard to rationalize without
OP_CAT. Their complexity and resource cost is hard to justified for vector
commitments only. Compatibility considerations with taproot MAST were also
hard to resolve without knowing what other opcodes may be activated in the
future.
- ‘Kitty’ CAT (result or inputs limited in size)
The original idea would have limited the maximum size of OP_CAT
output to a
size that is smaller than the smallest sighash preimage, thus disabling the
introspection capabilities and trivial ways to extend the arithmetic repertoir
of bitcoin script. This turned out to be an awkward, arbitrary and offering
weak .
- OP_CHECKTEMPLATEVERIFY commiting to the taproot annex in tapscript
A CTV template can be considered a sighash, however relaxing the relay policy
to take advantage of this change would make various endogenous asset protocols
more efficient, and therefore be controversial. There is also no consensus on
how to use or how to structure the annex.
- OP_CHECKSIGFROMSTACK on n elements as message
This was previosuly discussed and also implemented, it complicates the code
and is a pretty arbitrary coupling of behaviors.
The obvious generalized solution for committing to n stack elements, however
it involves looping and hard to argue about setting the proper limits to it.