How Does the Network Agree on the Truth?
How does Bitcoin agree on the truth without a central authority? Through Proof-of-Work, mining, and economic incentives that make the blockchain effectively immutable.
Introduction
In the previous article, I explained how Bitcoin records transactions. Transactions are signed by the sender, verified by the network, grouped into blocks, and linked together to form the blockchain. The chain of hashes makes any manipulation visible as soon as it happens. The blockchain is tamper-evident.
But being able to detect tampering is not the same as being able to prevent it. What stops an attacker from recalculating the entire chain after changing a transaction? And how does the network agree on which version of the chain is the truth?
In this article, I will answer these questions. I will start by explaining what consensus means in a decentralized system, then introduce Proof-of-Work, the mechanism Bitcoin uses. From there, I will show how mining puts this mechanism into practice and what motivates miners to participate. Finally, I will explain how the network agrees on the truth when conflicts arise, and why the blockchain is in practice effectively immutable.
What Is Consensus?
In a decentralized system, participants need to agree on what is true without relying on a central authority. There is no leader to settle disputes and no institution to confirm transactions. We call this kind of agreement consensus.
To make consensus possible, the system needs a clear set of rules. These rules answer questions like: Who is allowed to participate? How is the next valid state of the system determined? Who decides, and how? What happens when participants disagree? What rewards exist for following the rules, and what penalties for breaking them?
In a centralized system, rules can be bent, suspended, or reinterpreted by the people in charge. In a decentralized system, this is not possible. The rules are encoded in software and enforced by every participant independently. They apply equally to everyone, without exceptions and without negotiation.
A set of rules that answers these questions is called a consensus mechanism. There are many different ones, each with its own trade-offs. Some of the most common in the world of cryptocurrencies are Proof-of-Work, Proof-of-Stake, and Proof-of-Authority. Bitcoin uses Proof-of-Work. The concept itself was already in practical use before Bitcoin, but Bitcoin was the first system to apply it as a consensus mechanism for a decentralized blockchain.
Proof-of-Work
Proof-of-Work is the consensus mechanism that secures Bitcoin. Its name describes exactly what it does: to add a new block to the blockchain, a participant must prove that they have done a significant amount of computational work. The only purpose of this work is to make adding blocks costly.
Why would anyone design a system that intentionally requires this much computation? Because that cost is what makes the system secure. Computation requires hardware. Hardware requires electricity. And electricity follows the laws of physics: it cannot be faked, copied, or generated out of nothing. Proof-of-Work therefore connects the digital world of the blockchain to the physical world of resources. Every block in the chain represents real work, performed in the real world, and that work cannot be skipped or simulated.
As we will see, this is what transforms the blockchain from tamper-evident to tamper-resistant.
The Goal: A Hash Below the Target
The goal of Proof-of-Work is simple to describe: find a block header hash that is smaller than or equal to a specific number called the target.
Remember from the previous article that a block header contains, among other things, the hash of the previous block, the Merkle Root, a timestamp, and a few mining parameters. One of these parameters is the nonce, short for "number used once". It is a number that the miner is free to change.
The process works like this. The miner takes the block header and passes it through SHA-256. If the resulting hash is smaller than the target, the block is valid. If not, the miner changes the nonce and tries again. Each attempt is independent. There is no shortcut. The only way to find a valid hash is to keep trying with different nonces until one of them produces a hash below the target.
Here is a real example. Block 900,000 was mined in June 2025. Its block header hash is:
000000000000000000010538edbfd2d5b809a33dd83f284aeea41c6d0d96968a
Notice the long sequence of zeros at the beginning. This hash starts with 19 zeros in hexadecimal notation, which corresponds to 76 leading zero bits in binary. For comparison, the Genesis Block from January 2009 has a hash that starts with only 10 zeros in hexadecimal:
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
The difference is significant. Finding a hash with 76 leading zero bits is many orders of magnitude harder than finding one with 40.
Since the target itself is a number with many leading zeros, valid hashes must have at least as many leading zeros as the target, often more. Talking about leading zeros is a useful simplification, but the underlying rule is a numerical comparison.
Target and Difficulty
The target defines what counts as a valid hash. It is the maximum number a block header hash is allowed to be. A smaller target means fewer hashes qualify, so finding one takes more attempts.
Bitcoin also uses a related value called difficulty. Difficulty is a relative measure: it expresses how much harder it is to find a valid hash compared to the very first block. The Genesis Block had a difficulty of 1. As of April 2026, the difficulty is approximately 135 trillion. In other words, finding a valid block today is roughly 135 trillion times harder than it was in January 2009.
The Difficulty Adjustment
But why has the difficulty grown so much? Because the network has grown. More miners means more hash attempts per second, which means blocks would be found faster than intended. But Bitcoin is designed to produce a new block roughly every 10 minutes, regardless of how much computational power is in the network. To maintain this average, Bitcoin adjusts the difficulty automatically.
Every 2,016 blocks, which corresponds to roughly two weeks, the network compares the actual time it took to produce these blocks to the intended time of exactly two weeks. If the blocks were produced too quickly, the target shrinks and the difficulty rises. If they were produced too slowly, the target grows and the difficulty falls.
Why 10 minutes? It is a deliberate compromise. Long enough for new blocks to spread across the global network before the next one is found, which reduces conflicts. But short enough that users do not have to wait too long for their transactions to be confirmed. Satoshi chose this value, and the network has kept it ever since.
Mining
Proof-of-Work defines the rules. Mining is the practical activity of following them. The participants who do this work are called miners.
A miner is a computer running specialized software and hardware that does one thing extremely well: compute SHA-256 hashes as fast as possible. Modern mining hardware, such as the Antminer S21 XP Hyd., can perform around 473 trillion hashes per second. That is roughly 4.7 ร 10ยนโด hashes, performed by a single device. As of April 2026, the entire Bitcoin network combined runs at approximately one zettahash per second, which is 10ยฒยน hashes: more than a million times the output of a single high-end miner.
What Miners Do
When a user broadcasts a transaction, it does not go directly into a block. Instead, it enters a holding area called the mempool, short for memory pool. Every miner maintains its own mempool, which contains valid transactions that have not yet been included in a block.
When a miner prepares to build a new block, they first select transactions from the mempool. Miners prioritize transactions that pay higher fees, since these fees go to the miner who includes them. Additionally, they add a special transaction at the very beginning of the block, called the coinbase transaction. After that, they build the block header, including the Merkle Root over all selected transactions, the hash of the previous block, the current timestamp, and the target the hash needs to meet. With the header complete, they run Proof-of-Work: change the nonce, hash the header, compare to the target, repeat until a valid hash is found. Once they find one, they broadcast the new block to the network.
Independent Verification
When other nodes receive the new block, they do not simply accept it. Each node verifies it independently, checking many conditions: Is the block header hash below the current target? Are all transactions valid? Does the Merkle Root match? Has the coinbase transaction created the correct amount of new bitcoin? These are only some of the checks performed.
Only if all checks pass does the node accept the block and forward it to its peers. Every node verifies for itself. No node has to trust another.
Incentives
Proof-of-Work requires significant amounts of computation, and computation costs money. Hardware is expensive. Electricity is expensive. Resources are not infinitely available and therefore not free. So why would anyone participate in mining?
Because miners get paid. Whenever a miner successfully adds a new valid block to the blockchain, they receive a reward that consists of two parts.
Block Subsidy
The first part is the block subsidy. This is a fixed amount of new bitcoin that the miner receives through the coinbase transaction. The subsidy is the only source of new bitcoin in the system. It is not printed by any institution. Instead, it is created by the protocol itself, as a reward for securing the network.
The block subsidy is not constant. Every 210,000 blocks, which corresponds to roughly four years, the subsidy is cut in half. This event is called the halving, and it has happened four times so far:
| Year | Block | Subsidy |
|---|---|---|
| 2009 | 0 | 50 BTC |
| 2012 | 210,000 | 25 BTC |
| 2016 | 420,000 | 12.5 BTC |
| 2020 | 630,000 | 6.25 BTC |
| 2024 | 840,000 | 3.125 BTC |
| 2028 | 1,050,000 | 1.5625 BTC |
| ... | ... | ... |
| 2140 | 6,930,000 | 0 BTC |
The pattern continues until approximately the year 2140, when the subsidy will reach zero. This is how the 21 million bitcoin supply cap from the first article is enforced: through a predictable, mathematically guaranteed reduction in issuance.
Transaction Fees
The second part of the reward is the transaction fees. When users create transactions, they can attach a small fee. All fees from the transactions in a block go to the miner who includes them. When there is heavy traffic on the Bitcoin network, users are more likely to pay higher fees to ensure their transaction is included in the next block. As the block subsidy decreases over time, transaction fees are designed to become the main source of miner income.
How the Network Agrees on the Truth
We now know how miners build blocks and why they do it. But one question remains. What happens when two miners find a valid block at almost the same time?
This is not a rare edge case, but it is not frequent either. It happens often enough that the protocol needs a clear rule for handling it. Mining is a global competition, and with thousands of miners working in parallel, two valid blocks can be discovered within seconds of each other. When this happens, the network briefly has two competing versions of the truth.
Forks
Let's call the two competing blocks A and B. Both are valid. Both have a hash below the target. Both reference the same previous block as their parent. Some nodes receive A first and start building on top of it. Other nodes receive B first and start building on top of it. This temporary split in the chain is called a fork.
For a short moment, the network does not agree on which block is the latest. So how is this resolved?
The Longest Chain Rule
The protocol's answer is simple: the network always considers the longest chain to be the truth.
As soon as the next block is found, it will be built on top of either A or B, not both. Whichever side gets the next block first becomes longer. All nodes then switch to that chain. The block on the other side, which is now part of the shorter chain, is discarded. Such a discarded block is called a stale block, and any transactions it contained that are not also in the winning block return to the mempool to be included in a future block.
This is how the network agrees on the truth: not by voting, not by central decision, but by following the chain that represents the most computational work. Disagreements resolve themselves naturally as the next block arrives.
Confirmations
Forks have a practical consequence. When your transaction is included in a block, you cannot be entirely certain that this block will remain part of the chain. There is always a very small chance that a competing block will become part of the longer chain instead.
For this reason, transactions are not considered final immediately. A transaction is considered final when it is part of the longest chain and the chance of it being reversed has become negligibly small. Each additional block built on top of the block that contains your transaction is called a confirmation. The more confirmations a transaction has, the smaller the chance that it could be reversed: an attacker, or even a fork, would have to outpace the entire network across all those blocks at once. By convention, especially for high-value transactions, six confirmations are commonly used as a threshold for finality. This takes about an hour on average.
From Tamper-Evident to Effectively Immutable
We can now answer the question that closed the previous article: what stops an attacker from recalculating the chain after changing a transaction?
Remember the chain reaction from the previous article. Changing a transaction changes the Merkle Root. That changes the block hash. That breaks the link to the next block. To repair the chain, the attacker would have to redo the Proof-of-Work for every block from the modified one onwards.
But the attacker is not working alone. The rest of the network keeps mining new blocks the entire time. To replace the public chain with a manipulated version, the attacker must not only catch up but overtake the network. They have to produce blocks faster than everyone else combined.
This kind of attack has a name: the 51% attack. To overtake the chain reliably, an attacker would need to control more than half of the network's total hashrate. With current hardware, that means owning more mining equipment, consuming more electricity, and operating more facilities than the rest of the world combined.
To put a number on this: the network currently runs at approximately one zettahash per second. Reproducing this on your own would require billions of dollars in hardware and continuous operating costs comparable to the electricity consumption of a medium-sized country. And even if all this could be assembled, attacking the network would destroy confidence in Bitcoin and crash the price of the very asset the attacker just spent billions to mine.
The cost of an attack is therefore not just an abstract number. It is hardware, electricity, and physical infrastructure. The defense of the chain is not purely digital. It is grounded in the physical world, where the laws of physics apply and where resources cannot be created out of nothing.
This is the second layer of protection. The chain is tamper-evident because the hashes reveal any change. It is tamper-resistant because Proof-of-Work makes those changes computationally expensive. And it is effectively immutable because the cost of an attack is too high to be worth it.
Bitcoin is tamper-evident, tamper-resistant, and effectively immutable. Only the combination of cryptography, Proof-of-Work, and economic incentives makes it possible.
Conclusion
Bitcoin does not rely on an authority to determine what is true. Instead, it relies on rules that no institution controls. Proof-of-Work makes block creation expensive. Mining puts these rules into practice. The longest chain rule resolves conflicts. And economic incentives align the interests of miners with the security of the network. Together, these mechanisms turn a tamper-evident chain of blocks into a record of transactions that is effectively immutable.
This is the final article in the Bitcoin Decoded series. The first article defined Bitcoin in two ways: as a new form of money and a new kind of monetary system. The second described where Bitcoin came from and what problem it solves. The third introduced the cryptographic foundations: hash functions, key pairs, and digital signatures. The fourth showed how transactions are signed, verified, grouped into blocks, and linked into the blockchain. This article explained how the network agrees on the truth and why no one can rewrite history.
If you have followed the entire series, you now have a solid understanding of how Bitcoin works: not just what it does, but why it works the way it does.
If you have questions or feedback, feel free to reach out. And if you found this series helpful, consider sharing it with others who want to understand Bitcoin.
Thank you for reading.