论文标题

当深度学习符合智能合约时

When Deep Learning Meets Smart Contracts

论文作者

Gao, Zhipeng

论文摘要

以太坊已成为一个广泛使用的平台,以实现安全,基于区块链的财务和业务交易。但是,许多确定的智能合同中的错误和漏洞导致了严重的财务损失,这引起了人们对智能合同安全的严重关注。因此,非常需要更好地维护智能合同代码并确保其高可靠性。在这项研究中:(1)首先,我们提出了一种基于深度学习的方法,以学习固体智能合约的结构代码嵌入,这对于克隆检测,错误检测和智能合约的合同验证非常有用。我们将我们的方法应用于从以太坊区块链收集的22k固体合同中,结果表明,固体代码的克隆比率约为90%,比传统软件高得多。我们收集了52个已知的Buggy智能合约列表,这些合同属于我们的错误数据库,属于10种常见漏洞。我们的方法可以根据我们的错误数据库有效,准确地识别1000多个与克隆相关的错误。 (2)其次,根据开发人员的反馈,我们已经在名为SmarteMbed的基于Web的工具中实现了该方法,以促进使用我们的方法的坚固开发人员。我们的工具可以帮助固体开发人员有效地确定现有以太坊区块链中的重复性智能合约,并根据已知的错误检查合同,这可以帮助提高用户对合同可靠性的信心。我们优化了Smartembed的实现,该实现足以实时支持开发人员进行实际用途。以太坊生态系统以及个人坚固的开发人员都可以从我们的研究中受益。

Ethereum has become a widely used platform to enable secure, Blockchain-based financial and business transactions. However, many identified bugs and vulnerabilities in smart contracts have led to serious financial losses, which raises serious concerns about smart contract security. Thus, there is a significant need to better maintain smart contract code and ensure its high reliability. In this research: (1) Firstly, we propose an automated deep learning based approach to learn structural code embeddings of smart contracts in Solidity, which is useful for clone detection, bug detection and contract validation on smart contracts. We apply our approach to more than 22K solidity contracts collected from the Ethereum blockchain, results show that the clone ratio of solidity code is at around 90%, much higher than traditional software. We collect a list of 52 known buggy smart contracts belonging to 10 kinds of common vulnerabilities as our bug database. Our approach can identify more than 1000 clone related bugs based on our bug databases efficiently and accurately. (2) Secondly, according to developers' feedback, we have implemented the approach in a web-based tool, named SmartEmbed, to facilitate Solidity developers for using our approach. Our tool can assist Solidity developers to efficiently identify repetitive smart contracts in the existing Ethereum blockchain, as well as checking their contract against a known set of bugs, which can help to improve the users' confidence in the reliability of the contract. We optimize the implementations of SmartEmbed which is sufficient in supporting developers in real-time for practical uses. The Ethereum ecosystem as well as the individual Solidity developer can both benefit from our research.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源