GlossaryAdvanced
Opcode
A single low-level instruction that a blockchain's virtual machine executes.
An opcode is a single basic operation — such as adding two numbers or reading from storage — that a blockchain's virtual machine executes as part of running a smart contract's bytecode.
Each opcode has an associated gas cost, reflecting the computational resources required to execute it, which together determine a transaction's total gas cost.
Examples
- A smart contract's bytecode is ultimately a sequence of opcodes the virtual machine executes in order.
- More complex operations generally require more opcodes, and therefore more gas.