Safer sighashes and more granular SIGHASH_NOINPUT



Summary:

The discussion on the bitcoin-dev mailing list revolves around the need to replace OP_CODESEPARATOR, which is currently used to create a signature that covers a specific branch within an input Script code. The original motivation for this operation is unknown, but it is clear that its current usage is time-consuming and not efficient. One suggestion put forward is to add an internal counter that increments on every control flow operator and have the signature cover the value of this counter. Alternatively, every Bitcoin Script program could be divided into blocks delimited by these control flow operators, and the signature would cover the index of the block in which the OP_CHECKSIG occurs. To achieve the above, MAST (Merkelized Abstract Syntax Trees) has been proposed as a replacement for redundant operations like OP_IF, which complicates the protocol and reduces privacy. With MAST in place, the emphasis should be on encouraging people to use it to maximize fungibility rather than improving the functionality of OP_IF. This will help to make the process more efficient and improve the overall performance. While there are other ways to replace the remaining useful behavior of OP_CODESEPARATOR, the focus should be on finding a solution that works best for all parties involved.


Updated on: 2023-05-20T18:00:19.218052+00:00