Sezga
English
Sign in

Market history · · 6 min read

The DAO hack and the Ethereum hard fork

The DAO was a smart contract launched on Ethereum in 2016 to pool investors' ETH and let token holders vote on how to spend it; in June 2016 an attacker exploited a flaw in its code and drained about 3.6 million ETH. The Ethereum community responded in July 2016 with a hard fork that returned the funds to investors, and the original chain, kept alive by those who rejected the fork, became Ethereum Classic.

The episode was the first major test of smart contract security, of the "code is law" principle, and of the question of who actually gets to change a blockchain's rules.

What was The DAO?

DAO stands for decentralized autonomous organization: a structure whose rules live in a smart contract rather than with a board of directors. A smart contract is a program that runs on a blockchain and executes automatically when its conditions are met.

The DAO was the first ambitious attempt to put this idea into practice. The design was simple:

  • Participants sent ETH and received DAO tokens in return.
  • Token holders voted on proposals from projects asking for funding.
  • Any profits would flow back to token holders.
  • Anyone who disagreed with a decision could use a "split" function to take their share into a child DAO of their own.

During its funding period in April and May 2016, The DAO raised ETH worth roughly 150 million dollars at the prices of the time. That was a meaningful share of all ETH in circulation and made it one of the largest crowdfunding efforts of its era.

How the attack worked

The flaw sat in the split function. The contract sent ETH to a departing user first and only reset that user's balance to zero afterwards. The attacker put their own contract on the receiving end. As soon as it received ETH, it called the split function again, while the balance still showed the original amount. This class of bug is called reentrancy.

Here is the logic with hypothetical numbers:

  1. The attacker holds a 10 ETH share in the contract.
  2. The contract sends 10 ETH, but the recorded balance still reads 10.
  3. While the transfer is still running, the attacker's code calls the function again, and the contract sends another 10 ETH.
  4. If the loop runs five times, a 10 ETH share pulls out 50 ETH.

In the real attack the loop repeated many times, and on June 17, 2016 about 3.6 million ETH ended up in a child DAO controlled by the attacker. The DAO's own rules, however, kept funds in a new child DAO locked for roughly four weeks. That waiting period gave the community time to debate and decide. The news also hit the market: the price of ETH fell sharply once the attack became public.

Three options: do nothing, soft fork or hard fork

The community had three paths in front of it:

OptionWhat it meantOutcome
Do nothingLeave the chain as it was"Code is law" stays intact, the loss is permanent
Soft forkAdd a rule blocking the attacker from moving the fundsProposed, then dropped once it turned out to expose the network to denial-of-service attacks
Hard forkMove the funds by protocol rule into a refund contractActivated at block 1,920,000 on July 20, 2016

A hard fork is a rule change that is not backward compatible: nodes that do not run the new software will not accept the new chain. After the fork, the affected funds were moved into a withdrawal contract where token holders could redeem 1 ETH for every 100 DAO tokens. Someone holding 5,000 DAO tokens, for example, could get back 50 ETH.

Before the decision, an informal on-chain poll weighted by ETH balances came out in favor of the fork. Turnout was low, though, so the debate over the decision's legitimacy did not end there.

How Ethereum Classic was born

Not everyone went along. A group of users and miners argued that a blockchain's history should never be rewritten and kept running the old rules. The result was two separate chains sharing the same history up to block 1,920,000:

  • Ethereum (ETH): the chain that adopted the fork and returned the funds.
  • Ethereum Classic (ETC): the chain that rejected the fork and left the outcome of the attack untouched.

Anyone holding ETH at the moment of the split ended up with the same balance on both chains. Someone with 20 ETH, for example, now had 20 ETH and 20 ETC. In the early months the transactions of the two chains looked so alike that a transaction sent on one could also be valid on the other. This risk, known as a replay attack, was later addressed by adding a chain identifier to transactions.

Lessons from the attack

The DAO is not just a theft story. It left several lasting marks on the crypto world:

  • Update state first, send money last. Developers made the "checks-effects-interactions" pattern standard practice. Reentrancy is still among the first things code auditors look for.
  • Audits and gradual growth. Pooling about 150 million dollars in a single, insufficiently tested contract strengthened the later mindset of "start small and get audited."
  • Immutability is not absolute. A blockchain is technically hard to change, but if enough users, developers and miners agree, the rules can change. That can be read both as a safety net and as a governance risk.
  • The regulatory view. In a 2017 report, the US Securities and Exchange Commission (SEC) concluded that DAO tokens could be considered securities. That assessment became an early reference point in debates about later token sales.

Key takeaways

  • The DAO was an investment DAO launched on Ethereum in 2016 that raised ETH worth about 150 million dollars.
  • The attacker used a reentrancy bug, where funds were sent before the balance was updated, to drain about 3.6 million ETH.
  • Ethereum hard forked at block 1,920,000 on July 20, 2016 and moved the funds into a refund contract.
  • The chain kept by those who rejected the fork continued on its own path as Ethereum Classic.
  • The episode put smart contract audits, the "code is law" debate and blockchain governance permanently on the agenda.

The Sezga terminal

Live prices, liquidation feed, multilingual news, the Fed calendar, event memory and a paper-trading account on one screen. Access is by invitation.

Sign in

Related articles