DBESN: A novel model for detecting and identifying malicious code in a smart contract

IF 6.5 3区 计算机科学 Q1 COMPUTER SCIENCE, INFORMATION SYSTEMS
Blockchain-Research and Applications Pub Date : 2025-12-01 Epub Date: 2025-05-07 DOI:10.1016/j.bcra.2025.100304
Punam Bedi , Vinita Jindal , Ningyao Ningshen , Pushkar Gole
{"title":"DBESN: A novel model for detecting and identifying malicious code in a smart contract","authors":"Punam Bedi ,&nbsp;Vinita Jindal ,&nbsp;Ningyao Ningshen ,&nbsp;Pushkar Gole","doi":"10.1016/j.bcra.2025.100304","DOIUrl":null,"url":null,"abstract":"<div><div>Smart contracts represent a predefined set of rules invoked when specific conditions are met within blockchain networks, eliminating the need for a centralized authority to validate the transactions. The absence of a central authority can potentially expose smart contracts to fraudulent behavior. Moreover, implementation flaws in smart contracts can be exploited to cause unintended behavior, resulting in security or financial risks. Traditionally, the identification of vulnerabilities in smart contracts has relied on methods such as pattern matching, data flow analysis, and input testing. While these techniques are foundational, they are constrained by human limitations and may not comprehensively address the full spectrum of potential issues. This necessitates more advanced approaches to ensure robust security and reliability. Therefore, in the literature, numerous researchers have leveraged different machine learning (ML) and deep learning (DL) techniques to classify normal and malicious smart contracts. However, the existing literature either grapples with class imbalance issues or relies on conventional methods. Moreover, the existing research often falls short of locating the exact location of malicious code within the smart contracts. Therefore, to address these gaps, this paper proposes a novel model called the dual-branch encoder Siamese network (DBESN) for detecting malicious smart contracts. Furthermore, this model is extended to precisely identify the region of the vulnerable code fragment within the smart contract using the local interpretable model-agnostic explanations (LIME) algorithm. Experimental results demonstrated a performance accuracy of 98.62% and an F1-score of 99.30% with an inference time of 0.296 s. Given the high performance coupled with the low inference time of the proposed DBESN model, it is suitable for deployment within blockchain networks to detect and identify malicious smart contracts effectively and efficiently.</div></div>","PeriodicalId":53141,"journal":{"name":"Blockchain-Research and Applications","volume":"6 4","pages":"Article 100304"},"PeriodicalIF":6.5000,"publicationDate":"2025-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Blockchain-Research and Applications","FirstCategoryId":"1093","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2096720925000314","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/5/7 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INFORMATION SYSTEMS","Score":null,"Total":0}
引用次数: 0

Abstract

Smart contracts represent a predefined set of rules invoked when specific conditions are met within blockchain networks, eliminating the need for a centralized authority to validate the transactions. The absence of a central authority can potentially expose smart contracts to fraudulent behavior. Moreover, implementation flaws in smart contracts can be exploited to cause unintended behavior, resulting in security or financial risks. Traditionally, the identification of vulnerabilities in smart contracts has relied on methods such as pattern matching, data flow analysis, and input testing. While these techniques are foundational, they are constrained by human limitations and may not comprehensively address the full spectrum of potential issues. This necessitates more advanced approaches to ensure robust security and reliability. Therefore, in the literature, numerous researchers have leveraged different machine learning (ML) and deep learning (DL) techniques to classify normal and malicious smart contracts. However, the existing literature either grapples with class imbalance issues or relies on conventional methods. Moreover, the existing research often falls short of locating the exact location of malicious code within the smart contracts. Therefore, to address these gaps, this paper proposes a novel model called the dual-branch encoder Siamese network (DBESN) for detecting malicious smart contracts. Furthermore, this model is extended to precisely identify the region of the vulnerable code fragment within the smart contract using the local interpretable model-agnostic explanations (LIME) algorithm. Experimental results demonstrated a performance accuracy of 98.62% and an F1-score of 99.30% with an inference time of 0.296 s. Given the high performance coupled with the low inference time of the proposed DBESN model, it is suitable for deployment within blockchain networks to detect and identify malicious smart contracts effectively and efficiently.
DBESN:一种用于检测和识别智能合约中恶意代码的新模型
智能合约代表了区块链网络中满足特定条件时调用的一组预定义规则,从而消除了对中心化机构验证交易的需要。缺乏中央权威可能会使智能合约暴露于欺诈行为。此外,智能合约中的实施缺陷可能会被利用来引发意外行为,从而导致安全或财务风险。传统上,智能合约中的漏洞识别依赖于模式匹配、数据流分析和输入测试等方法。虽然这些技术是基础的,但它们受到人类局限性的限制,可能无法全面解决所有潜在问题。这就需要更先进的方法来确保强大的安全性和可靠性。因此,在文献中,许多研究人员利用不同的机器学习(ML)和深度学习(DL)技术对正常和恶意智能合约进行分类。然而,现有的文献要么与阶级不平衡问题作斗争,要么依赖于传统的方法。此外,现有的研究往往无法确定恶意代码在智能合约中的确切位置。因此,为了解决这些差距,本文提出了一种称为双分支编码器暹罗网络(DBESN)的新模型,用于检测恶意智能合约。此外,该模型被扩展到使用本地可解释模型不可知解释(LIME)算法精确识别智能合约中易受攻击的代码片段的区域。实验结果表明,该算法的性能准确率为98.62%,f1得分为99.30%,推理时间为0.296 s。鉴于所提出的DBESN模型的高性能和低推理时间,它适合部署在区块链网络中,有效地检测和识别恶意智能合约。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
11.30
自引率
3.60%
发文量
0
期刊介绍: Blockchain: Research and Applications is an international, peer reviewed journal for researchers, engineers, and practitioners to present the latest advances and innovations in blockchain research. The journal publishes theoretical and applied papers in established and emerging areas of blockchain research to shape the future of blockchain technology.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书