How does blockchain work: blocks, hashes and consensus made simple

Free crypto course
Level 1: Blockchain BasicsLesson 1.1 · 10 of 6910 min read

The easiest way to understand how blockchain works is to follow a single transfer from the moment you hit "Send" to the point where it becomes a record no one can change. In this lesson we'll talk about blocks, hashes, signatures and consensus. By the end, you'll see why transfers need confirmations and where network fees come from.

Key takeaways
  • A blockchain is a shared ledger split into blocks, where each block points to the hash of the previous one.
  • A transfer is signed with a private key, and the network checks the signature and the balance before including it in a block.
  • Participants agree on the order of blocks through consensus: Proof of Work (PoW) or Proof of Stake (PoS).
  • The more blocks built on top of yours, the more final your transfer is, which is why exchanges wait for confirmations.

A shared ledger no one can rewrite

At its core, a blockchain is a database, just not in the usual sense. A regular database is run by a single owner, whether it's a bank, a store or a government registry, and that owner can correct a record, delete it or shut off access. A blockchain, on the other hand, is stored on thousands of independent computers called nodes, and every full node keeps a copy of all records going back to day one.

Records are added in batches called blocks. A block is like a page in an accounting ledger: it collects the transfers made over a certain period. Each filled page is bound to the ones before it, forming a chain, which is exactly where the name comes from.

The key point: you can only add to this ledger. Old pages are never torn out or edited. Sent money to the wrong address? The fix is a new record with a transfer back, not an edit of the old one, and only the recipient can make it.

Term · Node

A computer running the network's software that stores a copy of the blockchain and checks new blocks against the rules. Anyone can run a node, no permission needed.

What a block is made of and why you need a hash

A block has two parts. The header holds technical information: when the block was created, the hash of the previous block and a compact fingerprint of all the transactions inside. The body holds the transactions themselves: who sent how much to whom.

A hash is the output of a hash function, a kind of digital fingerprint of data. Feed it a single letter or an entire book, and you always get a string of the same fixed length. Change one comma in the input, and the fingerprint becomes completely different. And there's no way to work backward from the hash to the original data.

That's why history can't be quietly rewritten. Say an attacker decides to change an amount in block 100. That block's hash changes, but block 101 still stores the old one, so the link breaks. To make the forgery look believable, the attacker would have to recalculate every block that follows, and do it faster than the rest of the network builds new ones.

The Merkle root has a different job: it lets a wallet confirm that your transaction really made it into a block without downloading the whole block. A short chain of intermediate hashes is enough for that. This is what so-called light wallets are built on: they don't need to store the entire blockchain.

Part of the block What it contains Why it's there
Previous block hash The fingerprint of the block that comes before this one Links the blocks into a chain
Merkle root A single combined hash of all the transactions in the block Makes it quick to check that a transaction is part of the block
Timestamp When the block was created Puts events in order
List of transactions Transfers with the senders' signatures The main content of the block

Example · Try it yourself

Find any online SHA-256 calculator and type the word "blockchain", then "Blockchain". A single capital letter is enough to make the result completely different, and you won't see any connection between the two hashes.

The journey of one transfer: from button to block

Let's look at what happens when you send coins. The first confirmation usually takes anywhere from a few seconds to tens of minutes, depending on the network, how busy it is and the fee you pay.

The signature guarantees that the transfer can't be forged: only the owner of the private key can sign it, while anyone can verify the signature using the public address. Nodes don't need to trust the sender; the math is enough. How keys, addresses and balances add up to coins is explained in the lesson on how cryptocurrencies work.

  1. Your wallet builds the transaction: the recipient's address, the amount and the network fee.
  2. The transaction is signed with your private key right on your device; the key itself is never sent anywhere.
  3. The signed transaction is broadcast to nodes, which check the signature and that the funds are there.
  4. The verified transaction goes into a waiting queue, the mempool, until it's included in a block.
  5. A miner or validator assembles a block, usually giving priority to transactions with higher fees.
  6. The other nodes accept the block, and your transfer gets its first confirmation.

Consensus: how thousands of computers reach agreement

Since there's no central owner, the network needs a rule that decides who adds the next block and which version of the chain counts as the correct one. This rule is called a consensus mechanism. The most common ones are Proof of Work and Proof of Stake.

In Proof of Work, miners try number after number until they find one that makes the block's hash meet a set condition. This takes electricity and specialized hardware. Whoever finds the solution first adds the block and earns a reward. This is how bitcoin works: a new block appears every 10 minutes on average.

Proof of Stake skips the computing race. Participants lock their own coins as collateral and become validators. The network picks who proposes the next block, and a validator who cheats can lose part of that stake. Ethereum switched to this model in 2022, and it uses vastly less energy.

Either way, a dishonest participant would need to control most of the network's resources, whether that's computing power or staked coins. On large networks this is extremely expensive, but on small ones such attacks, known as 51% attacks, have already happened.

Proof of Work Proof of Stake
Who creates blocks Miners Validators
What a participant risks Spending on hardware and electricity Their own staked coins
Energy use High Low
Examples Bitcoin, Litecoin Ethereum, Solana, Cardano

Types of blockchains

Blockchains are open to different degrees. On public networks like Bitcoin and Ethereum, anyone can read data, send transactions and run a node. On private and consortium networks, participants are picked in advance by a company or a group of companies. These networks are used for settlements between banks or for supply chain tracking, but they usually have nothing to do with the crypto that regular people use.

Blockchains are also divided into layers. The main network is called layer 1, or L1. When it gets congested and fees go up, some activity moves to layer 2 networks, or L2s: transactions there are faster and cheaper, and the final results are periodically recorded on the main network. For Ethereum, examples include Arbitrum, Optimism and Base; for bitcoin, it's the Lightning Network.

For you, this means one thing: before a transfer, you need to know exactly which network your coins are on. The same token can live on the main network and on several L2s, and speed and fees will differ between them.

  • Public networks: anyone can participate, and all data is open.
  • Private and consortium networks: the network owner chooses the participants.
  • Layer 2 networks: make transfers faster and cheaper on top of the main network.

Confirmations, fees and what they mean for you

As soon as a transfer lands in a block, it has one confirmation. Each new block on top adds another, and reversing the transaction becomes more and more expensive and unlikely. That's why an exchange doesn't credit your deposit right away: it waits for the number of confirmations it requires for that network.

The network fee doesn't go to the exchange or the wallet: it's paid to whoever includes transactions in blocks (on Ethereum, the base part of the fee is also burned). Block space is limited, so when demand is high, fees rise. If you set a fee that's too low, your transfer can get stuck in the mempool for a long time.

There are a few practical takeaways. A sent transfer can't be recalled, so check the address and network before you send. A public blockchain hides nothing: a block explorer shows the full transaction history of any address. And while the blockchain itself is secure, it won't protect you from phishing, exchange hacks or your own mistakes.

Important · One coin, different networks

USDT, for example, exists on several blockchains, and addresses look different on each of them. If you send coins on a network the recipient doesn't support, you can lose the funds. Always double-check the network when withdrawing.

Lesson task

Open the Ethereum block explorer etherscan.io, go to the latest blocks section and open the most recent one. Note its number, time and transaction count, then click "More Details" and copy the previous block's hash (Parent Hash). Open the block whose number is one lower and check that its own hash matches the one you copied: that's the very chain this lesson was about.

Learn and earnFree tournaments every day — your way to USDT prizes

Entry is free and you trade on a demo account, so you need no money of your own. Free tournaments pay out Tour Passes, and those get you into tournaments with USDT prizes. The best go further — to a $5,000 funded account.

FAQ

Can a blockchain be hacked?

The ledger of a large network is practically impossible to hack: you'd need to control most of its resources. That's why attackers go after everything around it: exchanges, wallets, smart contracts and the users themselves through phishing.

Why is my transfer taking so long?

A transfer first waits to be included in a block, and then for the required number of confirmations. If the network is busy or the fee is low, the wait gets longer, and speed also varies a lot from one blockchain to another.

Are blockchain and bitcoin the same thing?

No, and it's worth keeping them apart. Blockchain is a technology for keeping a shared ledger, and bitcoin is the first cryptocurrency built on it. Today there are hundreds of blockchains, each with its own rules.

Who stores the blockchain and how big is it?

It's stored by nodes around the world, and each of them has a full copy. The size depends on the network and keeps growing, so for a regular user a wallet that connects to other people's nodes is enough.

Discussion

Comments from BuyCrypt Live. Sign in with Google or Apple — we create your BuyCrypt account on the way, the same one as in the app.