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
- Vinita Jindal (ORCID: https://orcid.org/0000-0002-0481-4840)
- Punam Bedi (ORCID: https://orcid.org/0000-0002-6007-7961)
- Pushkar Gole (ORCID: https://orcid.org/0000-0002-0715-9490)
- Ningyao Ningshen
Institutions
- University of Delhi (IN)
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