Koinlytics

The DAO Hack of 2016

Historyintermediate7 min read
How a reentrancy bug drained $60M from Ethereum's first big smart contract and split the chain into ETH and ETC.

The DAO was the first major smart contract on Ethereum: a decentralized venture fund that raised ~$150M in ETH in 2016. In June 2016 an attacker exploited a reentrancy bug and drained ~$60M. The response split Ethereum forever.

How the exploit worked

The DAO's splitDAO function sent user's share of ETH before updating their balance. The attacker's contract recursively called splitDAO in the middle of the transfer, draining ETH before the balance was zeroed. The attacker got the same slice paid to them repeatedly.

The classic reentrancy pattern

  1. Contract sends ETH to attacker.
  2. Attacker's fallback function calls back into contract.
  3. Contract sees balance not yet updated.
  4. Sends ETH again.
  5. Repeat until pool empty.

Fix (checks-effects-interactions pattern): update state BEFORE external calls. Or use a reentrancy guard.

The response

Ethereum community debated: hard fork to reverse the exploit, or accept it. The debate was philosophical: is code law, or should social consensus override on-chain outcomes?

The split

Vitalik and majority backed a hard fork to restore stolen funds. Minority refused, arguing immutability was Ethereum's most important property. Result: two chains from block 1,920,000:

What it changed forever

Ironic epilogue

ETC has since suffered multiple 51% attacks. The chain that preserved immutability has proven less secure than the one that broke it.

PreviousMt. Gox: The Crypto Exchange That Broke Bitcoin NextThe Terra / Luna Collapse
Powered by Koinlytics · Free crypto education.

Ready to try what you just learned?

Open the Koinlytics dashboard and see the concepts live on your real portfolio.

Launch App