Appendix A. Transaction Script Language Operators, Constants, and Symbols
Table A-1 shows operators for pushing values onto the stack.
| Symbol | Value (hex) | Description |
OP_0 or OP_FALSE | 0x00 | An empty array is pushed onto the stack |
1-75 | 0x01-0x4b | Push the next N bytes onto the stack, where N is 1 to 75 bytes |
OP_PUSHDATA1 | 0x4c | The next script byte contains N, push the following N bytes onto the stack |
OP_PUSHDATA2 | 0x4d | The next two script bytes contain N, push the following N bytes onto the stack |
OP_PUSHDATA4 | 0x4e | The next four script bytes contain N, push the following N bytes onto the stack |
OP_1NEGATE | 0x4f | Push the value “–1” onto the stack |
OP_RESERVED | 0x50 | Halt - Invalid transaction unless found in an unexecuted OP_IF clause |
OP_1 or OP_TRUE | 0x51 | Push the value “1” onto the stack |
OP_2 to OP_16 | 0x52 to 0x60 | For OP_N, push the value “N” onto the stack. E.g., OP_2 pushes “2” |
Table A-2 shows conditional flow control operators.
| Symbol | Value (hex) | Description |
OP_NOP | 0x61 | Do nothing |
OP_VER | 0x62 | Halt - Invalid transaction unless found in an unexecuted OP_IF clause |
OP_IF | 0x63 | Execute the statements following if top of stack is not 0 |
OP_NOTIF | 0x64 | Execute the statements following if top of stack is 0 |
OP_VERIF | 0x65 | Halt - Invalid transaction |
OP_VERNOTIF | 0x66 | Halt - Invalid transaction |
OP_ELSE | 0x67 | Execute only if the previous statements were not executed |
OP_ENDIF | 0x68 | End the OP_IF, OP_NOTIF, OP_ELSE block |
OP_VERIFY | 0x69 | Check the top of the stack, halt and invalidate transaction ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access