Smart Contracts
Bytecode
The low-level machine code that smart contracts compile to before deployment.
Last Updated
2026-03-19
What is Bytecode?
Bytecode is the low-level, hexadecimal machine code that a smart contract is compiled into before being deployed. It is the only language that a blockchain's virtual machine (like the EVM) can actually read and execute.
How does Bytecode work?
- A developer writes a smart contract in a high-level language like Solidity.
- A compiler (e.g., solc) translates this source code into bytecode.
- The bytecode is sent to the blockchain as part of a "contract creation" transaction.
- The blockchain stores this bytecode at a specific address on the ledger.
- When a user calls a function, the EVM executes the bytecode line-by-line to perform the logic.
Why does Bytecode matter?
Bytecode is the source of truth for a smart contract's behavior. While human-readable source code can be verified on sites like Etherscan, the bytecode is what actually manages the funds and logic on-chain.
Key features of Bytecode
- Hexadecimal format (e.g., 0x60806040...)
- Machine-readable only
- Permanent and immutable once deployed
- Deterministic output from source code
- Executed by the Ethereum Virtual Machine (EVM)
Examples of Bytecode
- A "Contract Creation" transaction containing the initialization bytecode.
- The "Runtime Bytecode" that remains on-chain after a contract is deployed.
- Opcodes like PUSH1, SSTORE, and REVERT, which are the human-readable labels for bytecode instructions.
