Glossary

Opcode

1 min read

An operation code, or opcode, is a basic command of some computer languages. Bitcoin’s scripting language, called Script, has its own set of opcodes. Each opcode is numbered and performs a limited, predefined function. The combination of these opcodes and additional data such as addresses, public keys, and signatures can produce Bitcoin scripts.

For example, the most common Bitcoin script is P2PKH, which is composed of 4 opcodes and a public key hash. This script is a type of ScriptPubKey, which is used to lock bitcoin such that only someone capable of producing the public key and a valid signature can spend it.