The network is operating normally with honest majority maintaining consensus.
βοΈ Blockchain State
π Simulation Log
System initialized. Ready to start simulation.
Understanding Bitcoin Consensus
Bitcoin's consensus mechanism relies on honest majority hashrate. When more than 50% of mining power
is controlled by honest actors, the network remains secure and follows the longest valid chain.
Experiment with different scenarios to see how attacks can affect consensus!
Test Your Understanding
Q1: Why does Bitcoin require "proof of work" instead of simply counting votes from nodes?
In a decentralized system, anyone can create as many nodes as they want (this is called a "Sybil attack").
If Bitcoin used simple voting, an attacker could create thousands of fake nodes and easily control the network.
Proof of Work solves this by making each "vote" (block) expensive to create. An attacker would need to
acquire massive amounts of physical mining hardware and electricityβnot just create virtual nodes. This makes attacks
economically impractical because:
Mining hardware costs millions of dollars
Electricity consumption is enormous and ongoing
Successfully attacking would crash the price, destroying the attacker's investment
The attacker would earn more by mining honestly
Bottom line: Proof of Work makes votes cost real-world resources, preventing free Sybil attacks.
Q2: What happens to transactions if there's a chain reorganization (reorg)?
A chain reorganization (reorg) occurs when a longer competing chain emerges and becomes the new "main chain."
When this happens:
Orphaned blocks: Blocks on the shorter chain become "orphaned" (invalid)
Transactions reversed: Transactions in orphaned blocks return to the mempool (unconfirmed)
Most get re-mined: Honest miners will typically re-include these transactions in future blocks
Double-spends possible: An attacker can replace their original transaction with a different one
This is why merchants wait for confirmations!
1 confirmation: Risky, 10-min reorg is possible
3 confirmations: Safer, requires attacker to mine 3 blocks in a row
6 confirmations: Very safe standard (~1 hour), extremely expensive to reorg
100+ confirmations: Required for newly mined coins (coinbase maturity)
Key insight: Each additional confirmation exponentially increases the cost for an attacker to reorganize the chain.
Q3: Why can't a 51% attacker steal your Bitcoin or print unlimited coins?
Even with 51% of mining power, an attacker is severely limited by Bitcoin's consensus rules, which are enforced by
every full node, not just miners:
What a 51% attacker CAN do:
β Double-spend their own coins (send, receive goods, then reverse the transaction)
β Prevent specific transactions from confirming (censorship)
β Orphan other miners' blocks (waste their work)
What a 51% attacker CANNOT do:
β Steal Bitcoin from someone else's address (requires private keys)
β Create Bitcoin out of thin air (violates 21M supply cap)
β Change the block reward (violates halving schedule)
β Spend coins without valid signatures (violates cryptographic rules)
β Invalidate properly signed transactions (all nodes would reject their blocks)
Why? Because every full node independently validates every block according to Bitcoin's consensus rules.
If a miner creates a block that breaks the rules (invalid signatures, wrong supply, etc.), every node will reject itβ
even if it's on the longest chain!
Key takeaway: Miners propose blocks, but full nodes enforce the rules. This separation of powers is crucial to Bitcoin's security.
Q4: If honest miners control 60% hashrate, what's the probability a malicious miner with 40% produces the next block?
The probability is approximately 40% for any single block. This is because mining is a probabilistic processβ
each miner's chance of finding the next block is directly proportional to their hashrate.
The Math:
Total network hashrate = 100%
Honest miners = 60% of hashrate β 60% chance to find next block
Malicious miners = 40% of hashrate β 40% chance to find next block
But over time, probabilities average out:
Over 10 blocks: Honest will likely produce ~6, malicious ~4
Over 100 blocks: Honest ~60, malicious ~40
Over 1,000 blocks: Honest ~600, malicious ~400
Why this matters for security:
With 60% hashrate, honest chain grows faster on average (0.6 blocks/period vs 0.4 blocks/period)
Even if malicious miners get lucky and mine 2-3 blocks in a row, honest chain will eventually overtake
The longer you wait (more confirmations), the exponentially harder it becomes to reorganize
Example attack scenario: To reorganize a chain with 6 confirmations when controlling 40% hashrate,
an attacker would need to mine 7 blocks faster than the honest 60% mines 1 block. The probability of this is vanishingly small: ~0.09%
Key insight: Security comes from the cumulative difficulty of outpacing the honest majority over many blocks, not from any single block.