Skip to main content

Command Palette

Search for a command to run...

⚡ Inside Ethereum: Understanding the EVM, Blocks, Gas, Accounts, and Transactions

Updated
6 min read
⚡ Inside Ethereum: Understanding the EVM, Blocks, Gas, Accounts, and Transactions

Ethereum is more than just a cryptocurrency network.

It is a programmable blockchain that allows developers to build decentralized applications (dApps), deploy smart contracts, and create entirely new financial systems.

But to truly understand Ethereum, you need to grasp a few core concepts that power everything under the hood:

  • The Ethereum Virtual Machine (EVM)

  • Blocks

  • Gas

  • Accounts

  • Transactions

Let’s break them down clearly.


The Ethereum Virtual Machine (EVM)

The Ethereum Virtual Machine (EVM) is the computation engine that runs Ethereum.

Every smart contract deployed on Ethereum executes inside the EVM.

You can think of the EVM as:

A global virtual computer shared by thousands of nodes.

When you interact with a DeFi app or mint an NFT, the logic is executed by the EVM across the entire network.

Key properties of the EVM

  • It is deterministic (the same input always produces the same output)

  • It is sandboxed (contracts can’t access external systems directly)

  • It ensures Ethereum behaves consistently worldwide

Smart contracts are written in languages like Solidity, then compiled into low-level bytecode that the EVM understands.


EVM Opcodes: The Machine Language of Ethereum

Under the hood, the EVM does not understand Solidity directly.

It executes instructions called opcodes.

Opcodes are low-level operations such as:

  • ADD (addition)

  • MUL (multiplication)

  • SSTORE (store data permanently)

  • CALL (call another contract)

Each opcode has a fixed gas cost, which prevents abuse and ensures predictable execution costs.

So when a smart contract runs, the EVM processes it step-by-step using these opcodes.


Blocks: How Ethereum Stores Data

Ethereum is a blockchain, meaning its transaction history is stored in blocks. Transactions are batched in blocks, allowing multiple transactions to be synchronized at once.

A block is essentially a package containing:

  • Transactions

  • Block metadata (timestamp, number, validator info)

  • A reference to the previous block

This linking creates the chain:

Block N → Block N+1 → Block N+2 → ...

What blocks accomplish

Blocks ensure:

  • Transactions are ordered

  • State changes are recorded permanently

  • Ethereum remains tamper-resistant

On Ethereum, time is split into 12-second periods called slots. In each slot, one validator is chosen to create a block. Usually, a block is added every 12 seconds, but sometimes a validator may be offline, so a slot can be empty, and no block is produced.


Accounts: Who Can Use Ethereum?

Ethereum has two main types of accounts:


1. Externally Owned Accounts (EOAs)

These are regular user accounts controlled by private keys.

Examples:

  • MetaMask wallet

  • Hardware wallets

EOAs can:

  • Send ETH

  • Sign transactions

  • Interact with smart contracts


2. Contract Accounts

Contract accounts represent deployed smart contracts.

They:

  • Contain code

  • Execute only when called

  • Cannot initiate transactions themselves

Ethereum accounts store four main pieces of information:

  • Nonce – A counter that tracks how many transactions an account has sent (or how many contracts it has created). It helps prevent the same transaction from being replayed multiple times.

  • Balance – The amount of ETH the account owns, measured in wei (1 ETH = 10¹⁸ wei).

  • Code Hash – A reference to the account’s smart contract code. Contract accounts have code, while regular wallet accounts have an empty code hash.

  • Storage Root – A cryptographic hash that represents all the data stored inside a contract. It is empty for normal accounts unless the contract stores values.


Transactions: How Ethereum Changes State

An Ethereum transaction is a signed message sent from a wallet to do something on the Ethereum network. The simplest transaction is sending ETH from one person to another.

Only regular wallet accounts (controlled by people) can start transactions. After a transaction is sent out, validators process it and include it in a block.

Every transaction usually contains:

  • from – the sender’s wallet address

  • to – the receiver’s address (or a smart contract)

  • signature – proof the sender approved it

  • nonce – a counter showing how many transactions the sender has made

  • value – how much ETH is being sent

  • data – extra information (mainly for smart contract actions)

  • gas limit – the maximum work the transaction can use

  • fees – extra payment to validators for processing it

Here’s a beginner-friendly version in simple terms:


Types of Ethereum Transactions

Ethereum has a few main kinds of transactions:

  • Regular transaction – sending ETH from one wallet to another

  • Contract deployment – creating a new smart contract. This transaction has no address because it is being deployed to a new address.

  • Contract interaction – sending a transaction to a smart contract address to use one of its functions (like swapping tokens or minting an NFT).


Smart Contract Transactions

Any transaction that interacts with a smart contract requires gas.

However, some smart contract functions are read-only, like:

  • view

  • pure

These functions do not change anything, so calling them using eth_call does not cost gas.

But if contracts call these functions internally, gas is still used.


Transaction Lifecycle (What Happens After You Send It)

Once you submit a transaction:

  1. A unique transaction hash is created (like a receipt ID).

  2. The transaction is shared across the network and waits in a pool of pending transactions.

  3. A validator picks it and includes it in a block.

  4. The block becomes more secure over time:

    • first justified

    • then finalized

Once finalized, the transaction is practically permanent and cannot be changed unless an extremely expensive network attack happens.


The Transaction Data Field

One of the most important parts of a transaction is the data field.

When interacting with smart contracts, the transaction includes:

  • A function selector (first 4 bytes)

  • ABI-encoded arguments (the function inputs)

So if you call:

transfer(address recipient, uint256 amount)

The transaction data tells the EVM exactly what function to run and with what parameters.


Gas: The Fuel of Ethereum

Ethereum requires payment for computation, and that payment is called gas.

Gas measures the computational effort needed to perform actions.

Examples:

  • Sending ETH uses a small amount of gas

  • Calling complex DeFi contracts uses much more gas

  • Deploying contracts is one of the most expensive operations


Why gas exists

Gas prevents spam and ensures the network remains secure.

Without gas, someone could run infinite loops and overload Ethereum.

Gas ensures:

  • Users pay for computation

  • Validators are rewarded

  • Network resources are protected


Gas fees calculation

Example:

If you send Ada 1 ETH, and:

  • base fee = 190 gwei

  • priority fee (tip) = 10 gwei

Total gas price = 190 + 10 = 200 gwei

So the fee is:

200 × 21,000 = 4,200,000 gwei
= 0.0042 ETH

Gas price is measured in gwei, a small fraction of ETH.

You pay:

  • 1 ETH to Ada

  • 0.0042 ETH as gas fee

So his total cost is:

1.0042 ETH

Ada receives:

+1 ETH

The base fee is burned, and the validator keeps the tip.

Also, if some gas is not used, it is refunded.


How Everything Works Together

Let’s connect the dots.

When you interact with Ethereum:

  1. You create and sign a transaction

  2. The transaction specifies a gas limit and fee

  3. Validators include it inside a block

  4. The EVM executes the transaction using opcodes

  5. Ethereum’s global state updates permanently

So Ethereum runs because:

  • Transactions trigger actions

  • Gas pays for execution

  • Blocks record history

  • Accounts represent users and contracts

  • The EVM enforces computation rules


Final Thoughts

Ethereum is not just digital money.

It is a decentralized execution layer where code, finance, and applications can run without centralized control.

Understanding the EVM, blocks, gas, accounts, and transactions gives you the foundation needed to build confidently in Web3.