Opcode

An opcode, short for operation code, is a fundamental instruction used by computer languages, including Bitcoin’s scripting language called Script. In Bitcoin, each opcode has its own unique number and carries out a specific, predefined action. These instructions are combined with data like public keys, signatures, and addresses to form Bitcoin scripts.

A common example is the Pay-to-PubKey-Hash (P2PKH) script, which uses four opcodes along with a hashed public key. This script type, known as a ScriptPubKey, ensures that only someone who can provide the correct public key and matching signature is able to spend the bitcoin.