Alternative to OP_EVAL



Summary:

In an email exchange from 2011, Pieter Wuille proposed an alternative to Gavin's proposal for OP_EVAL. He suggested OP_CHECKEDEVAL, which is a more restricted version of OP_EVAL. The new proposal executes its script in an independent environment that inherits only the main stack. It does not touch the stack or altstack and looks at the last literal pushed on the stack as the script to be executed. The outer script can hide information from the inner script by moving it temporarily to the alt stack. The OP_EVAL is an effective no-op for the execution state of the outer script, except for potentially causing failure if the subscript doesn't parse or doesn't terminate successfully. It also pops an element from the literal-only stack. A pay-to-script-hash is redeemed using [script input] >.


Updated on: 2023-05-18T22:52:46.574900+00:00