`OP_FOLD`: A Looping Construct For Bitcoin SCRIPT



Summary:

New jets in Bitcoin do not require a consensus change and can be added as a way to optimize scripts, save bytes in transmission, and reduce processing power. Nodes that recognize a particular jet can remove the extraneous bytes and only extra transmission and processing-time is needed for nodes that don't support it. Security is not directly affected by the release of a new jet, but costs may change. The proposal of adding a new jet would require a debate and review to be added to Bitcoin core or whichever Bitcoin software one wants to add it to. A list of registered jets could inform what jets would be worth building an optimized function for. Implementing more general opcodes is useful, but their boundaries should be well understood before being added to Bitcoin. The most general opcodes that can be fully reasoned about and come to a consensus on should be implemented. The implementation of `OP_FOLD` is possible given the restrictions proposed by ZmnSCPxj without increasing attack surface.


Updated on: 2023-06-15T17:22:24.298769+00:00