Protocol development · 00505898
Lotus VM opcode index
Look up instruction bytes for the Lotus V2 virtual machine and follow each group to its stack effects and validation rules.
The VM uses signed little-endian two’s-complement integers. Ordinary numeric operands are 16 to 1,024 bytes. Canonical booleans are 16 bytes. The VM specification defines the accepted widths and arithmetic rules. Bitcoin Script’s signed-magnitude ScriptNum belongs to the historical specifications.
This index follows the candidate allocation at the revision above. Legacy hardfork activation dates do not choose its rules. See the extension rules for unassigned bytes, 0xff framing, and the reserved EMITLOG instruction.
Download the opcode registry (JSON) · Validation and conformance
Literals and pushes
Read literals and pushes semantics
Control flow
| Instruction | Byte |
|---|---|
NOP | 0x60 |
IF | 0x61 |
NOTIF | 0x62 |
ELSE | 0x63 |
ENDIF | 0x64 |
VERIFY | 0x65 |
RETURN | 0x66 |
ENUMERATE | 0x69 |
ENDENUMERATE | 0x6a |
BREAK | 0x6b |
EMITLOG | 0x6c |
Stack operations
Read stack operations semantics
| Instruction | Byte |
|---|---|
TOALTSTACK | 0x70 |
FROMALTSTACK | 0x71 |
2DROP | 0x72 |
2DUP | 0x73 |
3DUP | 0x74 |
2OVER | 0x75 |
2ROT | 0x76 |
2SWAP | 0x77 |
DEPTH | 0x78 |
DROP | 0x79 |
DUP | 0x7a |
NIP | 0x7b |
OVER | 0x7c |
PICK | 0x7d |
ROLL | 0x7e |
ROT | 0x7f |
SWAP | 0x80 |
TUCK | 0x81 |
Byte strings
| Instruction | Byte |
|---|---|
CAT | 0x88 |
SPLIT | 0x89 |
NUM2BIN | 0x8a |
BIN2NUM | 0x8b |
SIZE | 0x8c |
INVERT | 0x8d |
AND | 0x8e |
OR | 0x8f |
XOR | 0x90 |
EQUAL | 0x91 |
EQUALVERIFY | 0x92 |
LESSSWAP | 0x93 |
RAWLEFTBITSHIFT | 0x94 |
Arithmetic
| Instruction | Byte |
|---|---|
1ADD | 0x98 |
1SUB | 0x99 |
NEGATE | 0x9a |
ABS | 0x9b |
NOT | 0x9c |
0NOTEQUAL | 0x9d |
ADD | 0x9e |
SUB | 0x9f |
MUL | 0xa0 |
DIV | 0xa1 |
MOD | 0xa2 |
MULPOW2 | 0xa3 |
BOOLAND | 0xa4 |
BOOLOR | 0xa5 |
NUMEQUAL | 0xa6 |
NUMEQUALVERIFY | 0xa7 |
NUMNOTEQUAL | 0xa8 |
LESSTHAN | 0xa9 |
GREATERTHAN | 0xaa |
LESSTHANOREQUAL | 0xab |
GREATERTHANOREQUAL | 0xac |
MIN | 0xad |
MAX | 0xae |
WITHIN | 0xaf |
ADDCARRY | 0xb0 |
SUBCARRY | 0xb1 |
MUL128_WIDE | 0xb2 |
LOG | 0xb3 |
SQRT | 0xb4 |
Cryptography
| Instruction | Byte |
|---|---|
SHA256 | 0xb8 |
HASH256 | 0xb9 |
BLAKE3 | 0xba |
CHECKSIG | 0xbb |
CHECKSIGVERIFY | 0xbc |
CHECKDATASIG | 0xbd |
LEAFHASH | 0xbe |
NODEHASH | 0xbf |
MERKLEROOT_SORTED | 0xc0 |
MERKLEROOT_INDEXED | 0xc1 |
SIGHASH | 0xc2 |
STATEHASH | 0xc3 |
Transaction
| Instruction | Byte |
|---|---|
TXVERSION | 0xc8 |
TXINPUTCOUNT | 0xc9 |
TXOUTPUTCOUNT | 0xca |
TXMINTCOUNT | 0xcb |
TXLOCKTIME | 0xcc |
TXLOCKKIND | 0xcd |
TXID | 0xce |
CHAINID | 0xcf |
Inputs
| Instruction | Byte |
|---|---|
INPUTINDEX | 0xd0 |
INPUTFLAGS | 0xd1 |
OUTPOINTTXID | 0xd2 |
OUTPOINTINDEX | 0xd3 |
INPUTSEQUENCENUMBER | 0xd4 |
INPUTPATHINDEX | 0xd5 |
UTXOVALUE | 0xd6 |
UTXOTOKENID | 0xd7 |
UTXOBRANCHCOUNT | 0xd8 |
UTXOBRANCH | 0xd9 |
UTXOPATHCOUNT | 0xda |
UTXOPATH | 0xdb |
UTXOOUTPUT | 0xdc |
UTXOREQUIRESBRANCH | 0xdd |
UTXOFLAGS | 0xde |
INPUTWITNESSARG | 0xdf |
Outputs and state
Read outputs and state semantics
| Instruction | Byte |
|---|---|
OUTPUTFLAGS | 0xe0 |
OUTPUTVALUE | 0xe1 |
OUTPUTTOKENID | 0xe2 |
OUTPUTBRANCHCOUNT | 0xe3 |
OUTPUTBRANCH | 0xe4 |
OUTPUTPATHCOUNT | 0xe5 |
OUTPUTPATH | 0xe6 |
OUTPUTRECORD | 0xe7 |
OUTPUTREQUIRESBRANCH | 0xe8 |
OUTPUTEXCLUSIVEBRANCH | 0xe9 |
OUTPUTCONTINUESBRANCH | 0xea |
ENFORCEOUTPUT | 0xeb |
TXTOKENBALANCE | 0xec |
STATEVERIFY | 0xed |
UTXOSTATEROOT | 0xee |
OUTPUTSTATEROOT | 0xef |
Invocation, locks and extensions
Read invocation, locks and extensions semantics
| Instruction | Byte |
|---|---|
ACTIVEBYTECODE | 0xf0 |
INVOCATIONKIND | 0xf1 |
BRANCHROOT | 0xf2 |
CHECKLOCKTIMEVERIFY | 0xf3 |
CHECKSEQUENCEVERIFY | 0xf4 |
ACTIVEBRANCHINDEX | 0xf5 |
ACTIVEWITNESSINDEX | 0xf6 |
EXT2 | 0xff |