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

InstructionByte
ZERO0x00
PUSH_10x01
PUSH_20x02
PUSH_30x03
PUSH_40x04
PUSH_50x05
PUSH_60x06
PUSH_70x07
PUSH_80x08
PUSH_90x09
PUSH_100x0a
PUSH_110x0b
PUSH_120x0c
PUSH_130x0d
PUSH_140x0e
PUSH_150x0f
PUSH_160x10
PUSH_170x11
PUSH_180x12
PUSH_190x13
PUSH_200x14
PUSH_210x15
PUSH_220x16
PUSH_230x17
PUSH_240x18
PUSH_250x19
PUSH_260x1a
PUSH_270x1b
PUSH_280x1c
PUSH_290x1d
PUSH_300x1e
PUSH_310x1f
PUSH_320x20
PUSH_330x21
PUSH_340x22
PUSH_350x23
PUSH_360x24
PUSH_370x25
PUSH_380x26
PUSH_390x27
PUSH_400x28
PUSH_410x29
PUSH_420x2a
PUSH_430x2b
PUSH_440x2c
PUSH_450x2d
PUSH_460x2e
PUSH_470x2f
PUSH_480x30
PUSH_490x31
PUSH_500x32
PUSH_510x33
PUSH_520x34
PUSH_530x35
PUSH_540x36
PUSH_550x37
PUSH_560x38
PUSH_570x39
PUSH_580x3a
PUSH_590x3b
PUSH_600x3c
PUSH_610x3d
PUSH_620x3e
PUSH_630x3f
PUSH_640x40
PUSH_650x41
PUSH_660x42
PUSH_670x43
PUSH_680x44
PUSH_690x45
PUSH_700x46
PUSH_710x47
PUSH_720x48
PUSH_730x49
PUSH_740x4a
PUSH_750x4b
PUSHDATA0x4c
NEGATIVE_ONE0x4d
ONE0x4e
TWO0x4f
THREE0x50
FOUR0x51
FIVE0x52
SIX0x53
SEVEN0x54
EIGHT0x55
NINE0x56
TEN0x57
ELEVEN0x58
TWELVE0x59
THIRTEEN0x5a
FOURTEEN0x5b
FIFTEEN0x5c
SIXTEEN0x5d

Control flow

Read control flow semantics

InstructionByte
NOP0x60
IF0x61
NOTIF0x62
ELSE0x63
ENDIF0x64
VERIFY0x65
RETURN0x66
ENUMERATE0x69
ENDENUMERATE0x6a
BREAK0x6b
EMITLOG0x6c

Stack operations

Read stack operations semantics

InstructionByte
TOALTSTACK0x70
FROMALTSTACK0x71
2DROP0x72
2DUP0x73
3DUP0x74
2OVER0x75
2ROT0x76
2SWAP0x77
DEPTH0x78
DROP0x79
DUP0x7a
NIP0x7b
OVER0x7c
PICK0x7d
ROLL0x7e
ROT0x7f
SWAP0x80
TUCK0x81

Byte strings

Read byte strings semantics

InstructionByte
CAT0x88
SPLIT0x89
NUM2BIN0x8a
BIN2NUM0x8b
SIZE0x8c
INVERT0x8d
AND0x8e
OR0x8f
XOR0x90
EQUAL0x91
EQUALVERIFY0x92
LESSSWAP0x93
RAWLEFTBITSHIFT0x94

Arithmetic

Read arithmetic semantics

InstructionByte
1ADD0x98
1SUB0x99
NEGATE0x9a
ABS0x9b
NOT0x9c
0NOTEQUAL0x9d
ADD0x9e
SUB0x9f
MUL0xa0
DIV0xa1
MOD0xa2
MULPOW20xa3
BOOLAND0xa4
BOOLOR0xa5
NUMEQUAL0xa6
NUMEQUALVERIFY0xa7
NUMNOTEQUAL0xa8
LESSTHAN0xa9
GREATERTHAN0xaa
LESSTHANOREQUAL0xab
GREATERTHANOREQUAL0xac
MIN0xad
MAX0xae
WITHIN0xaf
ADDCARRY0xb0
SUBCARRY0xb1
MUL128_WIDE0xb2
LOG0xb3
SQRT0xb4

Cryptography

Read cryptography semantics

InstructionByte
SHA2560xb8
HASH2560xb9
BLAKE30xba
CHECKSIG0xbb
CHECKSIGVERIFY0xbc
CHECKDATASIG0xbd
LEAFHASH0xbe
NODEHASH0xbf
MERKLEROOT_SORTED0xc0
MERKLEROOT_INDEXED0xc1
SIGHASH0xc2
STATEHASH0xc3

Transaction

Read transaction semantics

InstructionByte
TXVERSION0xc8
TXINPUTCOUNT0xc9
TXOUTPUTCOUNT0xca
TXMINTCOUNT0xcb
TXLOCKTIME0xcc
TXLOCKKIND0xcd
TXID0xce
CHAINID0xcf

Inputs

Read inputs semantics

InstructionByte
INPUTINDEX0xd0
INPUTFLAGS0xd1
OUTPOINTTXID0xd2
OUTPOINTINDEX0xd3
INPUTSEQUENCENUMBER0xd4
INPUTPATHINDEX0xd5
UTXOVALUE0xd6
UTXOTOKENID0xd7
UTXOBRANCHCOUNT0xd8
UTXOBRANCH0xd9
UTXOPATHCOUNT0xda
UTXOPATH0xdb
UTXOOUTPUT0xdc
UTXOREQUIRESBRANCH0xdd
UTXOFLAGS0xde
INPUTWITNESSARG0xdf

Outputs and state

Read outputs and state semantics

InstructionByte
OUTPUTFLAGS0xe0
OUTPUTVALUE0xe1
OUTPUTTOKENID0xe2
OUTPUTBRANCHCOUNT0xe3
OUTPUTBRANCH0xe4
OUTPUTPATHCOUNT0xe5
OUTPUTPATH0xe6
OUTPUTRECORD0xe7
OUTPUTREQUIRESBRANCH0xe8
OUTPUTEXCLUSIVEBRANCH0xe9
OUTPUTCONTINUESBRANCH0xea
ENFORCEOUTPUT0xeb
TXTOKENBALANCE0xec
STATEVERIFY0xed
UTXOSTATEROOT0xee
OUTPUTSTATEROOT0xef

Invocation, locks and extensions

Read invocation, locks and extensions semantics

InstructionByte
ACTIVEBYTECODE0xf0
INVOCATIONKIND0xf1
BRANCHROOT0xf2
CHECKLOCKTIMEVERIFY0xf3
CHECKSEQUENCEVERIFY0xf4
ACTIVEBRANCHINDEX0xf5
ACTIVEWITNESSINDEX0xf6
EXT20xff