Opcodes · control · enabled

OP_NOTIF (0x64)

Pops the top item; if it is false, runs the statements that follow up to OP_ELSE or OP_ENDIF. Any value works as the condition. BCH does not require it to be minimally encoded.

Verified
Stack in → out
cond → ∅
Since
Original Bitcoin script
Cost
Base instruction cost 100. Control stack depth is limited to 100 (2025 VM limits).
Bitcoin status
Behaves differently in Bitcoin (BTC)Tapscript (BIP-342) requires the condition to be exactly empty or 0x01, and BTC relay policy asks the same of SegWit v0 scripts. BCH has no such rule.

Example

OP_NOTIF OP_RETURN OP_ENDIF

Step through it opcode by opcode in Bitauth IDE, the in-browser BCH VM debugger.

Sources

  1. Libauth BCH_2023_05 opcodes (bch-2023-opcodes.ts)
  2. CHIP-2021-05 VM Limits: Targeted Virtual Machine Limits
  3. BCHN script interpreter (interpreter.cpp)
  4. BCHN script verification flags (policy.h)
  5. BIP-342: Validation of Taproot Scripts