Explain me The DAO Hack as I am 5 and put a clear proposal on the table — To whom it may concern in the Ethereum Community Abueesp Follow Jun 20, 2016 · 10 min read

This article documents a current event. Information may change rapidly as the event progresses, and initial news reports may be unreliable. The last updates to this article may not reflect the most current information. Please, be careful taking your own decisions. *If you already know what The DAO Hack is, jump over (1)Intro and go directly to (2)Proposal and Common Mistakes.*

Hi friend ! Are you ready?

1. INTRO: Forensics in a nutshell. It’s Monday and I have been out the whole weekend. What did happen?

On Friday June 17th an attack vector was found and repeteadly exploited on the main Decentralized Organization smart contract, «The DAO». In a nutshell:

Using his DAO-tokens, the attacker executed the split proposal calling for the associated amount of ethers deposited in The DAO (~258 eth), and sending them to a new ChildDAO. Meanwhile the attacker moved DAO-tokens to other address. Then (s)he sends the tokens back (check out the transfers here). Here you have the bug: The attackers have all the things they need: an address in a split and new unspent tokens. And then, repeat the process.

Dealing with bugs like in the Bitcoin old days, right?. Do you remember hard-forks? Lovely and digital memories never go away. But this time the bug is not on the main database system, only in one contract stored on it. If just that line of code had been written after the next one…

The first hours were impressive. Price dumpers profited from the alarmism. Haters and trolls came up as headless chickens, with all kind of precooked articles ready to misinformate, counterinformate and self-promote. 3,641,694 ethers were being transferred, and counting. Both ETH-tokens and TheDAO-tokens prices sank 50%. Some users started to spam the network to stop the attacker transactions, while others sold or voted yes to the next incoming split proposals. Suddenly, the attack stopped.

Holy sh1t. I call those «Hardcore weekends». Are the funds lost?

The funds are not lost, or at least not yet. The window period worked as a security measure. The funds were neither lost nor stolen, but moved in an attempt to capture them. But why?

After the split, the ChildDAO was generated under the rules of The DAO smart contract framework. If the attacker wants to exit the funds, it might respect the protocol and wait for a 27 days window period. Only then the attacker could create a proposal on the ChildDAO for sending the hijacked funds to any personal address and vote for it.

But if we want to recover the funds, we need to get out a way to find a solution.

2. THE PROPOSAL: Wait a second. All my sisters' savings were into «The DAO» and now it's broken. What is that proposal?

There is always a solution. And sometimes, when there are several problems, there can be more than one solution.

Problem 1: In less of 27 days this attacker could escape with the funds. How can we gain time? Solution: «The Soft Fork»

This measure is taken to gain time and prevent irreversible damages caused by a fundamental bug of the contract. Most of The DAO tokenholders voted to correct the bug and suspend the 27-days window period while the issue is being analysed. Thus the changes were committed and implemented to Parity and Geth mining clients, which are both in a public repository that can also be forked by you at any time. No transaction is reversed and it only affect to the parties of The DAO contract.

There are stainless steel forks and wooden forks, and there also are soft forks and hard forks. Do you know what ‘to fork’ means?

Problem 2: Now there is a huge mess on the contract and the funds are currently blocked. How to fix this situation? Solution: «The Hard Fork»

This measure is taken to restore The DAO exactly how it was just before the bug of the contract was exploited and the common purpose of the contract was severely frustrated. Hence the fix may also implement a 'withdraw function' allowing tokenholders to terminate the contract. In a hard fork all those factors can be considered and corrected elegantly, so that the termination of the contract may securely imply that all the funds are coming back proportionally to their respective tokenholders. Especially if that member has tried undoubtedly to escape with the shared funds forcing the contract clauses. Miners will be free to decide if to fork or not. Do you remember what is mining anyway? According to the PoW consensus algorithm included on the Ethereum protocol it is the Ethereum community who choose. “It would not be a good to stay PoS having an untrusted entity holding a large percentage of the ether supply (Taylor Gerring)”. Sustaintability is essential on organizations and those are free to fork from abusing members. And, much more important, not continue running a system with a bug that has been exploited just only because it was written.

A special mention is deserved by the Lefteris’s solution: The DAO Counter-Attack. This blocks the funds and prevents the attacker to ever seeing any ether out of their theft. In this case perhaps is not the most efficient measure, but it formally impedes the rob without resorting to any fork.

Problem 3: There was a bug on this contract. How can I expect this won't happen again? Solution: «Learn hard, iterate hard»

This solution can be divided on two groups of measures:

Preventive measures: First of all, as a user. The contract code is available to be read on blockchain explorers such as EtherScan. As human-readable explanations and decentralized contract insurance components are still in development on block explorers, feel free to ask for extra documentation to the author and maintain your prudence. If you are reading a smart contract stored on the blockchain, so keep in mind that the bug could also be on the hosted website, or appears where the contract calls for external variables during its execution.

As a programmer, design with prudence and test your contract enough. As «given enough eyeballs, all bugs are shallow» share it with other colleagues. You can even create bounties before releasing. Contracts with several participants interacting at the same time (such as DOs) are quite more complex and easier to hack, even using social engineering techniques. Likewise, take care of who, or at least how, a person controls the contract, the damage to the architecture could be largely more expensive than what was obtained in exchange.

Stop thinking machine learning will make lawyers (not clerks) disappear. That is simply false. Code is Law as Law is Code. Actually, we need more lawyers who can code and more engineers who know law. As Piper already mentioned during the Devcon1, a set of standardized components is becoming the more and more a necessity. There are coding patterns which are more dangerous and vulnerable than others, and some spend more gas to be executed. Variable names might be signalled or coloured to warn polysemy, homonyms and unrecognised values to prevent intended or unintended errors. At a lower level Solidity operators can also be defined, checked, improved and homogenized using EIPs. Thus high-level tools (including IDEs, formal verification, debuggers, symbolic execution) that make it easy to write safe smart contracts on Ethereum are first candidates for DevGrants, Blockchain Labs grants and String’s autonomous finance grants.

A crowdsourced list of all incidents and bugs of smart contracts that led to actual or potential thefts or losses is being made. Both individually and collectively, we learn more from our failures than from our successes. I can take no more than a short glance to the future, but I would bit in Augur the real and wise Ethereum community will resist and evolute a lot thanks to this unprecedent lesson.

Reactive measures: A small pre-consensuated guide to deal with those situations, or well-designed decentralized "red-button" functions to terminate or void ab initio the contract, or reducing complexity determining some internal and external variables -such as the agreed purpose of the contract-, would be both really helpful, specially during the curse of the largest funded and most complex organizational contracts.

Counter-attacks, exchangers’ KYC/AML cooperation, and the already cited measures are largely preferable if they are effective. As a last resource there is always the possibility of forks. If miners need to inform themselves regularly from each and every bug or scam and finally become, or delegate into, a decentralized court of sysops till Ethereum is shifting to PoS, perhaps in the future they might be rewarded additionally for this task.

Common Mistakes: «I still think Ethereum is centralized and The DAO too big to fail. Do not reverse transactions. Do not bail out. Start a lawsuit, bitcoinize Ethereum or kill someone».

Children games before they become social

Go out, enjoy people and the Nature, it has been a long weekend. If you want to positively participate instead, you are also very welcome. But first please notice that:

3. BONUS: A humble opinion about the current situation of Ethereum. «Yep, as everybody, I also have one.».

About strings theory, human holons and community values

Humans, organizations, and societies. We are complex adaptive organisms and I would bit that, in many aspects, NP-complete. Our social identity is built from an ocean made up by multiple vibrating and entangled states of interaction. Sometimes things we care about cannot be summed by a few simplistic rather than simple rules. Sometimes losing even a small part that make up our values could lead to unacceptable results to most of us.

A set of protocols, infrastructures, tools, standards, processes and agreements are embedded technologies into our sociocultural chromosomes. Constitutional records, tokenizations and state protocols. Some pieces, such as the backbones, are already here. Others, such as the autonomous nervous systems, are almost ready too. What you need to get a reliable distributed wisdom and a kernel in common as basis to build a sustainable way to get the most from our values and coexist in peace in this wonderful world where resources are sometimes scarce.

This social disruption started long before the invention of the papyrus and the popularization of the printer press during the Industrial Revolutions. Encyclopedias, registers, notes, votes, contracts and so forth. Now it is happening again with Internet and the Digital Revolutions. The Ethereum community is at the cutting-edge side of the History, not only by releasing the first Decentralized Organization. The decentralized smart property protocol Slock.it, the distributed electricity transaction layer TransactiveGrid, the transparent supply chain system Provenance, the disruptive Liquid Democracy voting system DTHPool, the promising Random Number Generator DAO RanDAO, the Consensys Identity System supported by Microsoft and introduced to the United Nations in the New York Identity ID2020 Conference… and the DApps list becomes longer every day.

Banks could embrace Bitcoin’s heart, but not its soul. Real does not mean royal.

What is the key for those birds to fly together? The Ethereum community it is still healthy and full of kind and wise people. It is not only Vitalik, Gavin and many other courageous and extraordinary human beings. New awesome and brilliant members are the more and more joining and collaborating. Geniuses are really valuable and necessary and Internet has connected them. People open-minded and open-hearted enough to see the other side of the problem. For the rest, maintain the values and high standards. Work hard, care from each other, keep it real, and everything shall be.