SC-Bench:一个面向智能合约审计的大规模数据集
SC-Bench: A Large-Scale Dataset for Smart Contract Auditing
AI总结:
本文提出首个智能合约审计数据集SC-Bench,包含5,377个以太坊合约和15,975个ERC违规,并评估GPT-4在有、无oracle提示下的检测能力,揭示了ML审计方法的改进空间。
摘要:
确保区块链平台上所列智能合约符合安全和经济标准存在巨大需求。目前,通常采用人工形式的审计来实现这一目标。基于机器学习的自动化技术有望减轻人工工作以及由此产生的货币成本。然而,与其他机器学习技术取得巨大成功的领域不同,尚未有系统的机器学习技术被提出或应用于智能合约审计。我们提出了SC-Bench,这是第一个用于自动化智能合约审计研究的数据集。SC-Bench由5,377个运行在以太坊(一个广泛使用的区块链平台)上的真实世界智能合约以及15,975个违反以太坊标准(称为ERC)的违规行为组成。在这些违规行为中,有139个是程序员造成的真实违规。其余的是我们系统注入的错误,以反映对不同ERC规则的违反。我们通过同时向GPT-4提供合约和ERC规则作为提示来评估SC-Bench。此外,我们手动识别每条被违反的规则以及相应的代码位置(即oracle),并将这些信息作为提示提供给GPT-4,要求其回答一个真或假的问题。我们的结果表明,在没有oracle的情况下,GPT-4只能检测到0.9%的违规行为,而在有oracle的情况下,它能检测到22.9%的违规行为。这些结果表明基于机器学习的智能合约审计技术存在潜在的改进空间。
英文摘要:
There is a huge demand to ensure the compliance of smart contracts listed on blockchain platforms to safety and economic standards. Today, manual efforts in the form of auditing are commonly used to achieve this goal. ML-based automated techniques have the promise to alleviate human efforts and the resulting monetary costs. However, unlike other domains where ML techniques have had huge successes, no systematic ML techniques have been proposed or applied to smart contract auditing. We present SC-Bench, the first dataset for automated smart-contract auditing research. SC-Bench consists of 5,377 real-world smart contracts running on Ethereum, a widely used blockchain platform, and 15,975 violations of standards on Ehereum called ERCs. Out of these violations, 139 are real violations programmers made. The remaining are errors we systematically injected to reflect the violations of different ERC rules. We evaluate SC-Bench using GPT-4 by prompting it with both the contracts and ERC rules. In addition, we manually identify each violated rule and the corresponding code site (i.e., oracle) and prompt GPT-4 with the information asking for a True-or-False question. Our results show that without the oracle, GPT-4 can only detect 0.9% violations, and with the oracle, it detects 22.9% violations. These results show the potential room for improvement in ML-based techniques for smart-contract auditing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。