To truly understand Ethereum, you need to look under the hood. This guide breaks down every core component of the Ethereum network — the state machine, accounts, transactions, gas, the Ethereum Virtual Machine (EVM), and Layer 2 scaling — that together enable the creation of decentralized applications. While the concepts are technical, this guide explains them in plain English, backed by custom infographics and real-world examples. Whether you are a complete beginner or someone brushing up on the fundamentals, this is the most complete guide to how Ethereum works you will find.
The Ethereum State Machine: A Digital Universe of Agreements
Unlike Bitcoin, which is primarily a distributed ledger for recording transactions, Ethereum is a distributed state machine. Think of it as a single, global computer that anyone can use — and that no single person controls. At any given moment, there is a “state” of the Ethereum network, which includes all account balances, smart contract data, and other information. When a transaction is executed, it causes the state to transition to a new state. This is what allows Ethereum to support complex applications and smart contracts, going far beyond simple monetary transactions.
Y(S, T) = S’
Given an old valid state (S) and a new set of valid transactions (T), the Ethereum state transition function Y(S, T) produces a new valid output state S’.

Ethereum vs. Bitcoin: Two Different Approaches
Bitcoin’s design is intentionally simple: it is a distributed ledger that records who sent how much Bitcoin to whom. Ethereum, by contrast, stores not just balances but also the complete state of every smart contract deployed on the network. This is what makes Ethereum a programmable blockchain — a platform for building applications, not just transferring value. For a deeper look, check out our Ethereum vs. Bitcoin comparison.
| Feature | Bitcoin | Ethereum |
| Primary purpose | Peer-to-peer digital currency | Programmable smart contract platform |
| Data stored on-chain | Transaction history | Transaction history + contract state |
| Scripting | Limited (Bitcoin Script) | Turing-complete (EVM) |
| Native currency | BTC | ETH (Ether) |
| Consensus | Proof of Work | Proof of Stake |
Ethereum Accounts: Your Identity on the Blockchain
On Ethereum, your identity and your assets are represented by accounts. There are two fundamental types of accounts, each with distinct characteristics and purposes.

➤ Externally Owned Accounts (EOAs)
These are the accounts that you, the user, control. They are defined by a cryptographic pair of keys: a public key and a private key. Your public key generates your Ethereum address — the 42-character string starting with 0x that you share with others to receive funds. Your private key is your secret credential, which you use to sign transactions and prove that you are the owner of the account. Critically, you never actually “hold” ETH in a traditional sense; you hold the private key that proves ownership of the ETH recorded on the blockchain.
Important: Never share your private key with anyone. Anyone who has your private key has full control over your account and all the assets it holds.
➤ Contract Accounts
These accounts are not controlled by a user, but by the code of a smart contract. When a transaction is sent to a contract account, it triggers the execution of its code. This code can perform a wide range of actions, such as transferring tokens, creating new contracts, or interacting with other contracts. Unlike EOAs, contract accounts cannot initiate transactions on their own — they can only react to incoming transactions.
➤ The Anatomy of an Ethereum Account
Every Ethereum account, whether an EOA or a contract, has four fundamental fields stored in the network’s state:
| Field | EOA Value | Contract Account Value | Purpose |
|---|---|---|---|
| nonce | Number of transactions sent | Number of contracts created | Prevents replay attacks |
| balance | ETH balance in Wei | ETH balance in Wei | Tracks funds (1 ETH = 10^18 Wei) |
| codeHash | Hash of empty string | Hash of smart contract bytecode | Identifies the account’s code |
| storageRoot | Empty (default) | Root of Merkle Patricia Trie | Stores contract’s persistent data |
The nonce is particularly important for security. Because each transaction from an account must use a sequentially incrementing nonce, it is impossible for an attacker to rebroadcast a previously signed transaction — the network would reject it as a duplicate.
➤ Public and Private Keys: The Foundation of Security
Ethereum uses Elliptic Curve Digital Signature Algorithm (ECDSA) cryptography to generate key pairs. Your private key is a 64-character hexadecimal string generated randomly. From this private key, a public key is derived mathematically. Your Ethereum address is then derived by taking the last 20 bytes of the Keccak-256 hash of the public key. This one-way process means that while anyone can derive your address from your public key, no one can work backwards to find your private key.
The Lifecycle of a Transaction: From Your Wallet to the Blockchain
A transaction is a cryptographically signed instruction from an account that tells the Ethereum network to update its state. Every state change on Ethereum — from sending ETH to calling a smart contract — is the result of a transaction.

What Is Inside a Transaction?
Every transaction submitted to the Ethereum network contains the following fields:
| Field | Description |
|---|---|
| from | The sender’s address (must be an EOA) |
| to | The recipient’s address (EOA or contract) |
| value | Amount of ETH to send, in Wei |
| nonce | Sender’s transaction counter (prevents replays) |
| gasLimit | Maximum gas units the sender is willing to use |
| maxFeePerGas | Maximum total fee per gas unit (base fee + tip) |
| maxPriorityFeePerGas | Maximum tip per gas unit for the validator |
| data | Optional data field for contract interactions |
| signature | Cryptographic proof that the sender authorized this |
The Six Steps of a Transaction
Types of Ethereum Transactions
Not all transactions are the same. There are three main types:
| Transaction Type | Description | Example |
|---|---|---|
| Regular transfer | Sends ETH from one EOA to another | Sending 0.5 ETH to a friend |
| Contract deployment | Creates a new smart contract on the network | Deploying a new DeFi protocol |
| Contract interaction | Calls a function on an existing smart contract | Swapping tokens on Uniswap |
Gas: The Fuel of Ethereum
Every operation on the Ethereum network, from a simple ETH transfer to a complex smart contract interaction, requires a certain amount of computational effort. This effort is measured in gas. Gas fees are the payments users make to have their transactions processed by the network.
Gas serves several critical purposes: it compensates validators for the computational resources they expend, it prevents the network from being spammed with unnecessary transactions, and it provides a mechanism for allocating the network’s limited block space fairly.

➤ The EIP-1559 Gas Fee Model
Before August 2021, gas fees were determined by a simple auction: users bid for block space, and validators included the highest bidders. This made fees unpredictable and often resulted in users overpaying. EIP-1559 introduced a new model that separates the fee into two components and burns part of it, making ETH a deflationary asset.
Total Fee = Gas Used × (Base Fee + Priority Fee)
➤ Base Fee vs. Priority Fee: What’s the Difference?
The base fee is set by the protocol itself and adjusts automatically based on network congestion. If the previous block was more than 50% full, the base fee increases by up to 12.5%. If it was less than 50% full, it decreases by up to 12.5%. This mechanism makes fees more predictable. Crucially, the base fee is burned — it is permanently removed from circulation, reducing the total supply of ETH over time.
The priority fee (also called a “tip”) is an optional amount you add on top of the base fee. This tip goes directly to the validator who includes your transaction in a block. A higher tip makes your transaction more attractive to validators and can result in faster confirmation during periods of high demand.
➤ Gas Limit and Unused Gas
The gas limit is the maximum amount of gas you are willing to spend on a transaction. For a simple ETH transfer, the gas limit is always 21,000 units. For smart contract interactions, it can be much higher. If your transaction uses less gas than the limit, the unused portion is refunded to you. If your transaction runs out of gas mid-execution, the EVM reverts all state changes, but you still pay for the gas that was consumed up to that point.
➤ A Real-World Gas Fee Example
Let’s say you want to send 1 ETH to a friend. The current base fee is 10 gwei, and you set a priority fee of 2 gwei. A standard ETH transfer uses 21,000 gas units.
Total Fee = 21,000 × (10 + 2) gwei = 252,000 gwei = 0.000252 ETH
– Your account is debited: 1.000252 ETH
– Your friend receives: 1.0 ETH
– The base fee burned: 0.00021 ETH
– The validator receives as tip: 0.000042 ETH
For a full breakdown of how gas fees are calculated and how to minimize them, read our guide: Gas Fees Explained: Understanding Ethereum Transaction Costs
The Ethereum Virtual Machine (EVM): The Heart of the Network
The EVM is the runtime environment for smart contracts on Ethereum. It is a sandboxed virtual machine — completely isolated from the host computer’s file system, network, and other processes. This isolation is what makes it safe to run code written by anyone in the world: the EVM cannot reach outside its sandbox, no matter what the code tries to do.
Every node on the Ethereum network runs an identical copy of the EVM. When a transaction triggers a smart contract, every node executes the same code and arrives at the same result. This determinism is what makes Ethereum trustless: you don’t need to trust any single party, because the outcome is mathematically guaranteed.

How the EVM Executes Smart Contracts
Smart contracts are written in high-level languages like Solidity, but they are compiled down to EVM bytecode — a series of low-level instructions — before being deployed. When a transaction triggers a contract, the EVM reads the bytecode instruction by instruction and executes each one. Each instruction has a corresponding gas cost, which is deducted from the transaction’s gas limit as execution proceeds.
Stack, Memory, and Storage: The Three Data Stores
The EVM uses three distinct types of data storage, each with different characteristics and costs:
| Data Store | Persistence | Gas Cost | Description |
|---|---|---|---|
| Stack | Per instruction | Very low | A last-in, first-out (LIFO) structure with a depth of 1,024 items. Used for intermediate calculations during execution. |
| Memory | Per transaction | Medium | A temporary byte array that is cleared at the end of each transaction. Used for larger, temporary data. |
| Storage | Permanent | High | A persistent key-value store associated with the contract account. Writing to storage is the most expensive EVM operation because it modifies the global state. |
Opcodes: The Language of the EVM
EVM bytecode is made up of opcodes — single-byte instructions that tell the EVM what to do. There are over 140 opcodes in the EVM instruction set, covering everything from basic arithmetic (ADD, SUB, MUL) to blockchain-specific operations (BALANCE, BLOCKHASH, SSTORE). Each opcode has a defined gas cost, reflecting the computational resources it requires.
Blocks: How Transactions Are Grouped and Finalized
Transactions are not processed one by one. Instead, they are grouped together into blocks — batches of transactions that are validated and added to the blockchain together. Each block references the hash of the previous block, forming the “chain” in blockchain.
Layer 2 Scaling Solutions: Making Ethereum Faster and Cheaper
To handle the high demand for block space and keep transaction fees low, Ethereum relies on Layer 2 scaling solutions. These are separate blockchains that run on top of the main Ethereum chain (Layer 1). They process transactions off-chain, bundle them together, and then submit a compressed summary to the main chain. This allows them to offer significantly faster and cheaper transactions while still inheriting the security of the Ethereum network.

➤ Optimistic Rollups
Optimistic Rollups (used by networks like Arbitrum and Optimism) process transactions off-chain and assume they are all valid by default — hence “optimistic.” They submit batches of transactions to Layer 1 along with a bond. If anyone detects a fraudulent transaction, they can submit a fraud proof within a challenge window (typically 7 days) to dispute it. This model offers high throughput and is compatible with existing Ethereum smart contracts.
➤ ZK-Rollups
ZK-Rollups (used by networks like zkSync and Starknet) use zero-knowledge proofs to cryptographically prove that a batch of transactions is valid, without revealing the underlying data. This means they can achieve near-instant finality on Layer 1 without a challenge window. ZK-Rollups are considered the more technically advanced solution and are expected to dominate the scaling landscape in the long term.
Learn more about the different types of Layer 2s in our guide: Layer 2 Solutions Explained: Arbitrum, Optimism, and Ethereum Scaling
Key Takeaways
- Ethereum is a distributed state machine — a global computer that transitions between states as transactions are executed.
- There are two types of accounts: EOAs (controlled by users) and contract accounts (controlled by code).
- Every transaction contains a set of fields including sender, recipient, value, gas parameters, and a cryptographic signature.
- Gas is the unit of computational effort on Ethereum. Under EIP-1559, the fee is split into a burned base fee and a validator tip.
- The EVM is the sandboxed, deterministic virtual machine that executes smart contract code on every node in the network.
- Layer 2 solutions (Optimistic Rollups and ZK-Rollups) scale Ethereum by processing transactions off-chain and settling on Layer 1.
Discover more
Frequently Asked Questions
What is the difference between an EOA and a contract account?
An EOA (Externally Owned Account) is controlled by a user with a private key and can initiate transactions. A contract account is controlled by smart contract code and can only execute operations in response to a transaction it has received. Both types can hold ETH and interact with other contracts.
Why do I need to pay gas fees?
Gas fees compensate validators for the computational resources they use to process your transaction and secure the network. They also prevent the network from being spammed with unnecessary transactions. Under EIP-1559, part of the fee (the base fee) is burned, which reduces the total supply of ETH over time.
What happens if my transaction runs out of gas?
If your transaction runs out of gas during execution, the EVM reverts all state changes made by that transaction. However, you still pay for the gas that was consumed up to that point — the work was done, even if the transaction ultimately failed.
What is the EVM?
The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts on Ethereum. It is a sandboxed, deterministic virtual machine that executes smart contract bytecode. Every node on the Ethereum network runs an identical copy of the EVM, ensuring that all nodes reach the same result for any given transaction.
How long does an Ethereum transaction take to finalize?
A transaction is typically included in a block within a few seconds to a few minutes, depending on the gas fee you offer. However, economic finality — the point at which reversing the transaction would be economically irrational — is achieved after approximately two epochs, or about 12.8 minutes.
What is the mempool?
The mempool (short for “memory pool”) is a waiting area for transactions that have been broadcast to the network but have not yet been included in a block. Validators select transactions from the mempool to include in new blocks, typically prioritizing those with higher priority fees.





