This website uses cookies

Read our Privacy policy and Terms of use for more information.

Ledgers, blocks and hashes

Lesson 1 of 6
By the end of this lesson you’ll be able to say what a hash is and show one, explain how each block locks in the block before it, say what a Merkle tree is for, and give an honest account of what “immutable” means for the record of your money.
A collage of an aerial photograph of plowed farmland, torn out and laid on cream paper, its furrows curving into one vast fingerprint. One tiny deep blue tractor sits where a single ridge forks in two.

What a hash does

A hash function takes any message and gives back a fixed-length fingerprint. Bitcoin uses SHA-256, which always gives 256 bits, written as 64 characters. Feed it one word or a whole film and you get 64 characters either way.

Repeatable
The same message always gives the same fingerprint.
Sensitive
A tiny change in the message gives a completely different fingerprint, with no pattern linking old to new.
One way
There’s no known way to run it backward: from the fingerprint you can’t recover the message, and you can’t craft a second message that gives the same one.

Here are three, computed with the shasum tool on a Mac on 1 November 2026:

hello
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Hello
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
hello with a period
1589999b0ca6ef8814283026a9f166d51c70a910671c3d44049755f07f2eb910
Message and SHA-256 for “hello”, “Hello” and “hello.”

One capital letter, one period, and no pattern links the three results. Anyone with the same tool gets the same three lines: a hash is a fact about a message that anyone can check and nobody can fake.

Crypto from Zero called this a fingerprint and left it there; most of this course is a hash used in a particular way.

Chaining blocks together

A block is a bundle of transactions with a header on top. In Bitcoin the header is 80 bytes and holds, among other things, the hash of the previous block’s header. The Bitcoin developer guide puts it in one line: each block “stores the hash of the previous block’s header, chaining the blocks together.”

The previous-hash field is the chain. Change a transaction in block 500 and block 500’s hash changes. Block 501 holds the old hash, so block 501 no longer matches, and fixing 501 breaks 502.

Block 500
Its hash changed
✕
Block 501
Still holds the old hash
↓
Block 502
Holds block 501’s hash

Bitcoin adds a second lock. A block’s hash has to start with a run of zeros, and finding a header that does takes an enormous amount of trial and error (lesson 4 covers the work itself).

The white paper describes the effect: once that work is done, “the block cannot be changed without redoing the work,” and, as later blocks are chained after it, “the work to change the block would include redoing all the blocks after it.”

Ethereum chains its blocks the same way. ethereum.org: “Blocks are batches of transactions with a hash of the previous block in the chain,” and “every new block created contains a reference to its parent block.”

Since 2022 the lock on Ethereum’s chain is different, stakes rather than work, which is lesson 4’s subject.

Merkle trees

A block can hold thousands of transactions, and its 80-byte header commits to all of them through a Merkle tree, named for Ralph Merkle, whose 1980 paper the white paper cites.

The developer guide’s description: the transaction hashes “are then paired, hashed, paired again, and hashed again until a single hash remains,” the Merkle root.

The root goes in the header. Change one transaction and its hash changes, so the pair above it changes, and so on up to the root, and the header no longer matches.

A Merkle tree over four transactions, A to D. Hashes A and B pair up into hash AB, hashes C and D into hash CD, and those two into the Merkle root, which sits in the block header. The path from transaction A up to the root is drawn in blue. Hash B and hash CD are amber, marked sent to the wallet. Hash A and hash AB are marked worked out by the wallet.
To prove transaction A, a light wallet needs only hash B, hash CD and the root.

The tree does a second job. The white paper’s section on saving disk space explains that old spent transactions can be thrown away and the “interior hashes do not need to be stored,” while the root still proves what was in the block.

And a light wallet that doesn’t download whole blocks can ask for “the Merkle branch linking the transaction to the block,” a handful of hashes, and check that its payment is in a block the network accepted. A light wallet built this way has checked exactly that, and nothing more.

Ethereum goes further and puts a tree of the same family over its whole state. ethereum.org: “There is one global state trie, and it is updated every time a client processes a block,” and its root goes in the block header as “the root hash of the state object.” That’s how a balance can be proved without sending the entire ledger.

What “immutable” means, and doesn’t

Immutable is the word people use, and it needs a footnote. The chain is hard to change, not impossible.

What makes rewriting hard is what sits on top of the chain: redoing the work on Bitcoin, or risking the stake on Ethereum. Whoever controls enough of the work or the stake can rewrite recent history.

The white paper is plain about it. The system holds as long as “a majority of CPU power is controlled by nodes that are not cooperating to attack the network.”

An attacker with more power than the honest miners could rewrite blocks, though the paper also shows what he couldn’t do: “Nodes are not going to accept an invalid transaction as payment,” so he could only “try to change one of his own transactions to take back money he recently spent.” He couldn’t print coins or take yours.

Ethereum’s documentation is equally plain. Once a block is finalized, “it cannot be reverted or changed without a majority slashing of stakers,” and the same page gives the floor: an attacker “would commit to losing at least one-third of the total supply of staked ETH.” Lesson 4 works out what an attack would take today.

July 2016 · The DAO fork
Over 3.6 million ETH
The record can also be overridden by agreement. In July 2016 Ethereum’s community voted to fork the chain to reverse a hack in which, in ethereum.org’s words, “an insecure contract was drained of over 3.6 million ETH.” A new rule at block 1,920,000 moved the funds, and the old blocks stayed as they were. Lesson 5 tells that story.
For now, hold the accurate version of the slogan: a blockchain’s record is as hard to change as its work or stake is expensive to beat, and the people running it can choose to override it if enough of them agree.

Databases against blockchains

A bank’s ledger
A bank’s ledger is a database with one owner. It can be edited by the people who run it, which is a feature when a payment goes wrong and a weakness when the owner fails or is leaned on.
A blockchain
A blockchain is a ledger with no owner, kept in thousands of copies, where the only way to add to it is to follow rules every copy checks, and the only way to change the past is to break a very expensive lock.

Everything it does well (no single party can quietly edit it) and everything it does badly (no undo, no helpline, a copy on every node) follows from that difference. A database needs no network of nodes to agree, so it suits any job where you trust the owner. A blockchain exists for the jobs where you don’t.

Your next step
Open any block explorer and look at the most recent Bitcoin block. Find three fields: the block’s hash, the previous block’s hash, and the Merkle root.
Then open the block before it and check that its hash is the one your first block named as “previous.” You’ve just verified one link of the chain by hand, one of the checks a node makes on every block.

Last checked: 6 November 2026