Merkle branch verification & tail-call semantics for generalized MAST



Summary:

The Bitcoin-dev community is discussing the possibility of allowing static analysis of sigop. While some believe this would be a useful feature, others worry about the security implications of interpreting arbitrary data as code. One proposed solution to this issue is to add a flag to stack items in the Script interpreter marking them as "executable" or "non-executable", similar to how computers mark pages for executable space protection. This would allow for OP_PUSHCODE to set the flag to "executable" and subject the pushed item to sigops limits and other static analysis limits. TAILCALL would require the top item on the stack to have the "executable" flag, but all other operations could treat "executable" items as data. Unbounded TAILCALL would be allowed with an upper bound on the number of operations computed through static analysis. The proposal is believed to be fully backwards compatible while maintaining the ability to perform static analysis with TAILCALL and never interpreting computed values as executable code.


Updated on: 2023-06-12T18:18:45.603898+00:00