O(1) OP_IF/NOTIF/ELSE/ENDIF script implementation by sipa · Pull Request #16902 · bitcoin/bitcoin

While investigating what mechanisms are possible to maximize the per-opcode verification cost of scripts, I noticed that the logic for determining whether a particular opcode is to be executed is O...