arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.07498cs.CR
收藏

语义侦探:通过大型语言模型识别庞氏合约

Semantic Sleuth: Identifying Ponzi Contracts via Large Language Models

Cong Wu, Jing Chen, Ziwei Wang, Ruichao Liang, Ruiying Du

AI总结:

提出PonziSleuth,首个无需标注数据的LLM驱动庞氏合约检测方法,通过两步零样本思维链提示分析源码,在基准和真实数据上表现优异,识别出15个新庞氏骗局。

摘要:

智能合约是直接编码在代码中的自动执行协议,是区块链技术的基础,特别是在去中心化金融(DeFi)和Web3领域。然而,智能合约中庞氏骗局的兴起带来了重大风险,导致巨额财务损失并侵蚀对区块链系统的信任。现有的检测方法,如PonziGuard,依赖大量标注数据,难以识别未见过的庞氏骗局,限制了其可靠性和泛化能力。相比之下,我们提出了PonziSleuth,这是首个无需标注训练数据的基于大型语言模型(LLM)的庞氏智能合约检测方法。PonziSleuth利用LLM的高级语言理解能力,通过一种新颖的两步零样本思维链提示技术来分析智能合约源代码。我们在基准数据集和真实世界合约上的广泛评估表明,PonziSleuth在无需大量数据需求的情况下,提供了可比甚至更优的性能,使用GPT-3.5-turbo实现了96.06%的平衡检测准确率,使用LLAMA3实现了93.91%,使用Mistral实现了94.27%。在真实世界检测中,PonziSleuth从Etherscan在2024年3月验证的4,597个合约中成功识别出15个新的庞氏骗局,假阴性率为0%,假阳性率为0.29%。这些结果突显了PonziSleuth检测多样化和新型庞氏骗局的能力,标志着在利用LLM增强区块链安全和减轻金融诈骗方面取得了重大进展。

英文摘要:

Smart contracts, self-executing agreements directly encoded in code, are fundamental to blockchain technology, especially in decentralized finance (DeFi) and Web3. However, the rise of Ponzi schemes in smart contracts poses significant risks, leading to substantial financial losses and eroding trust in blockchain systems. Existing detection methods, such as PonziGuard, depend on large amounts of labeled data and struggle to identify unseen Ponzi schemes, limiting their reliability and generalizability. In contrast, we introduce PonziSleuth, the first LLM-driven approach for detecting Ponzi smart contracts, which requires no labeled training data. PonziSleuth utilizes advanced language understanding capabilities of LLMs to analyze smart contract source code through a novel two-step zero-shot chain-of-thought prompting technique. Our extensive evaluation on benchmark datasets and real-world contracts demonstrates that PonziSleuth delivers comparable, and often superior, performance without the extensive data requirements, achieving a balanced detection accuracy of 96.06% with GPT-3.5-turbo, 93.91% with LLAMA3, and 94.27% with Mistral. In real-world detection, PonziSleuth successfully identified 15 new Ponzi schemes from 4,597 contracts verified by Etherscan in March 2024, with a false negative rate of 0% and a false positive rate of 0.29%. These results highlight PonziSleuth's capability to detect diverse and novel Ponzi schemes, marking a significant advancement in leveraging LLMs for enhancing blockchain security and mitigating financial scams.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑