Malleable booleans



Summary:

A new type of malleability, relating to the interpretation of booleans, has been discovered while working on a BIP62 implementation. According to the post, any byte array with non-zero bytes in it (ignoring the highest bit of the last byte) is interpreted as true, and anything else as false. The code for dealing with booleans is not consistent, and this means that scripts using booleans as inputs will be inherently malleable.The poster suggests that changing BIP62 to state that interpreted booleans must be of minimal encoded size would help resolve this issue. However, they acknowledge that passing in booleans to guide some OP_IF's during execution of several alternatives can actually be useful.The post concludes by soliciting opinions for or against this proposed change.


Updated on: 2023-05-19T19:23:41.060696+00:00