Blockchain Study Notes 22 - ETH-TheDAO

Blockchain Study Notes 22 - ETH-TheDAO

Learning video: Notes on "Blockchain Technology and Application"
by Mr. Xiao Zhen from Peking University Reference: Notes on the public course series "Blockchain Technology and Application" by Mr. Xiao Zhen from Peking University - Directory Navigation Page

DAO: Decentralized Autonomous Organization (Decentralized Autonomous Organization) is built on code, rules and regulations are written in code, and the normal operation of rules and regulations is maintained through consensus protocols.
DAC: Decentralized Autonomous Corporation (Decentralized Autonomous Corporation) for for-profit purposes, DAO can be for non-profit purposes.

In May 2016, a DAO dedicated to crowdfunding investment appeared - TheDAO: it is essentially a smart contract, you can send ether to the smart contract, and then exchange the tokens for TheDAO, and vote when deciding which project to invest in. The voting weight is determined by TheDAO's tokens, and the benefits are also distributed according to the rules and regulations of the smart contract.
TheDAO was a great attempt that quickly attracted a lot of money, but quickly failed

splitDAO function

If someone's investment philosophy is different from that of most people, they can split into a sub-fund through splitDAO, and the previous tokens will be recovered, exchanged for the corresponding amount of ether to the sub-fund, and then invest in the projects they want to invest in. This is also the only way to get your money back.
A 7-day debate period before the split and a 28-day lock-up period after the split

The hacker transferred USD 5,000w of ether through a re-entrant attack, and almost 1/3 of the total funds were insert image description here
discussed in the Ethereum community. The solution was divided into two factions
. One is to roll back the transaction: there is a 28-day lock-up period, and the hacker is temporarily unable to withdraw the money. Go, secure the investor's interest by rolling back the transaction.
The other school believes that there is no need for remediation: because the hacker's behavior is not illegal, code is law, and loopholes in the code are also part of the rules. The
Ethereum development team supports taking remedial measures

remedy

Starting from the fork from the previous block where the hacking occurred, the upper chain will not be mined, and the lower chain will be mined to make the lower chain longer.
insert image description here
However, this will cause many legitimate transactions to be rolled back. If you want to roll back, you must accurately locate and roll back only the transactions that hackers stole the ether. This is the principle of taking remedial measures.

The development team developed a "two-step" approach:

  1. Soft fork plan: Lock the hacker account, the development team released a software upgrade, adding a rule-any account related to TheDAO fund is not allowed to do any transactions. This is a soft fork.
    But there is a bug after the release - related to gas fees, transactions related to The DAO's account will not be executed, do you need to charge gas fees at this time?
    This new rule does not charge gas fees. At this time, some malicious attackers may continue to send such illegal transactions to waste miners' resources, which causes most of the miners who have already upgraded to roll back the software upgrade and change back to In the previous version, this soft fork solution failed. There is not much left in the 28-day lock-in period.
  2. Hard fork solution: All funds in TheDAO account are forcibly transferred to another smart contract through software upgrade. This smart contract has only one refund function. The updated software stipulates the specific date of enforcement, and automatically executes transfer transactions in 192W blocks, no legal signature is required, and the rules are written in the software, so the old miners will not approve it, so it is a hard split cross.

Finally, it was decided by voting that most of the miners supported the hard fork and upgraded the version of the hard fork, so everyone waited for the moment when 192W blocks were dug. There was no accident this time, and the hard fork was successful.

However, those who opposed the hard fork at the beginning did not change their position because of the voting results, so the old chain did not die. There are still miners mining, but the computing power has dropped significantly, but the mining difficulty has also dropped significantly, so There are still miners willing to mine on the old chain.

Ether on the old chain: ETC Ether
on the new chain: ETH
But splitting two chains brings confusion to management, such as replay attacks, transactions on the new chain are legal in the old chain, and transactions on the old chain are legal. It is also legal to place transactions on the new chain. Later, chainIDs were added to the two chains to distinguish them.

Q: Why was the operation of the hard fork and soft fork targeted at all The DAO accounts instead of only the hacker’s accounts?
Once a smart contract is released, it cannot be modified, and this bug cannot be fixed. If the hacker uses it this time, other accounts can also use it next time. Anyone can become a hacker, and the contract is void.

Guess you like

Origin blog.csdn.net/shn111/article/details/122659383