Commonly used opcodes

All opcodes are declared in the script.h file in the Bitcoin reference client source code.

This can be accessed from the link at https://github.com/bitcoin/bitcoin/blob/master/src/script/script.h under the following comment: /** Script opcodes */

A description of the most commonly used opcodes is listed here. This table is taken from the Bitcoin developer's guide:

Opcode

Description

OP_CHECKSIG

This takes a public key and signature and validates the signature of the hash of the transaction. If it matches, then TRUE is pushed onto the stack; otherwise, FALSE is pushed.

OP_EQUAL

This returns 1 if the inputs are exactly equal; otherwise, 0 is returned.

OP_DUP

This duplicates the top item in the stack. ...

Get Advanced Blockchain Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.