JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Forks, Finality, and the 51% Attack

What happens when two valid blocks appear at once, why old history hardens into stone, and exactly what an attacker with half the power can — and cannot — do.

When two people write the same page

Picture a global newsroom where thousands of reporters share one logbook, but messages between them travel at the speed of light — which is fast, yet never instant. Most of the time one reporter finishes the next page and everyone copies it down. But every so often, two reporters on opposite sides of the planet finish a valid page at almost the same second, before either has heard of the other. Now the logbook briefly has two equally good next pages. This split is called a fork, and on a busy chain it happens naturally, all the time.

There is no judge to pick the "real" page. Instead the network leans on its consensus mechanism and a single mechanical rule we met before: keep building on the branch with the most accumulated work — in practice, the longer chain. The fork resolves itself the moment the next block lands on one side.

A temporary fork, resolved

Let's watch one play out. Blocks 1 through 4 are agreed by everyone. Then miners Aiko and Ben each find a valid block 5 at nearly the same instant. Half the network hears Aiko's block 5A first; the other half hears Ben's 5B. Two branches now coexist. The tie breaks when some miner finds block 6 — say it builds on Aiko's side. That branch is now longer, so everyone switches to it, and Ben's 5B is dropped:

       ... -> [3] -> [4] -> [5A] -> [6]   <- longer: everyone keeps this
                          \
                           [5B]            <- orphaned: dropped

  step 1: 4 agreed, then 5A and 5B appear at once  (a fork)
  step 2: block 6 builds on 5A                      (one side grows)
  step 3: 5A,6 chain is longer -> network adopts it (fork resolved)
A temporary fork: two valid block 5s, resolved once block 6 extends one branch. The abandoned block is called orphaned.

Soft forks and hard forks: changing the rules

The split above was accidental — two miners, same rules. But people sometimes want to change the rules themselves: add a feature, fix a flaw, tweak a limit. That is a different kind of fork, and it comes in two flavours depending on whether old software can still keep up.

A soft fork only tightens the rules — it makes some previously-allowed blocks no longer count. Nodes that never upgraded still see the new blocks as valid, because anything the new, stricter rule accepts was already acceptable under the old one. Old and new stay on one chain; the upgrade is backward-compatible.

A hard fork loosens or rewrites the rules — it makes blocks that the old software would reject suddenly valid. Now upgraded and un-upgraded nodes flatly disagree, and the chain can split permanently into two coins with a shared past and separate futures. A hard fork only stays peaceful if nearly everyone upgrades together.

Finality: when the past turns to stone

If forks can rearrange the very top of the chain, when is a transaction truly *done*? That settled-forever quality is called finality. On a work-based chain, finality is probabilistic: the moment a block is mined it could still be reorganized, but each new block stacked on top makes reversing it exponentially more expensive. After a handful of confirmations the odds of a reversal shrink toward zero, and after many, the block is treated as permanent for all practical purposes.

Some newer designs offer absolute finality instead, where a network of validators explicitly votes a block as final, after which it can never be undone without enormous, self-destructing penalties. Either way, the deeper a block is buried, the closer to stone it becomes. This is also why the chain can keep working even while a fraction of participants are offline, slow, or actively lying — a resilience that engineers call Byzantine fault tolerance, the ability to reach agreement despite some actors behaving badly.

The 51% attack: what it can and can't do

The whole "longest chain wins" rule rests on one assumption: honest participants control most of the power. So what if a single attacker controlled more than half of it? That is the famous 51% attack. With a majority, the attacker can consistently out-race everyone and build the longest chain at will. It sounds like total control — but its powers are narrow and specific, and far smaller than people fear.

What an attacker can do, all near the tip of the chain: reverse their *own* recent transactions by secretly building a longer chain and then revealing it — this is the double-spend (pay a merchant, then erase the payment after the goods ship). They can also choose to exclude or delay other people's transactions, censoring them for as long as they hold the majority.

What an attacker cannot do, no matter how much power they hold: steal coins from wallets they don't control (that would need each owner's private key, which no amount of hashing reveals); spend other people's money (transactions still require a valid signature); mint coins out of thin air or hand themselves a bigger reward (every node rejects blocks that break the issuance rules); or rewrite ancient history, since re-mining thousands of deep blocks faster than the rest of the world is wildly beyond even a majority. A 51% attack bruises the *recent* tip; it cannot melt the bedrock.

So the picture is reassuring once it's precise. Forks are a normal heartbeat the network heals on its own; rule changes are negotiated as soft or hard forks; and depth buys finality that even a majority attacker cannot unwind below the surface. With this, you understand not just *that* a blockchain is secure, but exactly *where* its security begins and ends.