For each opcode is given: its nemonic without the leading OP_, its hexadecimal byte value, the number of stack items needed (poped) during execution, the number of stack items pushed (after execution). A * after the needed stack items indicates that further bytes from the script following the current opcode are needed. A # indicates that items on the alternative stack are poped/pushed. A @ indicates that further (global) data from transcations is needed.
Different colors indicate different semantic execution groups of opcodes.

_FALSE 0x00 0 ; 1(0)

- 0x01 0 *; 1(1)

- 0x02 0 *; 1(2)

- 0x03 0 *; 1(3)

- 0x04 0 *; 1(4)

- 0x04 0 *; 1(5)

- 0x06 0 *; 1(6)

- 0x07 0 *; 1(7)

- 0x08 0 *; 1(8)

- 0x09 0 *; 1(9)

- 0x0a 0 *; 1(10)

- 0x0b 0 *; 1(11)

- 0x0c 0 *; 1(12)

- 0x0d 0 *; 1(13)

- 0x0e 0 *; 1(14)

- 0x0f 0 *; 1(15)

- 0x10 0 *; 1(16)

- 0x11 0 *; 1(17)

- 0x12 0 *; 1(18)

- 0x13 0 *; 1(19)

- 0x14 0 *; 1(20)

- 0x15 0 *; 1(21)

- 0x16 0 *; 1(22)

- 0x17 0 *; 1(23)

- 0x18 0 *; 1(24)

- 0x19 0 *; 1(25)

- 0x1a 0 *; 1(26)

- 0x1b 0 *; 1(27)

- 0x1c 0 *; 1(28)

- 0x1d 0 *; 1(29)

- 0x1e 0 *; 1(30)

- 0x1f 0 *; 1(31)

- 0x20 0 *; 1(32)

- 0x21 0 *; 1(33)

- 0x22 0 *; 1(34)

- 0x23 0 *; 1(35)

- 0x24 0 *; 1(36)

- 0x25 0 *; 1(37)

- 0x26 0 *; 1(38)

- 0x27 0 *; 1(39)

- 0x28 0 *; 1(40)

- 0x29 0 *; 1(41)

- 0x2a 0 *; 1(42)

- 0x2b 0 *; 1(43)

- 0x2c 0 *; 1(44)

- 0x2d 0 *; 1(45)

- 0x2e 0 *; 1(46)

- 0x2f 0 *; 1(47)

- 0x30 0 *; 1(48)

- 0x31 0 *; 1(49)

- 0x32 0 *; 1(50)

- 0x33 0 *; 1(51)

- 0x34 0 *; 1(52)

- 0x35 0 *; 1(53)

- 0x36 0 *; 1(54)

- 0x37 0 *; 1(55)

- 0x38 0 *; 1(56)

- 0x39 0 *; 1(57)

- 0x3a 0 *; 1(58)

- 0x3b 0 *; 1(59)

- 0x3c 0 *; 1(60)

- 0x3d 0 *; 1(61)

- 0x3e 0 *; 1(62)

- 0x3f 0 *; 1(63)

- 0x40 0 *; 1(64)

- 0x41 0 *; 1(65)

- 0x42 0 *; 1(66)

- 0x43 0 *; 1(67)

- 0x44 0 *; 1(68)

- 0x45 0 *; 1(69)

- 0x46 0 *; 1(70)

- 0x47 0 *; 1(71)

- 0x48 0 *; 1(72)

- 0x49 0 *; 1(73)

- 0x4a 0 *; 1(74)

- 0x4b 0 *; 1(75)

_PUSHDATA1 0x4c 0 *; 1(0 - 255)

_PUSHDATA2 0x4d 0 *; 1(0 - 2^16-1)

_PUSHDATA4 0x4e 0 *; 1(0 - 2^32-1)

_1NEGATE 0x4f 0 ; 1(1)

_RESERVED 0x50

_1 0x51 0 ; 1(1)

_2 0x52 0 ; 1(1)

_3 0x53 0 ; 1(1)

_4 0x54 0 ; 1(1)

_5 0x55 0 ; 1(1)

_6 0x56 0 ; 1(1)

_7 0x57 0 ; 1(1)

_8 0x58 0 ; 1(1)

_9 0x59 0 ; 1(1)

_10 0x5a 0 ; 1(1)

_11 0x5b 0 ; 1(1)

_12 0x5c 0 ; 1(1)

_13 0x5d 0 ; 1(1)

_14 0x5e 0 ; 1(1)

_15 0x5f 0 ; 1(1)

_16 0x60 0 ; 1(1)

_NOP 0x61 0 ; 0

_VER 0x62

_IF 0x63 1 ; 0

_NOTIF 0x64 1 ; 0

_VERIF 0x65

_VERNOTIF 0x66

_ELSE 0x67 0 ; 0

_ENDIF 0x68 0 ; 0

_VERIFY 0x69 1 ; 0/1

_RETURN 0x6a 0 ; 0

_TOALTSTACK 0x6b 1 ; 0

_FROMALTSTACK 0x6c 0 #; 1

_2DROP 0x6d 2 ; 0

_2DUP 0x6e 2 ; 4

_3DU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 1 ; 1

_SHA1 0xa7 1 ; 1

_SHA256 0xa8 1 ; 1

_HASH160 0xa9 1 ; 1

_HASH256 0xaa 1 ; 1

_CODESEPARATOR 0xab 0 ; 0

_CHECKSIG 0xac 2 @; 1

_CHECKSIGVERIFY 0xad 2 @; 0/1

_CHECKMULTISIG 0xae 2n+2 @; 1

_CHECKMULTISIGVERIFY 0xaf 2n+2 @; 0/1

_NOP1 0xb0 0 ; 0

_NOP2 0xb1 0 ; 0

_NOP3 0xb2 0 ; 0

_NOP4 0xb3 0 ; 0

_NOP5 0xb4 0 ; 0

_NOP6 0xb5 0 ; 0

_NOP7 0xb6 0 ; 0

_NOP8 0xb7 0 ; 0

_NOP9 0xb8 0 ; 0

_NOP10 0xb9 0 ; 0

- 0xba

- 0xbb

- 0xbc

- 0xbd

- 0xbe

- 0xbf

- 0xc0

- 0xc1

- 0xc2

- 0xc3

- 0xc4

- 0xc5

- 0xc6

- 0xc7

- 0xc8

- 0xc9

- 0xca

- 0xcb

- 0xcc

- 0xcd

- 0xce

- 0xcf

- 0xd0

- 0xd1

- 0xd2

- 0xd3

- 0xd4

- 0xd5

- 0xd6

- 0xd7

- 0xd8

- 0xd9

- 0xda

- 0xdb

- 0xdc

- 0xdd

- 0xde

- 0xdf

- 0xe0

- 0xe1

- 0xe2

- 0xe3

- 0xe4

- 0xe5

- 0xe6

- 0xe7

- 0xe8

- 0xe9

- 0xea

- 0xeb

- 0xec

- 0xed

- 0xee

- 0xef

- 0xf0

- 0xf1

- 0xf2

- 0xf3

- 0xf4

- 0xf5

- 0xf6

- 0xf7

- 0xf8

- 0xf9

- 0xfa

_SMALLINTEGER 0xfb

_PUBKEYS 0xfc

_PUBKEYHASH 0xfd

_PUBKEY 0xfe

_INVALIDOPCODE 0xff

The opcode value 0x00 with nemonic OP_FALSE is also named OP_0 and the opcode value 0x51 with nemonic OP_1 as also named OP_TRUE.

opcode descriptions

It follows for each opcode less than decimal 185 (hexa 0xba) a description for its usage. The columns entiteld nemonic, decimal and Hex should be evident. The column input gives the needed items of the stack (and the alternate stack) and the column output indicates the resulting items on the stack (and the alternate stack). The naming of the entries in these two columns is chosen to reflect their interpretation. x,x0,x1,... means arbitrary or no interpretation, a, b and c as a signed integer value, n,index,size and depth non-negative integer values, Boolean as either a true or false.
Some of the more complicated opcodes are disabled out of concern that the client might have (and has) a bug in the current implementation due to the historically not as 2-complement interpretations of the byte vectors as numerical values (the most significant byte holds the sign of the byte vectors).

Constants

Nemonic

Decimal

Hex

Input

Output

Description

OP_FALSE, OP_0

0

0x00

Nothing

Empty string

A byte vector of length 0 is pushed onto the stack. (Thus, it is not a no-op!)

(no official nemonics)

1 - 75

0x01 - 0x4b

(operands)

x

The next <opcode>-many bytes are to be pushed onto the stack.

OP_PUSHDATA1

76

0x4c

(operands)

x

The next byte contains the number of bytes to be pushed onto the stack which follow this byte.

OP_PUSHDATA2

77

0x4d

(operands)

x

The next two bytes contain the number of bytes to be pushed onto the stack which follow theses 2 bytes.

OP_PUSHDATA4

78

0x4e

(operands)

x

The next four bytes contain the number of bytes to be pushed onto the stack which follow theses 4 bytes.

OP_1NEGATE

79

0x4f

Nothing

-1

The number -1 is pushed onto the stack.

OP_1, OP_TRUE

81

0x51

Nothing

1

The number 1 is pushed onto the stack.

OP_2 - OP_16

82 - 96

0x52 - 0x60

Nothing

2-16

The value <opcode>-80 (thus, one of 2 - 16) is pushed onto the stack.

Flow control

Nemonic

Decimal

Hex

Input

Output

Description

OP_NOP

97

0x61

Nothing

Nothing

Does nothing.

OP_IF

99

0x63

Boolean

Nothing

If the top stack value is not 0, the statements are executed. The top stack value is removed. Lead in a logcial <value> then [statements] [else [statements]] endif expression

OP_NOTIF

100

0x64

Boolean

Nothing

If the top stack value is 0, the statements are executed. The top stack value is removed. Lead in a logcial <value> then [statements] [else [statements]] endif expression

OP_ELSE

103

0x67

Nothing

Nothing

If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not.

OP_ENDIF

104

0x68

Nothing

Nothing

Ends a logcial If <value> then [statements] [else [statements]] expression

OP_VERIFY

105

0x69

Boolean

Nothing / False

If top stack value is not true then marks transaction as invalid . A value true is removed, but false is not.

OP_RETURN

106

0x6a

Nothing

Nothing

Marks transaction as invalid.

Stack

Nemonic

Decimal

Hex

Input

Output

Description

OP_TOALTSTACK

107

0x6b

x1 (alt)

(alt x1)

Puts the input onto the top of the alt stack. Removes it from the (main) stack.

OP_FROMALTSTACK

108

0x6c

(alt x1)

x1 (alt)

Puts the input onto the top of the (main) stack. Removes it from the alt stack.

OP_2DROP

109

0x6d

x1 x2

Nothing

Removes the top two stack items.

OP_2DUP

110

0x6e

x1 x2

x1 x2 x1 x2

Duplicates the top two stack items.

OP_3DUP

111

0x6f

x1 x2 x3

x1 x2 x3 x1 x2 x3

Duplicates the top three stack items.

OP_2OVER

112

0x70

x1 x2 x3 x4

x1 x2 x3 x4 x1 x2

Copies the pair of items two spaces back in the stack to the front.

OP_2ROT

113

0x71

x1 x2 x3 x4 x5 x6

x3 x4 x5 x6 x1 x2

The fifth and sixth items back are moved to the top of the stack.

OP_2SWAP

114

0x72

x1 x2 x3 x4

x3 x4 x1 x2

Swaps the top two pairs of items.

OP_IFDUP

115

0x73

x

x / x x

If the top stack value is not 0, duplicate it.

OP_DEPTH

116

0x74

Nothing

depth

Puts the number of stack items onto the stack as one little-endian coded byte-vector

OP_DROP

117

0x75

x

Nothing

Removes the top stack item.

OP_DUP

118

0x76

x

x x

Duplicates the top stack item.

OP_NIP

119

0x77

x1 x2

x2

Removes the second-to-top stack item.

OP_OVER

120

0x78

x1 x2

x1 x2 x1

Copies the second-to-top stack item to the top.

OP_PICK

121

0x79

xn ... x2 x1 x0 <n>

xn ... x2 x1 x0 xn

The item n back in the stack is copied to the top.

OP_ROLL

122

0x7a

xn ... x2 x1 x0 <n>

... x2 x1 x0 xn

The item n back in the stack is moved to the top.

OP_ROT

123

0x7b

x1 x2 x3

x2 x3 x1

The top three items on the stack are rotated to the left.

OP_SWAP

124

0x7c

x1 x2

x2 x1

The top two items on the stack are swapped.

OP_TUCK

125

0x7d

x1 x2

x2 x1 x2

The item at the top of the stack is copied and inserted before the second-to-top item.

Splice

Nemonic

Decimal

Hex

Input

Output

Description

OP_CAT

126

0x7e

x1 x2

out

Concatenates two strings resp. byte vectors. Currently disabled.

OP_SUBSTR

127

0x7f

x index size

out

Returns the section started at position <index> and of length <size> of a string resp. byte vector. Currently disabled.

OP_LEFT

128

0x80

x index

out

Keeps only characters left of the specified point in a string. Currently disabled.

OP_RIGHT

129

0x81

x index

out

Keeps only characters right of the specified point in a string. Currently disabled.

The entire transaction's outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for a further, extern specified hash and the given public key. If it is, 1 is returned, 0 otherwise.

For each signature and public key pair, OP_CHECKSIG is executed. If more public keys than signatures are listed, some key/sig pairs can fail. All signatures need to match a public key. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.