blockchain fundamentals

Blockchain fundamentals โ€” blocks, consensus, Ethereum, and gas fees

๐Ÿ“˜ defi-academy · Part 3 of 15 · Module 1 · Foundations
A free, step-by-step course on buying, selling & trading domains. View the full series →
Blockchain fundamentals โ€” blocks, consensus, Ethereum, and gas fees
Key takeaways
  • Blockchain is an immutable, distributed ledger where consensus mechanisms ensure agreement across thousands of nodes.
  • The EVM executes smart contract bytecode โ€” every operation costs gas, paid in ETH by the transaction sender.
  • EIP-1559 burns the base fee and adds priority tips โ€” Layer 2s reduce total costs 10-100x.

Understanding blockchain fundamentals is the foundation of this guide. Below we break it down step by step so you can act with confidence.

A blockchain is a distributed ledger โ€” a shared database that no single entity controls. Every node in the network holds a copy, and consensus mechanisms ensure everyone agrees on the current state.

Understanding how Ethereum works at a technical level is essential for building or using DeFi. The Ethereum Virtual Machine determines gas costs, storage patterns, and the security model that every DeFi protocol depends on.

Blockchain Fundamentals: How blocks and chains work

A blockchain is a chain of blocks, where each block contains a batch of transactions:

  • Immutable โ€” once a block is confirmed, its contents cannot be changed
  • Distributed โ€” thousands of nodes worldwide hold identical copies
  • Consensus-driven โ€” nodes agree on the valid chain through Proof of Stake (Ethereum) or Proof of Work (Bitcoin)
  • Transparent โ€” every transaction is publicly visible on block explorers
๐Ÿ”ฌ Demo: Explore the Ethereum blockchain

Open etherscan.io and click on the latest block. You can see every transaction, gas used, sender and receiver addresses, and smart contracts called.

// Read the latest block with ethers.js
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider(
  'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY'
);

const block = await provider.getBlock('latest');
console.log('Block number:', block.number);
console.log('Transactions:', block.transactions.length);
console.log('Gas used:', block.gasUsed.toString());
console.log('Timestamp:', new Date(block.timestamp * 1000));

Consensus mechanisms

Consensus is how decentralized nodes agree on which transactions are valid:

  • Proof of Work (PoW) โ€” miners solve computational puzzles to add blocks. Used by Bitcoin. High energy cost, very secure.
  • Proof of Stake (PoS) โ€” validators lock ETH as collateral. Selected randomly to propose blocks. Used by Ethereum since The Merge (Sept 2022). 99.95% less energy.
  • Delegated PoS โ€” token holders vote for validators. Used by Solana, Cosmos. Faster but more centralized.
  • Proof of Authority โ€” pre-approved validators. Used by private chains and some sidechains. Fast but centralized.

Ethereum validators must stake 32 ETH ($60K+). If they act maliciously, their stake is slashed โ€” destroyed. This economic incentive keeps the network honest.

The Ethereum Virtual Machine

The EVM is a stack-based virtual machine that executes bytecode. When you deploy a smart contract, your Solidity code compiles to EVM bytecode stored on-chain. When someone calls your contract:

  1. A transaction is submitted to the network with the contract address and function call data
  2. Validators pick up the transaction and execute the bytecode in the EVM
  3. The EVM reads and writes to the contract's storage on the blockchain
  4. Gas is consumed for every operation โ€” the sender pays in ETH
  5. The resulting state change is included in the next block
๐Ÿ”ฌ Demo: Trace a real Ethereum transaction

On Etherscan, find any transaction and click 'Click to see more.' The Internal Transactions tab shows every contract-to-contract call. The State tab shows exactly which storage slots changed.

// Fetch transaction details with ethers.js
const tx = await provider.getTransaction(
  '0xabc123...' // any transaction hash
);
console.log('From:', tx.from);
console.log('To:', tx.to);
console.log('Value:', ethers.formatEther(tx.value), 'ETH');
console.log('Gas limit:', tx.gasLimit.toString());

// Get the receipt for execution results
const receipt = await provider.getTransactionReceipt(tx.hash);
console.log('Gas used:', receipt.gasUsed.toString());
console.log('Status:', receipt.status === 1 ? 'Success' : 'Failed');
console.log('Logs:', receipt.logs.length, 'events emitted');

Explore Crypto Trading

Cryptocurrency trading is one of the fastest-growing financial markets โ€” open 24/7, globally accessible, and full of opportunity for those who learn the fundamentals first.

  • Trade spot, futures & copy-trading on one platform
  • Start with as little as $10 โ€” practice risk-free on the testnet
  • Built-in TradingView charts, grid bots & DCA tools

Free Crypto Trading Academy → ยท Domain Trading Academy →

Gas fees and EIP-1559

Every EVM operation costs gas โ€” a unit measuring computational effort:

  • Gas limit โ€” maximum gas you are willing to spend on a transaction
  • Base fee โ€” set by the network based on demand (EIP-1559), burned and not paid to validators
  • Priority fee (tip) โ€” optional extra to incentivize faster inclusion
  • Max fee โ€” the absolute maximum you will pay per gas unit

Total cost = gas used x (base fee + priority fee). A simple ETH transfer uses ~21,000 gas. A complex DeFi swap might use 200,000+. Layer 2 networks reduce costs by 10-100x.

๐Ÿ”ฌ Demo: Estimate gas for a transaction
// Estimate gas cost with ethers.js
const gasPrice = await provider.getFeeData();
console.log('Base fee:', ethers.formatUnits(gasPrice.gasPrice, 'gwei'), 'gwei');
console.log('Max priority fee:', ethers.formatUnits(gasPrice.maxPriorityFeePerGas, 'gwei'), 'gwei');

// Estimate gas for a specific call
const gasEstimate = await provider.estimateGas({
  to: '0xContractAddress',
  data: '0xFunctionSelector...',
  from: '0xYourAddress'
});
const costInEth = gasEstimate * gasPrice.gasPrice;
console.log('Estimated cost:', ethers.formatEther(costInEth), 'ETH');

When evaluating blockchain fundamentals, start with the fundamentals: what problem it solves, who it serves, and how it compares to the alternatives buyers consider first.

Start with the fundamentals. Define who you are serving, the single outcome you want, and the budget you are comfortable committing before you compare any options.

A practical rule is to favour clarity over cleverness. The choice that is easiest to understand, spell, remember and act on tends to win over the long run.

Context changes the answer. What is optimal for a fast-moving startup is rarely optimal for an established brand, so weigh your own stage, market and ambitions.

Avoid the common mistakes: rushing the decision, copying competitors blindly, and ignoring the total cost of ownership beyond the very first year of use.

Think in terms of trade-offs rather than a single perfect answer. Every option trades memorability, cost, reach and flexibility in a slightly different mix.

Document your reasoning. Writing down why you chose one path makes it far easier to revisit the decision later and to explain it to partners and investors.

Test with real people. A quick check with a handful of your actual customers will surface problems that no amount of internal debate ever reveals.

Plan for growth. The option that fits today should still make sense when your audience, catalogue or team is several times larger than it is right now.

WSOT 2026: Squad Leader Slots Are Open โ€” Up to $128,000 per Leader

Join Now

Frequently asked questions

What is gas and why does it cost money?

Gas is the unit measuring computational work on Ethereum. You pay gas in ETH to compensate validators for processing your transaction and to prevent network spam. Complex operations cost more gas than simple transfers.

What happened during The Merge?

In September 2022, Ethereum switched from Proof of Work to Proof of Stake. This reduced energy consumption by 99.95% and changed the block production mechanism from miners to validators. Smart contracts and DeFi protocols were unaffected.

What are Layer 2 networks?

Layer 2s (Arbitrum, Optimism, Base, zkSync) process transactions off Ethereum mainnet but settle on it, reducing gas costs 10-100x while inheriting Ethereum's security. Most DeFi activity is migrating to L2s.

Free Courses โ€” Learn New Skills

No sign-up · No fees · Learn at your own pace

Start Trading

Trade crypto and premium domains โ€” digital assets with real opportunities.

Find your name on Atom

DominantBrand curates the best premium, brandable names from Atom.com — the marketplace with a free AI appraisal, a USPTO trademark check, and secure escrow. Every listing even ships with a designed logo.

Browse Domains