Skip to Content
Mastering Bitcoin
book

Mastering Bitcoin

by Andreas M. Antonopoulos
December 2014
Beginner
298 pages
8h 5m
English
O'Reilly Media, Inc.
Content preview from Mastering Bitcoin

Appendix A. Transaction Script Language Operators, Constants, and Symbols

Table A-1 shows operators for pushing values onto the stack.

Table A-1. Push value onto 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.

Table A-2. Conditional flow control
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

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Grokking Bitcoin

Grokking Bitcoin

Kalle Rosenbaum
Mastering Bitcoin, 2nd Edition

Mastering Bitcoin, 2nd Edition

Andreas M. Antonopoulos
The Bitcoin Standard

The Bitcoin Standard

Saifedean Ammous
Mastering Bitcoin, 3rd Edition

Mastering Bitcoin, 3rd Edition

Andreas M. Antonopoulos, David A. Harding

Publisher Resources

ISBN: 9781491902639Errata Page