liveBook · Manning

51% attack

As explained in Real-World Cryptography

A 51% attack is a blockchain attack in which an entity controls more computational power than the rest of the mining network and uses it to rewrite recent history.

Imagine Alice pays you, then secretly builds a competing chain that sends the same funds elsewhere. If her miners control slightly more computational power than everyone else, they can make that hidden chain longer. The network accepts it, discards your transaction, and Alice double-spends. section 12.2.3

A 51% attack works by:

  • Rewriting part of the ledger’s recent history. section 12.2.3
  • Using dominant hashing power to produce the longest chain. section 12.2.3
  • Replacing earlier payments with conflicting transactions and invalidating prior payees’ coins. section 12.2.3

Real attacks

Vertcoin suffered a double-spend attack in 2018; Ethereum Classic lost more than $1 million in 2019 after reorganizations exceeding 100 blocks; Bitcoin Gold lost 29 blocks and more than $70,000 in 2020. section 12.2.3

Figure 12.6 A fork in the blockchain: two miners publish a valid block at height 3 (meaning 3 blocks after genesis). Later, another miner mines a block at height 4 that points to the second block at height 3. As the second fork is now longer, it is the valid fork that miners should continue to extend. Note that arrows coming out of a block point to the parent block (the block they extend).

A fork diagram shows two valid branches and why miners continue extending the branch that becomes longer—the mechanism an attacker exploits. section 12.2.3

How Real-World Cryptography covers it

How deep it goes
Traces forks, longest-chain selection, ledger rewriting, and double-spending, but does not detail attack economics or defenses.
Examples
Uses Alice’s conflicting payments plus Vertcoin, Ethereum Classic, and Bitcoin Gold attacks as concrete examples.
What you can do after
Understand how a miner can exploit longest-chain acceptance to reverse transactions and double-spend funds.
How it connects
Connects blockchain forks, mining, hashing power, longest-chain consensus, ledger history, and double-spending.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.