Skip to content
CryptoSober

Crypto in 7 steps · Step 3 of 3

Understanding blockchain

A blockchain is a shared record of transactions that many computers keep in sync, with no central owner. See how blocks, hashes and consensus work.

By Abu HosainPublished 5 min read

A blockchain is a shared record of transactions that many independent computers store and keep in sync, with no single owner. New entries are grouped into blocks, and each block is cryptographically linked to the one before it, so past records cannot be quietly changed. The US National Institute of Standards and Technology (NIST) describes blockchains as "tamper evident and tamper resistant digital ledgers."

If you remember one picture, make it this: a notebook that thousands of strangers each hold a copy of, where every new page includes a fingerprint of the page before.

The problem it solves

Digital files are easy to copy. That is fine for photos and a disaster for money, because a digital coin that can be copied can be spent twice. Banks solve this by keeping the one official ledger and deciding which payments count.

A blockchain solves the same problem without a referee. Everyone holds the ledger, everyone can check it, and the rules for adding to it are enforced by software rather than by an institution.

Blocks, hashes and the chain

Three pieces make it work.

Transactions. A transaction is a signed instruction such as "move this amount from address A to address B." It is signed with the sender's private key, so the network can confirm it is genuine.

Blocks. Transactions are bundled into blocks. On Bitcoin, a new block is added about every 10 minutes on average.

Hashes. A hash is a short digital fingerprint of a piece of data. Change one character of the data and the fingerprint changes completely. Every block contains the hash of the previous block. That is the "chain".

Now consider what happens if someone edits an old transaction. The fingerprint of that block changes. The next block, which stored the old fingerprint, no longer matches. Neither does the one after it. The tampering is obvious to every computer that checks, and the altered copy is rejected.

Who keeps the ledger

The computers that store and check the ledger are called nodes. Each node verifies new transactions and blocks against the rules independently. It does not need to trust the node that sent them.

Because there are many copies, there is no single server to hack, switch off or pressure. That property is what people mean by "decentralised". It is a spectrum rather than a yes or no. A network with a handful of nodes run by one company is far less independent than one with many operators around the world.

How strangers agree: consensus

If anyone can propose a block, the network needs a way to choose between competing versions. The method is called a consensus mechanism. Two are common.

  • Proof of work. Used by Bitcoin. Computers called miners compete to solve a puzzle that requires real computing effort. Rewriting history would mean redoing that effort faster than everyone else combined.
  • Proof of stake. Used by Ethereum. Participants called validators lock up funds as a deposit. Honest work earns rewards. Provable cheating can destroy part of the deposit, a penalty known as slashing.

Both aim for the same outcome: making it far more expensive to attack the ledger than to follow the rules.

What you pay and how long you wait

Using a blockchain is not free. Each transaction includes a fee that goes toward the cost of processing it. On Ethereum this is called a gas fee, and it rises when many people want to transact at once.

A submitted transaction first waits in the mempool, a queue of pending transactions. Once it is included in a block it has one confirmation, and each further block adds another. More confirmations mean a lower chance that the transaction could be reversed by a reorganisation of recent blocks.

You can follow any transaction using a block explorer, a website that lets you search a public ledger. Every transaction has a unique ID called a transaction hash.

Public does not mean private

On public blockchains such as Bitcoin and Ethereum, every transaction and every balance is visible to anyone. Addresses are strings of characters rather than names, but they are not anonymous. Once an address is connected to your identity, your past and future activity at that address can be read by anyone who looks.

This cuts both ways. Transparency lets you verify claims for yourself. It also means you should think before sharing an address that holds your savings alongside your name.

Smart contracts: programs on the ledger

Some blockchains store programs as well as payments. A smart contract is code that lives on the blockchain and runs exactly as written when someone sends it a transaction. Smart contracts are how tokens, lending apps and exchanges without a middleman are built.

"Runs exactly as written" has a hard edge. If the code contains a bug, or was written to cheat, the blockchain will run that faithfully too. The ledger guarantees that the rules are followed. It does not guarantee that the rules are fair.

Layers and scaling

A base blockchain such as Bitcoin or Ethereum is called a layer 1. Because every node checks every transaction, layer 1 networks can only process so much at a time. A layer 2 is a separate network that handles transactions more cheaply and records its data back on the layer 1 for security.

Different networks cannot talk to each other directly. Moving assets between them requires a bridge, and bridges have been a frequent target for theft. Ethereum.org notes that many of the largest hacks in the sector involved bridges.

What a blockchain cannot do

  • It cannot check the outside world. The ledger knows what was recorded, not whether it was true. A token that claims to be backed by gold is only as good as whoever holds the gold.
  • It cannot undo mistakes. Sending funds to the wrong address is usually permanent.
  • It cannot make a project honest. A scam recorded on a blockchain is still a scam. The transparency helps you investigate, but only if you look.

Key points

  • A blockchain is a ledger shared by many computers, with blocks linked by hashes.
  • Altering history breaks the links, so tampering is visible and rejected.
  • Consensus mechanisms such as proof of work and proof of stake decide which blocks are valid.
  • Public ledgers are transparent, permanent and not anonymous.
  • The technology enforces rules. It does not judge whether those rules are fair.

Next, step 4 puts this into practice with Setting up a wallet.

Sources

  1. 01NIST, Blockchain technology overview (NISTIR 8202)
  2. 02Bitcoin developer guide, Block chain
  3. 03Bitcoin.org, How does Bitcoin work?
  4. 04Ethereum.org, Intro to Ethereum
  5. 05Ethereum.org, Proof of stake
  6. 06Ethereum.org, Gas and fees

This page is educational. It is not financial, investment, legal, or tax advice. See our editorial policy and how to report an error.