首页|基于回声状态网络的智能合约漏洞检测方法

基于回声状态网络的智能合约漏洞检测方法

扫码查看
区块链平台上的智能合约是为链上各方提供安全可信赖服务的去中心化应用程序,而智能合约漏洞检测能确保智能合约的安全性.然而,现有的智能合约漏洞检测方法在样本数量不均衡和语义信息挖掘不全面时,会出现特征学习不足和漏洞检测准确率低的问题,而且,这些方法无法对新的合约漏洞进行检测.针对上述问题,提出一种基于回声状态网络(ESN)的智能合约漏洞检测方法.首先,根据合约图,对不同语义、语法边进行学习,并利用Skip-Gram模型训练得到特征向量;其次,结合ESN和迁移学习,实现对新合约漏洞的迁移扩展,以提高漏洞检测率;最后,在Etherscan平台搜集的智能合约数据集上进行实验.实验结果表明,所提方法的准确率、精确率、召回率和F1分数分别达到了94.30%、97.54%、91.68%和94.52%,与双向长短时记忆(BLSTM)网络、自注意力机制的双向长短时记忆(BLSTM-ATT)相比,所提方法的准确率分别提高了5.93和11.75个百分点,漏洞检测性能更优.消融实验也进一步验证了ESN对智能合约漏洞检测的有效性.
Smart contract vulnerability detection method based on echo state network
Smart contracts on blockchain platforms are decentralized applications to provide secure and trusted services to multiple parties on the chain.Smart contract vulnerability detection can ensure the security of these contracts.However,the existing methods for detecting smart contract vulnerabilities encountered issues of insufficient feature learning and low vulnerability detection accuracy when dealing with imbalanced sample sizes and incomplete semantic information mining.Moreover,these methods cannot detect new vulnerabilities in contracts.A smart contract vulnerability detection method based on Echo State Network(ESN)was proposed to address the above problems.Firstly,different semantic and syntactic edges were learned on the basis of contract graph,and feature vectors were obtained through Skip-Gram model training.Then,ESN was combined with transfer learning to achieve transfer and extension of new contract vulnerabilities in order to improve the vulnerability detection rate.Finally,experiments were conducted on the smart contract dataset collected on Etherscan platform.Experimental results show that the accuracy,precision,recall,and F1-score of the proposed method reach 94.30%,97.54%,91.68%,and 94.52%,respectively.Compared with Bidirectional Long Short-Term Memory(BLSTM)network and Bidirectional Long Short-Term Memory with ATTention mechanism(BLSTM-ATT),the proposed method has the accuracy increased by 5.93 and 11.75 percentage points respectively,and the vulnerability detection performance is better.The ablation experiments also further validate the effectiveness of ESN for smart contract vulnerability detection.

vulnerability detectionsmart contractEcho State Network(ESN)transfer learningblockchain

刘春霞、徐晗颖、高改梅、党伟超、李子路

展开 >

太原科技大学 计算机科学与技术学院,太原 030024

漏洞检测 智能合约 回声状态网络 迁移学习 区块链

2025

计算机应用
中国科学院成都计算机应用研究所

计算机应用

北大核心
影响因子:0.892
ISSN:1001-9081
年,卷(期):2025.45(1)