Skip to main content

OpCode

bitcoinjs-lib v0.2.9-beta.16


bitcoinjs-lib / OpCode

Class: OpCode

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:8

This is a list of all Script words, also known as opcodes, commands, or functions. Opcodes used in [BTC Script][https://en.bitcoin.it/wiki/Script](https://en.bitcoin.it/wiki/Script)

Onchain​

Constructors​

new OpCode()​

new OpCode(): OpCode

Returns​

OpCode

Properties​

OP_0​

readonly static OP_0: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:14

An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)

Name​

OP_0

Constant​

OpCodeType('00')


OP_0NOTEQUAL​

readonly static OP_0NOTEQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:496

Returns 0 if the input is 0. 1 otherwise.

Name​

OP_0NOTEQUAL

Constant​

OpCodeType('92')


OP_1​

readonly static OP_1: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:56

The number 1 is pushed onto the stack.

Name​

OP_1

Constant​

OpCodeType('51')


OP_10​

readonly static OP_10: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:116

The number 10 is pushed onto the stack.

Name​

OP_10

Constant​

OpCodeType('5a')


OP_11​

readonly static OP_11: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:122

The number 11 is pushed onto the stack.

Name​

OP_11

Constant​

OpCodeType('5b')


OP_12​

readonly static OP_12: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:128

The number 12 is pushed onto the stack.

Name​

OP_12

Constant​

OpCodeType('5c')


OP_13​

readonly static OP_13: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:134

The number 13 is pushed onto the stack.

Name​

OP_13

Constant​

OpCodeType('5d')


OP_14​

readonly static OP_14: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:140

The number 14 is pushed onto the stack.

Name​

OP_14

Constant​

OpCodeType('5e')


OP_15​

readonly static OP_15: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:146

The number 15 is pushed onto the stack.

Name​

OP_15

Constant​

OpCodeType('5f')


OP_16​

readonly static OP_16: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:152

The number 16 is pushed onto the stack.

Name​

OP_16

Constant​

OpCodeType('60')


OP_1ADD​

readonly static OP_1ADD: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:454

1 is added to the input.

Name​

OP_1ADD

Constant​

OpCodeType('8b')


OP_1NEGATE​

readonly static OP_1NEGATE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:44

The number -1 is pushed onto the stack.

Name​

OP_1NEGATE

Constant​

OpCodeType('4f')


OP_1SUB​

readonly static OP_1SUB: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:460

1 is subtracted from the input.

Name​

OP_1SUB

Constant​

OpCodeType('8c')


OP_2​

readonly static OP_2: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:68

The number 2 is pushed onto the stack.

Name​

OP_2

Constant​

OpCodeType('52')


OP_2DIV​

readonly static OP_2DIV: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:472

The input is divided by 2. DISABLED now. (This opcode is scheduled to be re-enabled in the Chronicle update)

Name​

OP_2DIV

Constant​

OpCodeType('8e')


OP_2DROP​

readonly static OP_2DROP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:271

Removes the top two stack items.

Name​

OP_2DROP

Constant​

OpCodeType('6d')


OP_2DUP​

readonly static OP_2DUP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:277

Duplicates the top two stack items.

Name​

OP_2DUP

Constant​

OpCodeType('6e')


OP_2MUL​

readonly static OP_2MUL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:466

The input is multiplied by 2. DISABLED now. (This opcode is scheduled to be re-enabled in the Chronicle update)

Name​

OP_2MUL

Constant​

OpCodeType('8d')


OP_2OVER​

readonly static OP_2OVER: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:289

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

Name​

OP_2OVER

Constant​

OpCodeType('70')


OP_2ROT​

readonly static OP_2ROT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:295

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

Name​

OP_2ROT

Constant​

OpCodeType('71')


OP_2SWAP​

readonly static OP_2SWAP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:301

Swaps the top two pairs of items.

Name​

OP_2SWAP

Constant​

OpCodeType('72')


OP_3​

readonly static OP_3: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:74

The number 3 is pushed onto the stack.

Name​

OP_3

Constant​

OpCodeType('53')


OP_3DUP​

readonly static OP_3DUP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:283

Duplicates the top three stack items.

Name​

OP_3DUP

Constant​

OpCodeType('6f')


OP_4​

readonly static OP_4: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:80

The number 4 is pushed onto the stack.

Name​

OP_4

Constant​

OpCodeType('54')


OP_5​

readonly static OP_5: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:86

The number 5 is pushed onto the stack.

Name​

OP_5

Constant​

OpCodeType('55')


OP_6​

readonly static OP_6: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:92

The number 6 is pushed onto the stack.

Name​

OP_6

Constant​

OpCodeType('56')


OP_7​

readonly static OP_7: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:98

The number 7 is pushed onto the stack.

Name​

OP_7

Constant​

OpCodeType('57')


OP_8​

readonly static OP_8: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:104

The number 8 is pushed onto the stack.

Name​

OP_8

Constant​

OpCodeType('58')


OP_9​

readonly static OP_9: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:110

The number 9 is pushed onto the stack.

Name​

OP_9

Constant​

OpCodeType('59')


OP_ABS​

readonly static OP_ABS: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:484

The input is made positive.

Name​

OP_ABS

Constant​

OpCodeType('90')


OP_ADD​

readonly static OP_ADD: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:502

a is added to b.

Name​

OP_ADD

Constant​

OpCodeType('93')


OP_AND​

readonly static OP_AND: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:411

Boolean and between each bit in the inputs.

Name​

OP_AND

Constant​

OpCodeType('84')


OP_BIN2NUM​

readonly static OP_BIN2NUM: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:392

Converts byte sequence x into a numeric value.

Name​

OP_BIN2NUM

Constant​

OpCodeType('81')


OP_BOOLAND​

readonly static OP_BOOLAND: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:544

If both a and b are not 0, the output is 1. Otherwise 0.

Name​

OP_BOOLAND

Constant​

OpCodeType('9a')


OP_BOOLOR​

readonly static OP_BOOLOR: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:550

If a or b is not 0, the output is 1. Otherwise 0.

Name​

OP_BOOLOR

Constant​

OpCodeType('9b')


OP_CAT​

readonly static OP_CAT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:374

Concatenates two strings.

Name​

OP_CAT

Constant​

OpCodeType('7e')


OP_CHECKMULTISIG​

readonly static OP_CHECKMULTISIG: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:667

Compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result. All signatures need to match a public key. Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the scriptSig using the same order as their corresponding public keys were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, an extra unused value (x) is removed from the stack. Script spenders must account for this by adding a junk value (typically zero) to the stack.

Name​

OP_CHECKMULTISIG

Constant​

OpCodeType('ae')


OP_CHECKMULTISIGVERIFY​

readonly static OP_CHECKMULTISIGVERIFY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:673

Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.

Name​

OP_CHECKMULTISIGVERIFY

Constant​

OpCodeType('af')


OP_CHECKSIG​

readonly static OP_CHECKSIG: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:655

The entire transaction's outputs, inputs, and script (from the most recently-executed [OP_CODESEPARATOR][https://en.bitcoin.it/wiki/Script#:~:text=with%20SHA%2D256.-,OP\_CODESEPARATOR,-171](https://en.bitcoin.it/wiki/Script#:~:text=with%20SHA%2D256.-,OP_CODESEPARATOR,-171) to the end) are hashed. The signature used by [OP_CHECKSIG][https://en.bitcoin.it/wiki/OP\_CHECKSIG](https://en.bitcoin.it/wiki/OP_CHECKSIG) must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.

Name​

OP_CHECKSIG

Constant​

OpCodeType('ac')


OP_CHECKSIGVERIFY​

readonly static OP_CHECKSIGVERIFY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:661

Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.

Name​

OP_CHECKSIGVERIFY

Constant​

OpCodeType('ad')


OP_CODESEPARATOR​

readonly static OP_CODESEPARATOR: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:648

All of the signature checking words will only match signatures to the data after the most recently-executed [OP_CODESEPARATOR][https://en.bitcoin.it/wiki/Script#:~:text=with%20SHA%2D256.-,OP\_CODESEPARATOR,-171](https://en.bitcoin.it/wiki/Script#:~:text=with%20SHA%2D256.-,OP_CODESEPARATOR,-171).

Name​

OP_CODESEPARATOR

Constant​

OpCodeType('ab')


OP_DEPTH​

readonly static OP_DEPTH: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:313

Counts the number of stack items onto the stack and places the value on the top

Name​

OP_DEPTH

Constant​

OpCodeType('74')


OP_DIV​

readonly static OP_DIV: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:520

a is divided by b.

Name​

OP_DIV

Constant​

OpCodeType('96')


OP_DROP​

readonly static OP_DROP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:319

Removes the top stack item.

Name​

OP_DROP

Constant​

OpCodeType('75')


OP_DUP​

readonly static OP_DUP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:325

Duplicates the top stack item.

Name​

OP_DUP

Constant​

OpCodeType('76')


OP_ELSE​

readonly static OP_ELSE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:227

If the preceding IF or NOTIF check was not valid then statement 2 is executed.

Name​

OP_ELSE

Constant​

OpCodeType('67')

Example​

`[expression] IF
[statement 1]
ELSE
[statement 2]
ENDIF`

OP_ENDIF​

readonly static OP_ENDIF: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:240

Ends an if/else block. All blocks must end, or the transaction is invalid. An OP_ENDIF without a prior matching OP_IF or OP_NOTIF is also invalid.

Name​

OP_ENDIF

Constant​

OpCodeType('68')

Example​

`[expression] IF
[statement 1]
ELSE
[statement 2]
ENDIF`

OP_EQUAL​

readonly static OP_EQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:429

Returns 1 if the inputs are exactly equal, 0 otherwise.

Name​

OP_EQUAL

Constant​

OpCodeType('87')


OP_EQUALVERIFY​

readonly static OP_EQUALVERIFY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:435

Same as OP_EQUAL, but runs OP_VERIFY afterward.

Name​

OP_EQUALVERIFY

Constant​

OpCodeType('88')


OP_FALSE​

readonly static OP_FALSE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:20

An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)

Name​

OP_FALSE

Constant​

OpCodeType('00')


OP_FROMALTSTACK​

readonly static OP_FROMALTSTACK: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:265

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

Name​

OP_FROMALTSTACK

Constant​

OpCodeType('6c')


OP_GREATERTHAN​

readonly static OP_GREATERTHAN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:580

Returns 1 if a is greater than b, 0 otherwise.

Name​

OP_GREATERTHAN

Constant​

OpCodeType('a0')


OP_GREATERTHANOREQUAL​

readonly static OP_GREATERTHANOREQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:592

Returns 1 if a is greater than or equal to b, 0 otherwise.

Name​

OP_GREATERTHANOREQUAL

Constant​

OpCodeType('a2')


OP_HASH160​

readonly static OP_HASH160: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:635

The input is hashed twice: first with SHA-256 and then with RIPEMD-160.

Name​

OP_HASH160

Constant​

OpCodeType('a9')


OP_HASH256​

readonly static OP_HASH256: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:641

The input is hashed two times with SHA-256.

Name​

OP_HASH256

Constant​

OpCodeType('aa')


OP_IF​

readonly static OP_IF: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:184

If the top stack value is TRUE, statement 1 is executed. If the top stack value is FALSE and ELSE is used, statement 2 is executed. If ELSE is NOT used, the script jumps to ENDIF. The top stack value is removed.

Name​

OP_IF

Constant​

OpCodeType('63')

Example​

`[expression] IF
[statement 1]
ENDIF`
OR
`[expression] IF
[statement 1]
ELSE
[statement 2]
ENDIF`

OP_IFDUP​

readonly static OP_IFDUP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:307

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

Name​

OP_IFDUP

Constant​

OpCodeType('73')


OP_INVALIDOPCODE​

readonly static OP_INVALIDOPCODE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:757

Matches any opcode that is not yet assigned. The word is used internally for assisting with transaction matching. They are invalid if used in actual scripts.

Name​

OP_PUBKEY

Constant​

OpCodeType('ff')


OP_INVERT​

readonly static OP_INVERT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:405

Flips all of the bits in the input.

Name​

OP_INVERT

Constant​

OpCodeType('83')


OP_LESSTHAN​

readonly static OP_LESSTHAN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:574

Returns 1 if a is less than b, 0 otherwise.

Name​

OP_LESSTHAN

Constant​

OpCodeType('9f')


OP_LESSTHANOREQUAL​

readonly static OP_LESSTHANOREQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:586

Returns 1 if a is less than or equal to b, 0 otherwise.

Name​

OP_LESSTHANOREQUAL

Constant​

OpCodeType('a1')


OP_LSHIFT​

readonly static OP_LSHIFT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:532

Logical left shift b bits. Sign data is discarded

Name​

OP_LSHIFT

Constant​

OpCodeType('98')


OP_MAX​

readonly static OP_MAX: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:604

Returns the larger of a and b.

Name​

OP_MAX

Constant​

OpCodeType('a4')


OP_MIN​

readonly static OP_MIN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:598

Returns the smaller of a and b.

Name​

OP_MIN

Constant​

OpCodeType('a3')


OP_MOD​

readonly static OP_MOD: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:526

Returns the remainder after dividing a by b.

Name​

OP_MOD

Constant​

OpCodeType('97')


OP_MUL​

readonly static OP_MUL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:514

a is multiplied by b.

Name​

OP_MUL

Constant​

OpCodeType('95')


OP_NEGATE​

readonly static OP_NEGATE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:478

The sign of the input is flipped.

Name​

OP_NEGATE

Constant​

OpCodeType('8f')


OP_NIP​

readonly static OP_NIP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:331

Removes the second-to-top stack item.

Name​

OP_NIP

Constant​

OpCodeType('77')


OP_NOP​

readonly static OP_NOP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:159

Does nothing.

Name​

OP_NOP

Constant​

OpCodeType('61')


OP_NOP1​

readonly static OP_NOP1: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:680

No operation. The word is ignored.

Name​

OP_NOP1

Constant​

OpCodeType('b0')


OP_NOP10​

readonly static OP_NOP10: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:734

No operation. The word is ignored.

Name​

OP_NOP10

Constant​

OpCodeType('b9')


OP_NOP2​

readonly static OP_NOP2: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:686

No operation. The word is ignored. (previously OP_CHECKLOCKTIMEVERIFY)

Name​

OP_NOP2

Constant​

OpCodeType('b1')


OP_NOP3​

readonly static OP_NOP3: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:692

No operation. The word is ignored. (previously OP_CHECKSEQUENCEVERIFY)

Name​

OP_NOP3

Constant​

OpCodeType('b2')


OP_NOP4​

readonly static OP_NOP4: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:698

No operation. The word is ignored.

Name​

OP_NOP4

Constant​

OpCodeType('b3')


OP_NOP5​

readonly static OP_NOP5: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:704

No operation. The word is ignored.

Name​

OP_NOP5

Constant​

OpCodeType('b4')


OP_NOP6​

readonly static OP_NOP6: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:710

No operation. The word is ignored.

Name​

OP_NOP6

Constant​

OpCodeType('b5')


OP_NOP7​

readonly static OP_NOP7: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:716

No operation. The word is ignored.

Name​

OP_NOP7

Constant​

OpCodeType('b6')


OP_NOP8​

readonly static OP_NOP8: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:722

No operation. The word is ignored.

Name​

OP_NOP8

Constant​

OpCodeType('b7')


OP_NOP9​

readonly static OP_NOP9: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:728

No operation. The word is ignored.

Name​

OP_NOP9

Constant​

OpCodeType('b8')


OP_NOT​

readonly static OP_NOT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:490

If the input is 0 or 1, it is flipped. Otherwise the output will be 0.

Name​

OP_NOT

Constant​

OpCodeType('91')


OP_NOTIF​

readonly static OP_NOTIF: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:203

If the top stack value is FALSE, statement 1 is executed. If the top stack value is TRUE and ELSE is used, statement 2 is executed. If ELSE is NOT used, the script jumps to ENDIF. The top stack value is removed.

Deprecated​

Name​

OP_NOTIF

Constant​

OpCodeType('64')

Example​

`[expression] NOTIF
[statement 1]
ENDIF`
OR
`[expression] NOTIF
[statement 1]
ELSE
[statement 2]
ENDIF`

OP_NUM2BIN​

readonly static OP_NUM2BIN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:386

Converts numeric value a into byte sequence of length b.

Name​

OP_NUM2BIN

Constant​

OpCodeType('80')


OP_NUMEQUAL​

readonly static OP_NUMEQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:556

Returns 1 if the numbers are equal, 0 otherwise.

Name​

OP_NUMEQUAL

Constant​

OpCodeType('9c')


OP_NUMEQUALVERIFY​

readonly static OP_NUMEQUALVERIFY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:562

Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.

Name​

OP_NUMEQUALVERIFY

Constant​

OpCodeType('9d')


OP_NUMNOTEQUAL​

readonly static OP_NUMNOTEQUAL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:568

Returns 1 if the numbers are not equal, 0 otherwise.

Name​

OP_NUMNOTEQUAL

Constant​

OpCodeType('9e')


OP_OR​

readonly static OP_OR: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:417

Boolean or between each bit in the inputs.

Name​

OP_OR

Constant​

OpCodeType('85')


OP_OVER​

readonly static OP_OVER: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:337

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

Name​

OP_OVER

Constant​

OpCodeType('78')


OP_PICK​

readonly static OP_PICK: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:343

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

Name​

OP_PICK

Constant​

OpCodeType('79')


OP_PUBKEY​

readonly static OP_PUBKEY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:751

Represents a public key compatible with OP_CHECKSIG. The word is used internally for assisting with transaction matching. They are invalid if used in actual scripts.

Name​

OP_PUBKEY

Constant​

OpCodeType('fe')


OP_PUBKEYHASH​

readonly static OP_PUBKEYHASH: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:745

Represents a public key hashed with OP_HASH160. The word is used internally for assisting with transaction matching. They are invalid if used in actual scripts.

Name​

OP_PUBKEYHASH

Constant​

OpCodeType('fd')


OP_PUSHDATA1​

readonly static OP_PUSHDATA1: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:26

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

Name​

OP_PUSHDATA1

Constant​

OpCodeType('4c')


OP_PUSHDATA2​

readonly static OP_PUSHDATA2: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:32

The next two bytes contain the number of bytes to be pushed onto the stack in little endian order.

Name​

OP_PUSHDATA2

Constant​

OpCodeType('4d')


OP_PUSHDATA4​

readonly static OP_PUSHDATA4: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:38

The next four bytes contain the number of bytes to be pushed onto the stack in little endian order.

Name​

OP_PUSHDATA4

Constant​

OpCodeType('4e')


OP_RESERVED​

readonly static OP_RESERVED: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:50

Transaction is invalid unless occuring in an unexecuted OP_IF branch

Name​

OP_RESERVED

Constant​

OpCodeType('50')


OP_RESERVED1​

readonly static OP_RESERVED1: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:441

Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction invalid.

Name​

OP_RESERVED1

Constant​

OpCodeType('89')


OP_RESERVED2​

readonly static OP_RESERVED2: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:447

Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction invalid.

Name​

OP_RESERVED2

Constant​

OpCodeType('8a')


OP_RETURN​

readonly static OP_RETURN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:252

OP_RETURN can also be used to create "False Return" outputs with a scriptPubKey consisting of OP_FALSE OP_RETURN followed by data. Such outputs are provably unspendable and should be given a value of zero Satoshis. These outputs can be pruned from storage in the UTXO set, reducing its size. Currently the BitcoinSV network supports multiple FALSE RETURN outputs in a given transaction with each one capable of holding up to 100kB of data. After the Genesis upgrade in 2020 miners will be free to mine transactions containing FALSE RETURN outputs of any size.

Name​

OP_RETURN

Constant​

OpCodeType('6a')


OP_RIPEMD160​

readonly static OP_RIPEMD160: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:617

The input is hashed using RIPEMD-160.

Name​

OP_RIPEMD160

Constant​

OpCodeType('a6')


OP_ROLL​

readonly static OP_ROLL: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:349

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

Name​

OP_ROLL

Constant​

OpCodeType('7a')


OP_ROT​

readonly static OP_ROT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:355

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

Name​

OP_ROT

Constant​

OpCodeType('7b')


OP_RSHIFT​

readonly static OP_RSHIFT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:538

Logical right shift b bits. Sign data is discarded

Name​

OP_RSHIFT

Constant​

OpCodeType('99')


OP_SHA1​

readonly static OP_SHA1: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:623

The input is hashed using SHA-1.

Name​

OP_SHA1

Constant​

OpCodeType('a7')


OP_SHA256​

readonly static OP_SHA256: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:629

The input is hashed using SHA-256.

Name​

OP_SHA256

Constant​

OpCodeType('a8')


OP_SIZE​

readonly static OP_SIZE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:398

Pushes the string length of the top element of the stack (without popping it).

Name​

OP_SIZE

Constant​

OpCodeType('82')


OP_SPLIT​

readonly static OP_SPLIT: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:380

Splits byte sequence x at position n.

Name​

OP_SPLIT

Constant​

OpCodeType('7f')


OP_SUB​

readonly static OP_SUB: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:508

b is subtracted from a.

Name​

OP_SUB

Constant​

OpCodeType('94')


OP_SWAP​

readonly static OP_SWAP: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:361

The top two items on the stack are swapped.

Name​

OP_SWAP

Constant​

OpCodeType('7c')


OP_TOALTSTACK​

readonly static OP_TOALTSTACK: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:259

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

Name​

OP_TOALTSTACK

Constant​

OpCodeType('6b')


OP_TRUE​

readonly static OP_TRUE: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:62

The number 1 is pushed onto the stack.

Name​

OP_TRUE

Constant​

OpCodeType('51')


OP_TUCK​

readonly static OP_TUCK: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:367

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

Name​

OP_TUCK

Constant​

OpCodeType('7d')


OP_VER​

readonly static OP_VER: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:166

Puts the version of the protocol under which this transaction will be evaluated onto the stack.

Deprecated​

DISABLED

Name​

OP_VER

Constant​

OpCodeType('62')


OP_VERIF​

readonly static OP_VERIF: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:209

Name​

OP_VERIF

Constant​

OpCodeType('65')

Deprecated​

DISABLED


OP_VERIFY​

readonly static OP_VERIFY: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:246

Marks transaction as invalid if top stack value is not true. The top stack value is removed.

Name​

OP_VERIFY

Constant​

OpCodeType('69')


OP_VERNOTIF​

readonly static OP_VERNOTIF: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:215

Name​

OP_VERNOTIF

Constant​

OpCodeType('66')

Deprecated​

DISABLED


OP_WITHIN​

readonly static OP_WITHIN: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:610

Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.

Name​

OP_WITHIN

Constant​

OpCodeType('a5')


OP_XOR​

readonly static OP_XOR: OpCodeType

Defined in: packages/scrypt-ts-btc/src/smart-contract/types/opCode.ts:423

Boolean exclusive or between each bit in the inputs.

Name​

OP_XOR

Constant​

OpCodeType('86')