AuditGPT:利用ChatGPT审计智能合约
AuditGPT: Auditing Smart Contracts with ChatGPT
AI总结:
本文提出AuditGPT工具,利用大语言模型将ERC规则审计任务分解并设计专用提示,实现对以太坊智能合约ERC规则违规的自动全面检测,在实验中以低误报率超越专家审计服务。
摘要:
为了治理运行在以太坊上的智能合约,已制定了多个以太坊征求意见标准(ERC),每个标准都包含一套规则,用于指导智能合约的行为。违反ERC规则可能导致严重的安全问题和财务损失,这表明验证智能合约是否遵循ERC具有重要意义。当前此类验证的实践要么是人工审计每一个合约,要么使用专家开发的、范围有限的程序分析工具,两者在识别ERC规则违规方面都远未达到有效。本文提出了一个名为AuditGPT的工具,该工具利用大语言模型(LLMs)自动且全面地针对智能合约验证ERC规则。为了构建AuditGPT,我们首先对四个流行ERC中规定的222条ERC规则进行了实证研究,以理解其内容、安全影响、自然语言规范以及Solidity实现。在该研究的指导下,我们通过将庞大复杂的审计过程拆分为小而可管理的任务来构建AuditGPT,并为每种ERC规则类型设计专门的提示,以增强LLMs的审计性能。在评估中,AuditGPT成功定位了418处ERC规则违规,仅报告了18个误报,展示了其有效性和准确性。此外,AuditGPT在有效性、准确性和成本方面均优于安全专家提供的审计服务,证明了其相对于最先进智能合约审计实践的进步。
英文摘要:
To govern smart contracts running on Ethereum, multiple Ethereum Request for Comment (ERC) standards have been developed, each containing a set of rules to guide the behaviors of smart contracts. Violating the ERC rules could cause serious security issues and financial loss, signifying the importance of verifying smart contracts follow ERCs. Today's practices of such verification are to either manually audit each single contract or use expert-developed, limited-scope program-analysis tools, both of which are far from being effective in identifying ERC rule violations. This paper presents a tool named AuditGPT that leverages large language models (LLMs) to automatically and comprehensively verify ERC rules against smart contracts. To build AuditGPT, we first conduct an empirical study on 222 ERC rules specified in four popular ERCs to understand their content, their security impacts, their specification in natural language, and their implementation in Solidity. Guided by the study, we construct AuditGPT by separating the large, complex auditing process into small, manageable tasks and design prompts specialized for each ERC rule type to enhance LLMs' auditing performance. In the evaluation, AuditGPT successfully pinpoints 418 ERC rule violations and only reports 18 false positives, showcasing its effectiveness and accuracy. Moreover, AuditGPT beats an auditing service provided by security experts in effectiveness, accuracy, and cost, demonstrating its advancement over state-of-the-art smart-contract auditing practices.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。