`OP_FOLD`: A Looping Construct For Bitcoin SCRIPT



Summary:

The discussion revolves around the usefulness of op_fold in Bitcoin. While op_fold can provide bandwidth savings by programming as compression, it has limited applications as scripts that can't use jets are not commonly used. Jets cover the majority of use cases that op fold would otherwise have. Users could implement smaller scripts without buy-in from a relay level change in Bitcoin with op_fold, but even this could be done with jets. To address the problem, the suggestion is to provide more general operations, and users should identify their most important needs so they can be implemented on the blockchain layer. The more general an opcode is, the harder it is to understand the boundaries, so implementing the most general opcodes that we are able to reason fully about and come to a consensus on is suggested. However, op_fold can still be useful with the restrictions proposed, and it is implementable in current Bitcoin SCRIPT without increasing the attack surface.


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