Dealing with OP_IF and OP_NOTIF malleability



Summary:

In a discussion on the bitcoin-dev mailing list, Tier Nolan raised a question regarding whether or not using the OP_PUSH opcodes to do the push would be a viable option. Specifically, he asked if using the OP_0 opcode would give a zero length byte array and if the script provided would return true. Another member of the group, Oleg Andreev, suggested defining one and zero as arrays of length one, however, this was in contradiction with the previous statement that they should be minimally encoded. In response, a member of the group stated that as long as OP_IF/OP_NOTIF interprets the argument as a number, zero-padded number and negative zero are already prohibited in BIP62. The conversation was taking place in 2015 and was in relation to implementing a proposal alongside BIP62.


Updated on: 2023-06-11T00:55:21.714157+00:00