Author: ZmnSCPxj 2019-06-06 07:30:13
Published on: 2019-06-06T07:30:13+00:00
A proposal has been made to retract the proposed opcode 'OP_CHECKOUTPUTSHASHVERIFY' and replace it with 'OP_CHECKTXDIGESTVERIFY'. The new opcode would pull a 33-byte value from the stack, consisting of a sha256 hash and a sighash-byte, and add a new sighash value corresponding to the set of info you want to include in the hash. This change would allow Turing-complete smart contracts by using `OP_LEFT` and `OP_CAT`. The Script would check that the spending transaction witness value is indeed the spending transaction and verify that the spent transaction witness value is also the spent transaction by hashing it and comparing the bytes. The script can then extract a commitment of itself by extracting the output of the spent transaction and enforce that a correct next-state is used in the spending transaction. If the state is too large to fit in a standard `OP_RETURN`, then the current state can be passed in as a witness and validated against a hash commitment in an `OP_RETURN` output.
Updated on: 2023-06-13T19:14:20.038442+00:00