Blockchain
The bitcoin blockchain is a chain of blocks, each linked to the one before by its hash. Learn how that link keeps old transactions hard to change.
By Dimitar Zurnov · Updated 4 Nov 2026
Adapted from Learn Me a Bitcoin by Greg Walker.
The bitcoin blockchain is the record of every confirmed transaction, stored in blocks that link to each other. Each block holds the hash of the block before it. That link turns separate blocks into one chain, and it is why an old block is so hard to change.
What is the blockchain?
The blockchain is the most important file a node keeps. It is a permanent store of bitcoin transactions. New transactions are added in blocks, and each new block is built on top of the one before. That stacking is where the name comes from.
A new block arrives about every 10 minutes on average. After years of blocks, the full file takes hundreds of gigabytes on disk. Block 0, the genesis block, is the first one. Every other block has its own page on our explorer, and you can start with the newest ones on our blocks page.
How are blocks linked together?
Each block starts with an 80-byte header. The header has six fields, and together they make the block's identity.
| Field | Size | What it holds |
|---|---|---|
| Version | 4 bytes | Rule and signalling bits for soft forks |
| Previous block hash | 32 bytes | The hash of the block before |
| Merkle root | 32 bytes | A fingerprint of every transaction in the block |
| Time | 4 bytes | When the miner started the header |
| Bits | 4 bytes | The target, in compact form |
| Nonce | 4 bytes | The number miners change while they search |
The block hash is the double SHA-256 of those 80 bytes. Explorers show it in reverse byte order, which is why it starts with a run of zeros. Those zeros are the proof of work. A valid hash must be below the target.
Because every header holds the previous block's hash, each block commits to all the blocks before it. A block cannot point at a different parent without changing its own hash.
Why is an old block so hard to change?
Suppose someone edits one transaction in block 709,632. The merkle root changes, and so does the block hash. Block 709,633 still stores the old hash, so the link to the edited block breaks.
To make the edit stick, the attacker must rebuild block 709,632 and every block after it. Each rebuilt block needs its own proof of work, and the attacker must produce that work faster than honest miners add new blocks. The cost grows with each block added on top. The 51% attack page shows what that takes.
How does the network agree on one chain?
Nodes do not all see a new block at the same moment. Sometimes two miners find a block close together, and the network briefly holds two versions of the top of the chain. Nodes settle the question by following the longest chain, which is the chain with the most work. When the other side grows past yours, your node switches over in a chain reorganization.
How does mining add a block?
New blocks come from mining. A miner collects transactions from the mempool into a candidate block. Then the miner changes the nonce and hashes the header again and again until the hash falls below the target. Any node can try, and whoever finds a valid block first sends it to the network.
The target changes every 2,016 blocks, roughly every two weeks, so that blocks keep arriving about every 10 minutes. That adjustment is what difficulty means in practice.
The first transaction in each block is the coinbase. It pays the miner the block subsidy plus the fees from the block's transactions. Since block 840,000 on 20 April 2024, the subsidy has been 3.125 BTC. You can read more on the block reward page.
A node does not have to mine. It can keep a copy of the chain and pass new blocks on to its peers.
How do you get your own copy?
The easiest way is to run a node, such as Bitcoin Core. When two nodes connect, they tell each other how tall their chains are. A node that is behind asks for the missing blocks, and it checks each one before it keeps it. The first full download is called initial block download, and it can take hours or days.
No single copy of the blockchain is the official one. Each node keeps its own copy, and two copies can differ at the top for a short time until the network agrees again.
Bitcoin Core stores the blocks in files named blk00000.dat, blk00001.dat, and so on, inside a blocks folder. The folder depends on your system:
| System | Folder |
|---|---|
| Linux | ~/.bitcoin/blocks/ |
| macOS | ~/Library/Application Support/Bitcoin/blocks/ |
| Windows, version 27.2 and older | C:\Users\[username]\AppData\Roaming\Bitcoin\blocks\ |
| Windows, version 28.0 and newer | C:\Users\[username]\AppData\Local\Bitcoin\blocks\ |
Many small files are easier to handle than one huge one. See blk.dat for the format.
Which order should you read this section in?
Each page builds on the ones before it.
- Height: how blocks are numbered, and why the number is not a unique ID.
- Longest chain: why nodes follow the chain with the most work.
- Chain reorganization: what happens when two blocks are found at once.
- 51% attack: what it would take to rewrite recent blocks.
- Soft fork: an upgrade that tightens the rules.
- Hard fork: an upgrade that splits the chain.
The idea of a chain of blocks is set out in the Bitcoin white paper. When you have the chain in mind, open one of the newest blocks on our blocks page and look at its hash and its transactions.
In this section
- 1HeightBlock height is a block's position in the bitcoin blockchain, counted from 0 at the genesis block. Learn how bitcoin block height works and what it sets.
- 2Longest chainThe bitcoin longest chain rule means nodes follow the chain with the most work, not the most blocks. See how work is counted and why it matters.
- 3Chain reorganizationA bitcoin chain reorganization, or reorg, happens when a node switches to a chain with more work. Learn why reorgs happen and what they do to transactions.
- 451% attackA 51% attack on bitcoin lets one miner with most of the hash power rewrite recent transactions. Learn how it works and why the odds fall with each block.
- 5Soft forkA bitcoin soft fork tightens the rules, so nodes that did not upgrade still accept new blocks. Learn how activation works, with BIP 9 and BIP 8.
- 6Hard forkA bitcoin hard fork is an upgrade that old nodes reject, so the chain splits in two. Learn how it works, and how the 2017 Bitcoin Cash split happened.
Something look wrong? Tell us