Figure 5-2 shows a depiction of the organization of an Ethereum application.
Here’s how DAOs basically work:
1 A group of people write a smart contract to govern the organization.
2 People add funds to the DAO and are given tokens that represent ownership.This structure works kind of like stock in a company, but the members have control of the funds from day one.
3 When the funds have been raised, the DAO begins to operate by having members propose how to spend the money. Voting may be affected by how much Ether the member risks or stakes in the DAO.
4 The members vote on these proposals.
5 When the predetermined time has passed and the predetermined number of votes has accrued, the proposal passes or fails.
6 Individuals act as contractors to service the DAO.
FIGURE 5-2:Ethereum.org blockchain application depiction.
Unlike most traditional investment vehicles, where a central party makes decisions about investments, the members of a DAO control 100 percent of the assets. They vote on new investments and other decisions. This type of structure threatens to displace traditional financial managers.
DAOs are built with code that can’t be changed on the fly. The appeal of this is that malicious hackers can’t monkey with the funds in a traditional sense. However, hackers can still find ways to execute the code in unexpected ways and withdraw funds. Also, the immutable nature of a DAO’s code makes it nearly impossible to fix any bugs once the DAO is live in Ethereum.
WITH GREAT POWER COMES … GREAT POWER
The first Ethereum DAO ever built is called, confusingly enough, “The DAO.” It’s an example of some of the dangers that come with decentralized and autonomous entities. It is the largest crowdfunded project in the world — its founders raised approximately $162 million in 26 days with more than 11,000 members. What people had thought was the greatest strength of The DAO became its greatest weakness. The immutable code within The DAO locked into place how the organization would be governed and how funds would be distributed. This allowed the members to feel secure in their investment. Although the code was well reviewed, not all the bugs had been worked out.
The first significant threat to Ethereum came from the hack of The DAO. An unexpected code path in The DAO’s contract allowed any sophisticated user to withdraw funds. An unknown user managed to remove about $50 million before he could be stopped.
The Ethereum community debated bitterly about whether it could or should reclaim the Ether. The DAO hacker had not technically done anything wrong or even hacked the system. Fundamentalists within the Ethereum community felt that code was law and, therefore, nothing should be done to recover the funds.
The very thing that made Ethereum strong was also its greatest weakness. Decentralization, immutability, and autonomy meant no central authority could quickly decide what to do. There was also no one to punish for the misuse of the system. It really did not have any consumer protection measures. It was a new frontier, like the software name suggested.
After spending several weeks discussing the problem, the Ethereum community decided to shut down The DAO and create a new Ethereum. This process is called hard forking. When the Ethereum community hard-forked the network, it reversed the transaction the hacker had committed. It also created two Ethereums: Ethereum and Ethereum Classic.
Not everyone was in agreement with this decision. The community continues to use Ethereum Classic. The tokens for Ethereum Classic are still traded but have lost significant market value. The new Ethereum token still hasn’t regained its old high from before the hack.
The decision to fork rocked the blockchain world. It was the first time a majority blockchain project had hard-forked to make whole an investor. It called into question many of the principles that make blockchain technology so attractive in the first place.
Ethereum has never been hacked. The hard fork in 2016 due to the DAO hack mentioned in the sidebar, “With great power comes … great power,” was not an actual hack of the system, but confusingly it is often referred to as a hack. Ethereum worked perfectly. The problem was it was too perfect. It became necessary to restart the system when a large amount of money and a majority of its users were threatened.
The only way to correct an action on a blockchain like Ethereum is to do a hard fork, which allows for a fundamental change to the protocol. (You can read more about forking in the context of cryptocurrency mining in Book 6, Chapter 8.) A hard fork makes previously valid blocks and transactions invalid. Ethereum did this to protect the funds that were being pulled out of the first DAO by a user. The DAO hack was, conceptually, one of the largest bug bounties ever.
That said, many scams and hacking attempts occur in the cryptocurrency space. Most of these attacks target centralized exchanges and applications. Many hackers want to steal cryptocurrency. It has real value and isn’t protected in the same ways that regular money is protected by governments. The anonymous nature of cryptocurrency also makes it appealing to crooks. Catching and prosecuting these individuals is difficult. However, the cryptocurrency community is fighting back and creating new measures to protect themselves.
Hacking one place is significantly easier and cheaper than trying to overcome a decentralized network. When you read about hacking in the blockchain world, it’s likely just a website or a cryptocurrency wallet that has been hacked, not the whole network.
Understanding smart contracts
Ethereum smart contracts are like contractual agreements, except there is no central party to enforce the contract. The Ethereum protocol “enforces” smart contracts by attaching economic pressure. They can also enforce implementation of a requirement if it lives within Ethereum, because Ethereum can prove certain conditions were or were not met. If it doesn’t live within Ethereum, it’s much harder to enforce.
Ethereum smart contracts are not yet legally enforceable and may never be because the perception is that you don’t need outside authorities enforcing agreements. Legal systems are controlled by governments. As they stand now, governments are central authorities — some with more or less consent and democratic principles. Within an Ethereum smart contract, each participant has an inalienable vote.
Ethereum smart contracts do not include artificial intelligence. This is a cool possibility in the near future. But for now, Ethereum is just software code that runs on a blockchain.
Ethereum smart contracts are not safe. The DAO hack is a great example of the type of dangers that can occur. It is still early days, and putting a lot of money into an unproven system isn’t smart. Instead, experiment with small amounts until all the bugs have been worked out of new contracts.
Discovering the cryptocurrency Ether
Ether is the name of the cryptocurrency for the Ethereum blockchain. It was named after the substance that was believed to permeate all space and make the universe possible. In that sense, Ether is the substance that makes Ethereum possible. Ether incentivizes the network to secure itself through proof-of-work mining, like how the token Bitcoin incentivizes the Bitcoin network. Ether is needed to execute any code within the Ethereum network. When utilized to execute a contract in Ethereum, Ether is referred to as gas.
Читать дальше