Skip to main content
Blog·
Web3

My Web3 Journey – Part 2: Understanding Blockchain

08/04/2026

My Web3 Journey – Part 2: Understanding Blockchain

1. Introduction

Welcome back to My Web3 Journey!

In Part 1, I laid out the roadmap and tools I plan to use. Now it's time to actually understand what we're building on top ofthe blockchain.

Before writing a single line of Solidity or connecting a wallet, I think it's critical to understand how blockchain works under the hood. Not at a PhD level, but enough to reason about why things behave the way they do when you build dApps later.

Let's break it down.


2. What Is a Blockchain?

At its core, a blockchain is just a database — but a very special one.

A regular database (like MySQL) is controlled by one company or server. They can edit, delete, or hide data. A blockchain, on the other hand, is:

  • Distributed — thousands of computers (nodes) each hold a copy
  • Immutable — once data is written, it cannot be changed
  • Transparent — anyone can read the data at any time

Think of it like a Google Doc that everyone can read, but nobody can edit or delete past entries.


3. How a Block Works

A blockchain is made up of blocks linked together in a chain. Each block contains:

FieldDescription
DataTransactions (who sent what to whom)
TimestampWhen the block was created
HashA unique fingerprint of this block
Previous HashThe fingerprint of the block before it

The hash is what makes this clever. If you change anything in a block — even one character — its hash completely changes. And since the next block stores the previous hash, the whole chain after it becomes invalid.

That's why blockchain data is practically impossible to tamper with. You'd have to rewrite every block after it, simultaneously, on thousands of computers.


4. Consensus — Who Gets to Add a Block?

Here's the problem: thousands of computers around the world each hold a copy of the blockchain. When someone submits a new transaction, who decides which computer gets to write the next block?

If there's no rule, two computers could write conflicting blocks at the same time — and the chain would split into chaos.

This problem is solved by a consensus mechanism — a set of rules all nodes agree to follow so they can reach agreement without trusting each other.

There are two main approaches: Proof of Work and Proof of Stake.


Proof of Work (PoW)

Used by: Bitcoin

Think of PoW like a guessing game. The network tells every miner: "I'm thinking of a number between 1 and 1 billion — whoever guesses it first wins the right to write the next block."

There's no clever trick. The only strategy is to guess as fast as possible — so miners with more powerful hardware guess more numbers per second and have a higher chance of winning. The puzzle itself is finding a number that, when combined with the block's data and hashed, produces a result below a certain threshold. The threshold adjusts every 2 weeks to keep block time around 10 minutes.

It's pure brute force — and that's the point.

EV (Expected Value) = the average reward you'd earn across many attempts. EV = 0.9 means you earn 90% of the maximum possible reward on average.

The diagram shows why PoW naturally discourages "split voting." A miner who divides their hash power between two competing chains (EV = 0.5) earns less than one who commits fully to the stronger chain (EV = 0.9). Hash power is a finite resource — spending it on a losing fork has a real opportunity cost.

Real example: In 2023, Bitcoin miners collectively made around 500 quintillion attempts per second to find the winning number. The first one to find it broadcasts the block to the network, everyone else verifies it in milliseconds, and the winner earns the block reward (3.125 BTC as of 2024 — this halves approximately every four years).

Why does this prevent cheating?

Because solving the puzzle costs real electricity and hardware. If a bad actor wanted to rewrite the blockchain, they'd need to redo all that work — faster than the honest miners are adding new blocks. To attack Bitcoin, you'd need to control more than 50% of the global mining power. That's practically impossible and absurdly expensive.

  • ✅ Battle-tested security (Bitcoin has run for 15+ years without being hacked)
  • ❌ Wastes enormous energy — Bitcoin uses roughly as much electricity as a mid-sized country
  • ❌ Slow — Bitcoin processes ~7 transactions per second

Proof of Stake (PoS)

Used by: Ethereum (since "The Merge", September 2022)

PoS throws out the competition entirely and replaces it with a weighted lottery.

Instead of buying hardware to guess faster, validators buy lottery tickets — by staking (locking up) ETH as collateral. The more ETH you stake, the more tickets you hold, and the higher your chance of being randomly selected to write the next block. Running your own validator node requires a minimum of 32 ETH — though pooling services like Lido let you stake any amount and still participate. Once selected, other validators vote to confirm the proposed block.

No race. No wasted computation. Just skin in the game.

But this raises a problem: since validators don't spend electricity, what stops them from voting on multiple competing chains at once to maximize their reward? This is known as the "Nothing at Stake" problem — and it was one of the biggest early criticisms of PoS.

Ethereum's answer is slashing: if a validator is caught voting on two conflicting chains, a portion of their staked ETH is automatically destroyed. Suddenly, split-voting goes from "free upside" to "guaranteed loss."

EV (Expected Value) = the average reward you'd earn over many attempts. A strategy with EV = 0.9 earns 90% of the maximum possible reward on average.

The diagram shows how slashing changes the math. Without slashing, a validator could vote on both chains (EV = high). With slashing, split-voting collapses in EV — making honest single-chain voting the only rational strategy.

Why does staking prevent cheating?

Because validators put up real money. If a validator tries to cheat — say, approving fraudulent transactions — the network slashes their stake (destroys a portion of their locked ETH). The financial punishment is so severe that cheating is never worth it.

Real example: Imagine 500,000 validators each locked up 32 ETH (~100,000 at current prices). The protocol randomly picks one to propose the next block. If they behave honestly, they earn a small reward. If they try to cheat, they lose part of their 100,000. The incentive to stay honest is obvious.

Why is PoS better for developers?

  • ✅ ~99.95% less energy than PoW — Ethereum's electricity use dropped by that amount overnight after The Merge
  • ✅ Faster — Ethereum proposes a new block every ~12 seconds
  • ✅ Foundation for future scalability (sharding, Layer 2, etc.)
  • ❌ Requires 32 ETH to run your own validator node (though pooling services like Lido lower the barrier significantly)

Quick Comparison

Proof of WorkProof of Stake
Used byBitcoinEthereum
How you participateBuy mining hardwareLock up ETH
Energy useVery highVery low
Speed~7 tx/sec~15–30 tx/sec
Penalty for cheatingWasted electricitySlashed stake
SecurityProven, 15+ yearsStrong, newer

As a Web3 developer, you'll mostly work on Ethereum (PoS) — so understanding the validator/staking model matters more than mining internals.


5. Wallets — Your Identity on the Blockchain

In Web3, you don't have a username/password. Instead, you have a wallet — and it's more like a key pair than a bank account.

How it works

Every wallet has two keys:

  • Private Key — like your password. Never share this. Whoever has it controls your wallet.
  • Public Key → your wallet address (e.g., 0xAb5...). Share this freely — it's how people send you crypto.

Analogy: Your public key is like your email address (anyone can send to it). Your private key is the password to your inbox.

When you sign a transaction, you use your private key to prove you authorized it — without ever revealing the key itself (thanks to cryptography).

  • MetaMask — the most common browser wallet for developers
  • Phantom — popular for Solana
  • Ledger / Trezor — hardware wallets for maximum security

We'll set up MetaMask properly in the next part.


6. Transactions — What Actually Happens

When you send ETH or interact with a smart contract, you're creating a transaction. Here's the lifecycle:

  1. You sign the transaction with your private key
  2. It's broadcast to the network
  3. Nodes validate it
  4. A validator picks it up and includes it in a block
  5. The block is added to the chain
  6. Done — it's permanent

Every transaction also pays a gas fee — a small amount of ETH paid to the validator who processed it. Think of gas like a tip you pay the post office to deliver your letter — the bigger the tip, the faster your letter gets prioritized. Gas prices fluctuate based on network demand: during busy periods (like a popular NFT mint), fees spike as everyone competes for the same block space.


7. Mainnet vs Testnet

You wouldn't deploy untested code to a production server, right? Same idea applies here.

MainnetTestnet
ETH valueReal moneyFake (free)
PurposeProductionDevelopment & testing
ExamplesEthereum MainnetSepolia, Holesky

As a beginner, you'll spend 90% of your time on testnets. You can get free test ETH from a faucet — a website that sends you test tokens so you can practice without spending real money.


8. Conclusion

That's the foundation. Now you understand:

  • What blockchain is — a distributed, immutable ledger
  • How blocks link — via cryptographic hashes
  • How consensus works — PoW vs PoS
  • What a wallet is — a key pair, not an account
  • What a transaction does — signed, broadcast, validated, permanent
  • Mainnet vs Testnet — always test before spending real ETH