Skip to content
Retr0 Academy
Web3 Fundamentals

Web3 Fundamentals · 5 min read

What Is a Blockchain?

Learn how blocks, hashes, and a network of computers create a shared, tamper-resistant record without a central owner.

A blockchain is a shared record (a ledger) that is copied across thousands of computers around the world. Instead of one company keeping the official database, everyone in the network keeps a copy and they agree on what gets added.

Web3 is the idea of building apps on top of these shared ledgers, so users can own their assets and data directly, without needing a middleman to hold them.

Web2 (traditional)Web3 (blockchain)
Who stores the data?A company's serversMany independent computers (nodes)
Who can change history?The companyPractically no one, once confirmed
Your accountUsername and password, controlled by the companyA wallet and key, controlled by you
TransparencyPrivate databasePublic, anyone can read it
Blocks are chained by hash, so history cannot be quietly rewritten.
Blocks are chained by hash, so history cannot be quietly rewritten.

Blocks and chains

Transactions are grouped into blocks. Each block contains:

  • A list of transactions
  • A timestamp
  • The hash of the previous block
  • Its own hash

Because each block includes the previous block's hash, the blocks are linked into a chain.

What is a hash?

A hash function turns any input into a fixed-length "fingerprint". Blockchains like Ethereum and Bitcoin use cryptographic hashes such as Keccak-256 and SHA-256. They have special properties:

  • The same input always gives the same hash.
  • A tiny change in the input completely changes the hash.
  • You cannot work backwards from a hash to the input.

Try it: a toy blockchain

The demo below uses a simple toy hash (not secure!) to show the idea. Edit the data in block 2 and watch it break the chain: its hash changes, so block 3's "previous hash" no longer matches.

<div id="chain"></div>
<p class="hint">Edit any block's data to see the chain break. Click "Re-mine" to repair everything after it.</p>
<button id="remine">Re-mine chain</button>

Edit this example in the Playground.

Open in Playground

To cheat on a real blockchain, you would have to redo the work for every later block and convince most of the network to accept your version. On a large network that is practically impossible.

Nodes and consensus

Computers that keep a copy of the blockchain are called nodes. They must agree on which new block comes next. The rules they use are called a consensus mechanism:

  • Proof of Work (PoW): "miners" compete to solve a hard puzzle using computing power. Bitcoin uses this.
  • Proof of Stake (PoS): "validators" lock up (stake) cryptocurrency as collateral, and can lose it if they cheat. NEAR uses PoS, as does Ethereum since 2022.

Public by default

Anyone can read a public blockchain. Block explorers like NearBlocks let you look up any account, transaction, or contract.

Summary

  • A blockchain is a shared ledger copied across many nodes.
  • Blocks are linked by hashes, so changing old data breaks the chain.
  • Nodes agree on new blocks through consensus (Proof of Work or Proof of Stake).
  • Public blockchains are transparent: anyone can read every transaction.

Exercise

In your own words, write down what a block contains and why changing one transaction would change the block hash. Then explain why NEAR still needs a network of validators, not a single server.