New BIP: Dealing with OP_IF and OP_NOTIF malleability in P2WSH



Summary:

On August 17, 2016, Luke Dashjr and Johnson Lau discussed a workaround for the issue of malleability in Bitcoin transactions. The suggested code to replicate the original behavior was deemed ugly by Dashjr, who argued that it was unnecessary in most real-world use cases. He proposed simplifying the code by replacing "OP_SIZE OP_IF" with "OP_SIZE OP_0NOTEQUAL OP_IF", as OP_SIZE must return a valid MINIMALDATA number. However, Lau noted that this workaround does not fix malleability since any non-0x01 values are still valid FALSE. In some cases, enforcing MINIMALIF may require one more witness byte. Dashjr suggested making it a relay policy first and deciding on a softfork later.


Updated on: 2023-05-19T23:45:12.389254+00:00