Malleable booleans



Summary:

In a discussion thread, Pieter Todd mentioned that he intended to only allow 0 and 1 as booleans, meaning that evaluating any stack element as a boolean that is not either of these will result in script failure. This applies to inputs to OP_IF and OP_NOTIF, inputs to OP_BOOLAND and OP_BOOLOR, and the resulting final element on the stack for validity. Pieter's goal is to ensure that there is an equivalent non-malleable script for every possible script. Although there may still be holes in this idea, BIP62 covers it for standard scripts. Peter Todd added to the conversation by suggesting that if a script author fails to properly 'bool-ize' every boolean-using path, one can always create a nVersion=1 transaction manually to spend the output, preventing funds from getting lost.


Updated on: 2023-05-19T19:24:18.869327+00:00