Alternative to OP_EVAL



Summary:

In a discussion about the OP_EVAL proposal, Joel suggested restricting the number of executions allowed per transaction to avoid unlimited looping. He proposed setting 3 as the maximum allowed executions. However, roconnor argued that even if OP_EVAL allowed infinite depth, it would still require explicitly specifying all operations performed, since there is no way of looping. Gavin himself showed how to use OP_EVAL to loop using OP_PUSHDATA {OP_DUP OP_EVAL} OP_DUP OP_EVAL. This allows duplicating the code on the stack and could lead to Turing completeness with arbitrary depth. Despite the potential for expressive power, some consider OP_EVAL to be dangerous.


Updated on: 2023-06-05T01:25:33.271115+00:00