Smart contracts are essential for managing digital assets in blockchain networks, highlighting the need for effective security measures. This paper introduces SmartLLMSentry, a novel framework that leverages large language models (LLMs), specifically ChatGPT with in-context training, to advance smart contract vulnerability detection. Traditional rule-based frameworks have limitations in integrating new detection rules efficiently. In contrast, SmartLLMSentry utilizes LLMs to streamline this process. We created a specialized dataset of five randomly selected vulnerabilities for model training and evaluation. Our results show an exact match accuracy of 91.1% with sufficient data, although GPT-4 demonstrated reduced performance compared to GPT-3 in rule generation. This study illustrates that SmartLLMSentry significantly enhances the speed and accuracy of vulnerability detection through LLMdriven rule integration, offering a new approach to improving Blockchain security and addressing previously underexplored vulnerabilities in smart contracts.
翻译:智能合约在区块链网络中对于管理数字资产至关重要,这凸显了采取有效安全措施的必要性。本文介绍了SmartLLMSentry,一种新颖的框架,它利用大语言模型(LLMs),特别是经过上下文训练的ChatGPT,来推进智能合约漏洞检测。传统的基于规则的框架在高效集成新检测规则方面存在局限。相比之下,SmartLLMSentry利用LLMs来简化这一过程。我们创建了一个包含五种随机选取漏洞的专用数据集,用于模型训练和评估。我们的结果显示,在数据充足的情况下,精确匹配准确率达到91.1%,尽管在规则生成方面,GPT-4的表现相较于GPT-3有所下降。本研究证明,SmartLLMSentry通过LLM驱动的规则集成,显著提升了漏洞检测的速度与准确性,为增强区块链安全性和应对智能合约中先前未被充分探索的漏洞提供了一种新方法。