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

Smart contracts represent a predefined set of rules invoked when specific conditions are met within blockchain networks, eliminating the need for centralized authority to validate transactions. The absence of 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, existing literature either grapples with class imbalance issues or relies on conventional methods. Moreover, 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 99.30% F1-Score with an inference time of 0.296 seconds. 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. • A novel DBESN model is proposed for detecting a malicious smart contract. • It is extended to locate vulnerable code fragments in the smart contract using the Local Interpretable Model-Agnostic Explanations (LIME) algorithm. • The proposed DBESN model achieved 98.62% accuracy and 99.30% F1-Score in detecting a malicious smart contract. • It requires only 0.296 seconds to detect a malicious smart contract. • The LIME algorithm can identify vulnerable code fragments in the smart contract within a reasonable time.

Authors

Institutions

Publication Details

Journal
Blockchain Research and Applications
Published
2025-05-08
DOI
https://doi.org/10.1016/j.bcra.2025.100304
Primary Topic
Blockchain Technology Applications and Security
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Vinita Jindal, Punam Bedi, Pushkar Gole, Ningyao Ningshen
Blockchain Research and Applications
Blockchain Technology Applications and Security
article

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

Vinita Jindal, Punam Bedi, Pushkar Gole, Ningyao Ningshen
article en

Abstract

Smart contracts represent a predefined set of rules invoked when specific conditions are met within blockchain networks, eliminating the need for centralized authority to validate transactions. The absence of 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, existing literature either grapples with class imbalance issues or relies on conventional methods. Moreover, 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 99.30% F1-Score with an inference time of 0.296 seconds. 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. • A novel DBESN model is proposed for detecting a malicious smart contract. • It is extended to locate vulnerable code fragments in the smart contract using the Local Interpretable Model-Agnostic Explanations (LIME) algorithm. • The proposed DBESN model achieved 98.62% accuracy and 99.30% F1-Score in detecting a malicious smart contract. • It requires only 0.296 seconds to detect a malicious smart contract. • The LIME algorithm can identify vulnerable code fragments in the smart contract within a reasonable time.

Blockchain Research and ApplicationsVol. 6(4)
University of Delhi (IN)
Peace, Justice and strong institutions
Openalex Percentile: Top 87%
Blockchain Technology Applications and Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.