An alternative: OP_CAT & OP_CHECKSIGFROMSTACK



Summary:

The Bitcoin Script was designed to be a flexible programmable system, providing generic features for various purposes. However, some parts of the system have been mostly unsuccessful with opcodes needing to be disabled due to DoS vectors or consensus bugs, and they are not practical where still enabled in BTC or on other chains where they have been re-enabled. In light of this, Russell O'Connor proposes simply implementing OP_CAT and OP_CHECKSIGFROMSTACKVERIFY. CAT's usefulness has been acknowledged, but there is less certainty about CHECKSIG that takes the message from the stack. O'Connor suggests transaction introspection including simulated SIGHASH_ANYPREVOUT, which is chaperoned by nature due to construction. Simulating an ANYPREVOUT sig with a data signature requires checking several conditions. To achieve this, O'Connor provides a script that checks all the conditions. The generic building block approach embodies what is meant by "programmable money." However, the level of abstraction provided by this approach does not seem suitable for practical purposes. A simpler way to construct these transactions could be achieved by having a "CHECK_SIG_MSG_VERIFY" opcode that accepts [sig msg key], which does "sig key CHECKSIGVERIFY," but also ensures that the provided message was what was passed into bip-schnorr.


Updated on: 2023-05-20T20:35:35.621923+00:00