以太坊绝地求生之战:如何从攻击中重新站了起来?

2020-01-27 07:08:24

以太坊是一个基于区块链的开源平台,支持智能合约。以太坊平台生成的加密货币以太币是目前市值第二高的加密货币。

2016 年 6 月,以太坊发现自己受到了攻击,一位不知名的黑客利用一些已有的漏洞窃取了 360 多万以太币,价值 5000 万美金。

为了帮助区块链新手了解整个攻击的过程,下面我们介绍一些简单的专有名词:

DAO 是一个分布式自治组织,在这个计算机程序中,组织的策略和决策结构依靠智能合约在区块链上执行。它对所有参与者都是透明的,因此不需要中央集权。

智能合约是一种计算机协议,旨在以数字的方式促成合同的谈判,验证合同的真实性,并强制履行合同。智能合约无需第三方即可保证交易的可靠执行。这些交易可跟踪但不可逆。简而言之,智能合约是在以太坊区块链上执行的代码,可以与以太坊和用户钱包进行交互。

分布式账本是以太坊区块链上所有交易的公共数据库,并由每个以太坊节点维护。

以太坊使用了上述概念。这些区块链拥有两大重要的特性:安全性以及不可变性。如果这些非常核心的原则受到威胁,那么利益相关者必然会陷入疯狂!

攻击发生的背景故事

以太坊(Ethereum)由 21 岁的 Vitalik Buterin(以太坊创始人,人称“V 神”)于 2015 年创立,他希望通过以太坊在互联网上实现去中心化。众筹活动帮忙以太坊筹集了启动资金(共计售出了价值 1800 万美元的以太币)。

以太坊是一个分布式自治组织(DAO)。而“The DAO”是由德国的一家名为 Slock.it 的创业公司于 2016 年 4 月创建的一个 DAO。在启动两个月后,The DAO 发现自己受到了攻击,一位不知名的黑客不断地从 The DAO 中提取以太币,并转移到另一个子 DAO 中,该子 DAO 的结构与父 DAO 相同。这导致以太币的市场价格从 17.5 美元急剧下跌至 13 美元。

哪里出了问题?

6 月 17 日,The DAO 宣布找到了一个递归调用错误,但声称无需担心,所有资金都是安全的。6 天后,一位不知名的黑客窃取了价值 5000 万美元的以太币。这位攻击者还宣称自己的行为属于法律管辖权的合法范围内,因此无法对他提起刑事诉讼,因为他所做的一切都是利用了系统的漏洞。

攻击者干了什么?

这名黑客利用漏洞合法地窃取了以太币。以太坊是一个平台,其上的交易以“gas”为单位进行计算,这里的 gas 就是在区块链上执行智能合约所需的成本。攻击者利用这个漏洞,通过大量没有价值的非法交易增大了以太坊区块链的大小。这导致了对攻击者有用的交易延迟。

但是,攻击者无法在 28 天内提走子 DAO 中的以太币,因为这笔资金是子 DAO 的初始集资期。从子 DAO 中提款会引发警报。这位攻击者不敢冒这样的险!

===== BEGIN SIGNED MESSAGE =====
To the DAO and the Ethereum community,
I have carefully examined the code of The DAO and decided to participate after finding the feature where splitting is rewarded with additional ether. I have made use of this feature and have rightfully claimed 3,641,694 ether, and would like to thank the DAO for this reward. It is my understanding that the DAO code contains this feature to promote decentralization and encourage the creation of "child DAOs".
I am disappointed by those who are characterizing the use of this intentional feature as "theft". I am making use of this explicitly coded feature as per the smart contract terms and my law firm has advised me that my action is fully compliant with United States criminal and tort law. For reference please review the terms of the DAO:
"The terms of The DAO Creation are set forth in the smart contract code existing on the Ethereum blockchain at 0xbb9bc244d798123fde783fcc1c72d3bb8c189413. Nothing in this explanation of terms or in any other document or communication may modify or add any additional obligations or guarantees beyond those set forth in The DAO’s code. Any and all explanatory terms or descriptions are merely offered for educational purposes and do not supercede or modify the express terms of The DAO’s code set forth on the blockchain; to the extent you believe there to be any conflict or discrepancy between the descriptions offered here and the functionality of The DAO’s code at 0xbb9bc244d798123fde783fcc1c72d3bb8c189413, The DAO’s code controls and sets forth all terms of The DAO Creation."
A soft or hard fork would amount to seizure of my legitimate and rightful ether, claimed legally through the terms of a smart contract. Such fork would permanently and irrevocably ruin all confidence in not only Ethereum but also the in the field of smart contracts and blockchain technology. Many large Ethereum holders will dump their ether, and developers, researchers, and companies will leave Ethereum. Make no mistake: any fork, soft or hard, will further damage Ethereum and destroy its reputation and appeal.
I reserve all rights to take any and all legal action against any accomplices of illegitimate theft, freezing, or seizure of my legitimate ether, and am actively working with my law firm. Those accomplices will be receiving Cease and Desist notices in the mail shortly.
I hope this event becomes an valuable learning experience for the Ethereum community and wish you all the best of luck.
Yours truly,
"The Attacker"
===== END SIGNED MESSAGE =====
Message Hash (Keccak): 0xaf9e302a664122389d17ee0fa4394d0c24c33236143c1f26faed97ebbd017d0e
Signature: 0x5f91152a2382b4acfdbfe8ad3c6c8cde45f73f6147d39b072c81637fe81006061603908f692dc15a1b6ead217785cf5e07fb496708d129645f3370a28922136a32

以太坊尚未解决的弊端

以太坊设计师没有解决的问题是,所有以太币都存储在一个地址中。这给了黑客攻击的空间。当然,通过分叉阻止攻击的想法的确引起了参与者们的注意,但是时间太短,不足以形成共识并获得足够的投票数进行分叉。

提议的解决方案

现在只剩下两个办法了。一个是什么都不做,最终损失数千万美元。第二个解决方案是分两步走,首先进行软分叉,然后再进行硬分叉。但这违背了区块链“不可变性”这一主要原则,因此引发了很多质疑。

“开发社区提议软分叉(不过不会回滚,也不会撤销交易和区块),这会导致所有 The DAO 及其子 DAO 的交易都将无效,以此来阻止攻击者在 27 天后提取以太币。然后再进行一次硬分叉,找回所有以太币。”

—— Vitalik Buterin 于 6 月 17 日发布的《紧急状态更新:关于 The DAO 的漏洞》

然而,软分叉的想法被搁置了,因为这会引发许多安全方面的问题。另一方面,以太坊的大多数参与者投票赞成并同意了硬分叉提案。

以太坊绝地求生之战:如何从攻击中重新站了起来?

最终渡过了这个难关……

硬分叉于 2016 年 7 月 20 日落实。自此以后以太坊形成了两条链:一条为原链(以太坊经典,ETC),一条为新的分叉链(ETH)。

之后,以太坊采取了多种措施来防止区块链的规模再次扩大。此外,它还增加了针对拒绝服务攻击(DDoS)攻击的额外保护。

从那以后,以太坊重新从攻击中站了起来。它将挖矿方法从工作量证明原理改成了权益证明原理。如今,以太币成为了市场上第二大货币,市值高达 450 亿美元。(区块链大本营)

OKEX下载欧易下载OKX下载

okex交易平台app下载

下五篇