Opcodes · function · enabled
OP_DEFINE (0x89)
Stores a function body (bytecode) in the function table under an identifier of 0–7 bytes. Functions are immutable: redefining an identifier fails. This byte was OP_RESERVED1 before May 2026.
Verified
- Stack in → out
- body id → ∅
- Cost
- Base instruction cost 100 plus the byte length of the function body. Defined functions share the 1,000 memory-slot limit with stack and altstack items.
- Bitcoin status
- Not in Bitcoin (BTC)0x89 is OP_RESERVED1 in BTC; an OP_SUCCESS code in Tapscript.
Example
<OP_DUP OP_MUL> OP_0 OP_DEFINE OP_3 OP_0 OP_INVOKE OP_9 OP_EQUAL Step through it opcode by opcode in Bitauth IDE, the in-browser BCH VM debugger.