Next Article in Journal
Time-Varying Autoregressive Models: A Novel Approach Using Physics-Informed Neural Networks
Previous Article in Journal
Channel Estimation for Intelligent Reflecting Surface Empowered Coal Mine Wireless Communication Systems
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Ascertaining Susceptibilities in Smart Contracts: A Quantum Machine Learning Approach

by
Amulyashree Sridhar
1,
Kalyan Nagaraj
2,*,
Shambhavi Bangalore Ravi
2 and
Sindhu Kurup
2
1
Department of Computer Science and Engineering, Amrita School of Computing, Amrita Vishwa Vidyapeetham, Bengaluru Campus, Bengaluru 560035, Karnataka, India
2
Department of Computer Science and Engineering (Data Science), B.M.S. College of Engineering, Basavanagudi, Bangalore 560019, Karnataka, India
*
Author to whom correspondence should be addressed.
Entropy 2025, 27(9), 933; https://doi.org/10.3390/e27090933
Submission received: 13 June 2025 / Revised: 10 August 2025 / Accepted: 26 August 2025 / Published: 4 September 2025
(This article belongs to the Section Information Theory, Probability and Statistics)

Abstract

The current research aims to discover applications of QML approaches in realizing liabilities within smart contracts. These contracts are essential commodities of the blockchain interface and are also decisive in developing decentralized products. But liabilities in smart contracts could result in unfamiliar system failures. Presently, static detection tools are utilized to discover accountabilities. However, they could result in instances of false narratives due to their dependency on predefined rules. In addition, these policies can often be superseded, failing to generalize on new contracts. The detection of liabilities with ML approaches, correspondingly, has certain limitations with contract size due to storage and performance issues. Nevertheless, employing QML approaches could be beneficial as they do not necessitate any preconceived rules. They often learn from data attributes during the training process and are employed as alternatives to ML approaches in terms of storage and performance. The present study employs four QML approaches, namely, QNN, QSVM, VQC, and QRF, for discovering susceptibilities. Experimentation revealed that the QNN model surpasses other approaches in detecting liabilities, with a performance accuracy of 82.43%. To further validate its feasibility and performance, the model was assessed on a several-partition test dataset, i.e., SolidiFI data, and the outcomes remained consistent. Additionally, the performance of the model was statistically validated using McNemar’s test.

1. Introduction

Centralized systems were proposed to facilitate parties performing commercial transactions by connecting with each other using a trustworthy third-party dealer (like banks). However, entrusting third-party vendors has often proceeded to infringement of privacy and security inconsistencies, also leading to towering transactional overheads [1]. Blockchain technology was proposed to overcome these disputes by permitting contributors to reach an agreement regarding their transactions without any association with a reliable third party [2]. Blockchain can be understood as a distributed databank that preserves the history of all negotiations that have happened within its network [3,4]. It is also the revolutionary method behind the first distributed automated payment system, i.e., Bitcoin [5].
Blockchain has further progressed to assist in abundant decentralized approaches which are beyond the scope of economic operations. These implementations depend on the performance of smart contracts within the blockchain network. Smart contracts were conceptualized by Szabo [6]; they are basically computer programs which decode a covenant, in the form of a digital contract, based on predefined, concise rules. These contracts are deployed within the blockchain network for executing transactions, designed to replace traditional paper-based agreements [7]. Smart-contract-facilitated transactions are ideally transparent, unalterable, and distinguishable. These contracts are usually transcribed in explicit domain-based languages, including Solidity, Pact, and Liquidity, for the Ethereum, Kadena and Tezos platforms. These contracts are deployed and executed by miners, which are a special type of participants employed for executing transactions in the blockchain. Miners are paid for their job based on the computational overheads required for completing a task [8]. With the progression of smart contracts, enormous numbers of contracts are being deployed presently on the blockchain, making it impracticable to employ manual examination [9]. There are strong possibilities of security breaches as the contract layer within the blockchain network has pronounced involvement with the blockchain mechanism, often leading to storage and resource exploitation [10]. Initially, a miner node is identified to create a block within the network. However, the location of the miner node is habitually unverified, whether it is being executed from a trusted environment or not. Suppose the miner node turns out to be malevolent. It could then manipulate complete transactions within the block, resulting in major security breaches [11]. Also, contracts need to call one another iteratively to attain complicated functionality. However, referring to an external duplicitous contract could raise the possibility of errors and security threats if the contract turned out to be vindictive [12]. Also, as smart contracts can be inscribed and deployed by any user with various coding capabilities and designing platforms, there is no assurance for anyone deploying smart contracts without security constraints [13]. Similarly, smart contracts have exclusive features, like the gas mechanism, as compared to conventional codes. Suppose a smart contract is poorly designed. It could then utilize much of the gas, resulting in a halting of operations due to excessive resource consumption [14,15]. Correspondingly, due to the remarkable relationship between smart contracts and financial markets, numerous attacks have been executed by manipulating susceptibilities of smart contracts for earning profit deployment [16]. To ensure data reliability and distinguishability of transactions, contracts, once executed, are unable to be altered post-deployment.
Susceptibility in contracts refers to any code-level weakness, design flaw, or operational condition that could potentially be exploited to cause undesired behavior, resource exhaustion, or financial loss. Detecting these vulnerabilities is one of the essential aspects of the development and disposition of smart contracts. In cases when susceptibilities are identified, they cannot be mitigated by upgrading versions or patching due to evidence of tampering; hence, they must be often self-destructed. Therefore, it is evident that the presence of malignant attacks cannot be prevented on smart contracts. An instance of this is the famous “DAO (Decentralized Autonomous Organization)” incident, which accounted for about ETH 2 million (i.e., USD 50 million) in financial losses due to the exploitation of reentrancy vulnerability by attackers. Reentrant issues led to susceptibilities in the contract, which were exploited by a recursive call to the “splitDAO” function within the contract to withdraw ETH [17]. It is evident that gaining control of smart contracts has resulted in unbearable losses, for example, by manipulating the bZx protocol, where virtual assets were withdrawn by attackers by restraining the oracle, ensuring a profit of ETH 2000 or more [18]. These attacks reflect the impact on financial assets in cases when smart contracts are attacked and manipulated. Therefore, it is vital to detect liabilities in contracts at an earlier stage to mitigate security breaches of assets. Detecting vulnerabilities is one of the essential aspects in the development and disposition of smart contracts [19].
Currently, susceptibilities in smart contracts are identified using numerous approaches including human evaluation [20], fuzz analysis [21], static investigation [22] and precise authentication. Also, vulnerability detection tools like Mythril [23], Oyente [24], Slither [25], Securify [26] and Smartcheck [27] have been adopted to ascertain attacks on smart contracts. These tools interpret the code within contracts to recognize diverse vulnerabilities, including relinquished exceptions, timestamp reliance, reentrancy and improper tx.origin consent. However, these tools sometimes generate false negatives and false positives instances as they are extremely dependent on preconceived recognition rules and lack the competence to precisely capture composite logic. Also, these premediated rules become obsolete over a point of time, making it challenging to acclimatize and produce new data, which is essential for analyzing large instances of smart contracts in less amount of time [28].
Moreover, detecting unknown vulnerabilities in smart contracts is a challenging issue in smart contracts [29]. It is worth noting that machine learning (ML) algorithms have been adopted for detecting these vulnerabilities, as they are known to capture liabilities by apprehending knowledge patterns in less time with improved performance [30]. Previous studies have shown that employing ML models to detect obligations in smart contracts has led to substantial amendments in vulnerability detection as compared to traditional vulnerability detection techniques [31,32]. Specifically, deep learning (DL) technology has been adopted ardently as an effective approach to detect vulnerabilities within contracts. These models are employed to extract relevant attributes from large data to detect liabilities [33]. Diverse variants of DL techniques have been employed to detect vulnerabilities [34,35,36,37]. However, some DL approaches habitually disregard implication of liable attributes during data pre-processing tasks, while some models lack competence in semantic examination, leading to instances of false positives in identifying vulnerabilities [38,39,40]. Despite its widespread application in vulnerability detection, ML algorithms have certain limitations. Additionally, as the size of contracts upsurges, the cost of training ML algorithms also intensifies exponentially. Furthermore, expansion of classical ML algorithms would also result in storage and performance constraints [41]. All these encounters must be addressed while employing ML approaches in detecting smart contract vulnerabilities.
Quantum computing, on the other hand, can be used to solve storage constraints of classical computers. The field is centered on fundamentals of quantum mechanics, including qubits (i.e., quantum bits), superposition, entanglement and interference, for processing data. As compared to a classical bit, qubit could either have a zero state, one state or an amalgamation of two states at an equivalent time, which is recognized as linear superposition [42,43]. Quantum computers also employ ML approaches to solve concrete glitches with improved accuracy and speed, as compared to classical computers. The domain that combines quantum computers with ML algorithms is referred to as ‘Quantum Machine Learning’ (QML) [44,45]. At present, QML approaches have been employed in fields of natural language processing (NLP) [46,47,48], speech recognition [49], recommendation systems [50] and image processing [51]. These QML techniques are known to enhance the execution time and efficiency of programs. They are also recognized to perform better than traditional DL algorithms through effective training and learning from large data [52,53].
Centered on above fundamentals, the current study attempts to detect liabilities in smart contracts by employing QML algorithms [54]. To the best of our awareness, there has been very limited research attempted to identify and validate smart contract vulnerabilities by employing QML approaches [55]. These techniques are known to solve memory and performance constraints of traditional ML algorithms. Feasibility of these techniques is examined towards uncovering liabilities in smart contracts. The contributions of the present study are summarized below:
  • Presently, no research has been attempted to detect smart contract vulnerabilities using QML algorithms. To fill this existing gap, the current study employs four well known QML algorithms to detect vulnerabilities.
  • Compared to classical ML algorithms, QML algorithms were able to process knowledge within smart contracts by consuming less memory and by utilizing the benefits of quantum mechanics. In addition to liability detection, the current work also implies prospects of network security implications from outcomes of QML approaches.
  • Employing QML models for detecting liabilities in smart contracts on a larger scale would be beneficial. Non-uniform lengths of contracts were analyzed effectively using QML algorithms, especially by the quantum neural network (QNN) approach, thus solving the problem of inconsistent input lengths. Also, vulnerabilities were detected in batches using these QML algorithms, reflecting the capability of batch processing.
  • Experimentations revealed that the QNN model outperformed other QML algorithms in detecting vulnerabilities with a performance accuracy of 81.78%. This accuracy was further improved to 97.63% on a test dataset. The average accuracy of the model on small-scale smart contracts datasets derived from splitting the test dataset was found to be 89.96%.

2. Literature Survey

This section highlights significance of previous studies in discovering vulnerabilities from smart contracts.

2.1. Significance of Security in Smart Contracts

Smart contracts are a variant of digital arrangement, which automatically operates on a blockchain network, given gratification of explicit conditions. They are programmatically similar to ‘If-then’ statements, which could be executed without the need of a third party (i.e., decentralized architecture). These contracts include code attributes for storing details, distributing ethers and collaborating with other contracts that aid in decision making. They empower reliable transactions, which are often irretrievable and perceptible [56]. Compared to conventional contracts, smart contracts are often revered for their effectiveness in minimizing transactional risks, service and administrative costs, which in turn improves the efficacy of business transactions [57]. As of January 2022, over 637 million smart contracts have been deployed in Ethereum Virtual Machines (EVMs) [58].
Despite numerous benefits, these contracts have certain limitations which need to be addressed. Regardless of being an asset in blockchain [59], they are often targeted by hackers. The reason is quite simple: these contracts frequently store excessive amounts of implicit currency and execute immutable code based on previously deployed contracts, often resulting in disposed fortification, which could be exploited [60]. Also, these contracts are immutable; once deployed, any security issues cannot be tackled, leading to an irretrievable dent. Recently, innumerable security breaches have arisen while developing and deploying these contracts. All these mishaps have resulted in extensive financial losses. One such instance is the attack that happened on Binance (BNB) smart chain (i.e., BSC), which is a platform for developing high-performance decentralized blockchain applications. On 7 October 2022, BNB chain was attacked by hackers to loot about two million coins within a span of two hours. The attack was targeted towards BSC token core, leading to issuance of surplus BNB [61].
It can be concluded that despite value-added benefits from smart contracts, vulnerabilities in privacy do exist to date. Even an insignificant violation of security could lead to colossal losses. These obligations in contracts also dispute the grounds of entrust in blockchain networks. As these contracts are still advancing, they are not yet accurate; security assurance has gathered substantial interest among researchers.

2.2. Conventional Static Techniques

Numerous tools are currently available to detect obligations in smart contracts. Some popular approaches are discussed below.
Mythril (i.e., MythX) safety analysis approach was designed to examine bytecode from contracts that were executed in EVM. In case liabilities were discovered, it would aid in investigating probable sources by exploring input data [62]. This tool was beneficial in uncovering active exposures, hence curtailing the prospect of exploitation. Primarily, symbolic examination and taint analysis were incorporated to detect liabilities. Nevertheless, while executing taint analysis, restrictions were recognized due to memory constraints. This hindrance would increase in intensity while handling reference-style attribute requests. Furthermore, Mythril would also confront state explosion issues while administering multifaceted smart contracts. Correspondingly, symbolic execution employed to identify liabilities might take branches into consideration, which are not feasible in reality, often resulting in instances of false positives.
Smartcheck is another vulnerability detection approach employed on smart contracts [27]. It is centered on statistical procedures that generate a quintet of rule sets to discover liabilities in contracts. With reliance on logic rules, there are likelihoods of generating false negatives and false positives instances in detecting obligations. Similarly, it may breakdown sometimes while recognizing dangerous programming errors, resulting in imprecise inferences from overseen liabilities.
As another tool, Slither [25] is used to identify liabilities and probable glitches in Solidity platform smart contracts. It combines abundant detectors capable of discovering diverse liabilities. As compared to Mythril, it executes faster and effectively detects vulnerabilities. But it requires conventional semantic analysis that confines its capability to perform thorough security investigation to identify inferior level details like gas computations.

2.3. ML Approaches Towards Vulnerability Detection

ML is a subdiscipline of Artificial Intelligence (AI), which supports computers to study prevalent data to discover patterns that aid in decisions and predictions without being obviously programmed [63]. A study [64] discovered 16 diverse vulnerable patterns within contracts in the Solidity platform using ML approaches with a performance accuracy of 95%. But the study was centered on static code analysis on a small sample of about 1000 smart contracts, limiting its scalability. Another research study highlighted the deficiencies of traditional susceptibility detection techniques and discussed the possibility of employing ML approaches to discover liabilities in contracts [65]. However, the study does not analyze these liabilities within contracts and propose solutions. Yet another study identified three variants of obligations in smart contracts by employing multi-task learning approaches, centered on hard attribute sharing [66]. When contrasted with single-task learning, this model executed better in terms of storage, time and computation. A multi objective neural network model (MODNN) was proposed in another study [67] to ascertain liabilities in smart contracts. The model discovered about 10 recognizable menaces along with unknown types of threats. Vulnerabilities were discovered in parallel mode with an average performance of 94.8% F1 score, depicting better scalability. However, this model could not capture raw semantic and syntactic details from contracts. Another study employed the DL model to detect five types of susceptibilities in smart contracts by considering control-flow modes, source code details and operation code features. The model achieved enhanced performance in terms of accuracy and Area Under the Curve (AUC) parameters [68]. A framework, MANDO-HGT, was proposed [69] to discover vulnerabilities in smart contracts. This framework analyzed about 55,000 Ethereum contracts to generate heterogeneous contact graphs (HCGs) that identify obligations. Experimentations reflected the performance of this framework on contracts with an F1 score of 0.7%. Another study identified liabilities in smart contracts based on opcodes. Here, a control-flow graph (CFG) was used for training a novel Multi-layer Perceptron (MLP) model designed from multiple benchmark ML models. The model identified obligations with an accuracy of 91% and false positive rate (FPR) of 0.0125. However, the exact location of source bugs could not be traced using this approach [70]. Ensemble models [71] and improvisations in DL approaches [72] are also proposed to detect liabilities.
However, these approaches sometimes disregard the dynamics of smart contracts as they process them as a sequence of text, by ignoring the data flow and logic part [73].
The above-mentioned approaches have been extensively employed to ascertain liabilities in smart contracts. But these methods ignore certain crucial susceptible attributes during preprocessing [74]. Similarly, some of these techniques may have unsatisfactory understanding of semantics of liable programs, often resulting in instances of false positives [75].
To resolve these issues, the current study employed feature processing followed by liability detection. The Principal Component Analysis (PCA) algorithm [76] was employed for tumbling dimensionality of features in smart contracts, by maintaining variance amongst them. The features detected were further encoded to QML algorithms for detecting liabilities. Correspondingly, four popular QML algorithms, namely, QNN, variational quantum classifier (VQC), Quantum Support Vector Machine (QSVM) and Quantum Random Forest (QRF), were employed on smart contracts to discover liabilities. Additionally, the performance of these algorithms was evaluated for diverse forms of vulnerabilities in trained contracts.

2.4. Recent Advances

Over the years, the domain of security in smart contract has grown significantly, moving beyond rule-based static analysis to incorporate progressive learning approaches, which exploit the rich structural and semantic details. A prominent direction has been graph-based susceptibility detection, where heterogeneous graphs identify numerous associations within contract code, like data-flow, control-flow, and function-call dependencies. These approaches leverage graph neural networks (GNNs) or embeddings to capture both local and global context, thereby improving detection and localization of susceptibilities.
A study [77] proposed an imbalanced heterogeneous graph embedding model for detecting malware on skewed datasets, offering valuable insights for security tasks with rare positive cases in context of smart contracts. Similarly, MANDO and MANDO-GURU were introduced in another study [78], which are multi-level heterogeneous graph embedding models, capable of localization of susceptibilities, via hierarchical structure learning.
Another trend involved multi-view and augmented representations, where different code perspectives, like abstract syntax trees, opcode sequences and control-flow graphs, were fused to derive complementary statistics. Recent systematic reviews on AI-based vulnerability detection using DL approaches have emphasized the use of richer representations to improve performance accuracy and interpretability, which might be computationally expensive [79].
Based on these fundamentals and disadvantages of static approaches and classical ML models in detecting vulnerabilities, the current study proposes a QML framework for detecting smart contract susceptibilities. The study aims to extract opcode-level features from real-time smart contracts and reduces its dimensionality via PCA for effective representation. Further, the study intends to apply and compare multiple QML algorithms, QNN, QSVM, VQC and QRF, to assess their ability in detecting and categorizing contract vulnerabilities. Also, the study intends to evaluate performance of these quantum models against baseline approaches to determine probable improvements in accuracy, false positive, true positive rates and computational efficiency of vulnerability detection.

3. Methodology

The following section illustrates methodology of present study in detecting vulnerabilities in smart contracts. The smart contract datasets are initially pre-processed to map with corresponding liabilities. Further, these datasets are deployed on the Solidity platform to extract bytecodes. Additionally, generated bytecodes were validated using the Mythril tool, to avoid discrepancies. The bytecodes generated were further modeled to extract opcodes. Moreover, the opcodes generated a 258-dimension feature set, which was further subjected to feature reduction. Finally, the reduced features were employed to design the quantum circuit for implementing QML algorithms on datasets. The performance of these models in detecting susceptibilities was validated using McNemar’s test. The protocol of current study is visualized as Figure 1.

3.1. Notation and Assumptions

Table 1 presents all mathematical symbols employed in the study, along with their denotation and dimensions.

3.2. Data Collection and Preprocessing

For identifying susceptibilities, the present study gathered three datasets, namely, Slither smart contract audited dataset [80], wild smartbugs dataset [81] and expert audited smart contract dataset. The Slither dataset included 10,000 smart contracts, while wild smartbugs dataset included 20,000 smart contracts. Also, expert audited dataset included 5000 smart contracts with susceptibilities. To effectively evaluate consequences from auditing tools, the SolidiFI dataset was used as the benchmark test dataset. This dataset included instances of smart contracts with 9369 bugs. The dataset also includes three static vulnerability detection tools, like, Smartcheck, Mythril and Slither to identify five instances of smart contract susceptibilities including Denial of Service (DoS) attacks (i.e., gaslimit), uninitialized storage pointers, access control, reentrancy attacks and overflow. To ensure fair-mindedness and totality of conclusions, QML models were centered on these five types of susceptibilities.
As the entire smart contract could encompass numerous Solidity documents, with a sole Solidity document containing multiple susceptible code snippets, the Slither platform was used to collect 30,000 codes including five instances of liabilities. Moreover, 5000 code snippets audited by experts were manually annotated to identify susceptibilities. Thereby, the training set included 35,000 code fragments. Similarly, for the test dataset, 5000 code fragments were mapped to five instances of vulnerabilities. Description of datasets utilized in study are reflected in Table 2.

3.3. Data Cleaning and Splitting

The 35,000 code fragments from smart contracts were further subjected to a cleaning process to eliminate repetitive, redundant, unoccupied and unacceptable instances. Moreover, smart contracts were deployed on a blockchain network using Solidity programming language. Also, code fragments within contracts were compiled to generate bytecodes. Bytecodes are bytes of arrays which are encoded as hexadecimal numerals. They represent explicit sequences of procedures and constraints. Nonetheless, they are known to require huge volumes of memory space to construe and model long arrangements [82]. Therefore, it is impracticable to employ bytecodes reliably as input to QML approaches. Furthermore, the bytecodes generated were validated by the Mythril tool, to circumvent false positive instances. The bytecode representation is also known to have a strong association with opcode in blockchain; therefore, it is possible to discover susceptibilities within contracts with the help of these opcodes. In this perspective, it is essential to convert bytecode to opcode. Opcodes include multiple features and instructions; they can be abridged by mining pertinent features and categorizing them [83].

3.4. Opcode Processing and Feature Extraction

Each opcode from smart contracts comprises a 258-dimensional feature set. But processing all these features would pose a dimensional difficulty. Hence, features within opcodes were generalized to create an optimal subset of attributes with the same variability as actual features. In this context, attribute selection approaches like PCA, variance threshold and mutual information (MI) were employed to generate the optimal attribute subset.

3.5. Quantum Encoding and Circuit Design

Attributes selected from feature reduction approaches are further subjected to a normalization procedure to convert them into binary representations. Further, the encoded features were fitted into a quantum circuit, based on quantum state preparation. Here, preparation comprises priming quantum registers to train features. This step must be performed effectually to augment potential advantages of QML algorithms. However, initializing quantum states may result in expensive computations with respect to depth and width of quantum circuit [84].
In this context, diverse approaches are proposed in the literature to encode data features to a quantum state. The current study encodes binary data from normalized features to deduce a quantum state |S⟩ that depicts the dataset of F features each of G instances with length k bits each, across linear time in k and F. Further, the quantum circuit is designed based on the encoding approach adopted in this study [85]. The circuit required +2 qubits (i.e., basic unit to encode data in quantum computing), to encode G binary instances, which were logically organized as follows:
  • A k-qubit register | a b = | a 0 b   a 1 b a k 1 b for G binary instances.
  • A 2-qubit ancillary register | c .
The register |ab⟩ included qubits as instance of bits which were intended for encoding. Thereby, a binary input could be characterized by reversing qubits from 0 to 1 based on the instances of input bits. The steps for encoding the feature instance   b + 1 t h   a b , presuming previous b instances were encoded, are outlined below:
  • Selectively reverse | a b   qubits for matching the binary encoded instance a(b) on k qubits. This operation was performed by employing the CNOT (i.e., controlled NOT gate) controlled on |c1⟩ = 0, which targeted the qubits correlating to the bit that is equal to one of the (b + 1)th instance a(b).
  • Reverse qubit | c 0   supposing the state of | c 1 = | 0 . Also, apply the controlled rotation gate CG as defined below:
    C G α = 1 0 0 0 0 1 0 0 0 0 α 1 α 1 α 0 0 1 α α 1 α
    Here, in Equation (1), α = G − b denotes the count of instances, along with the present one, which is yet to be determined. The gate | c 0 acts as control qubits and | c 1 acts as target qubits, respectively. This partition of qubits is intended to divide the quantum state across two branches d1 and d2. Branch d1 included primary (b + 1) occurrences in superposition, each of which had an amplitude of 1 G , while the branch d2 included new occurrences a b , with an amplitude of 1 b + 1 / G . Here, branch d1 perpetually encoded binary occurrences until (b + 1)th.
  • Finally, branch d2 is restored such that | a b = | 0 k .
  • Repeat from Step 1, to load subsequent instances to be encoded.
The quantum circuit designed is represented in Figure 2. The circuit includes four layers, namely, input, encoding, learning and output layer. Between the input and encoding layers is the Hadamard gate, which superpositions the input qubits to the superposition phase. Further, amongst the encoding and learning layer is the CNOT gates, which are known for tangling and untangling the states. It is known to flip the target qubit if the value at control qubit is |1⟩. Lastly, the output layer projects the anticipated outcome based on the input units and operations performed. After encoding all the G binary occurrences, the system would be in the following state:
| S = 1 G b = 0 G 1 | a b
Here, in Equation (2), the quantum state |S⟩ has the estimate 1 G , for each instance a(b), or 0 in other cases. As the count of amplitudes 2G may be larger than the instances of nonzero amplitudes, sparse amplitude trajectories could be a part of the basis encoding features.

3.6. Detecting Vulnerabilities Using QML Approaches

The smart contract dataset S with F features of G instances is subjected to distinguishing vulnerabilities using QML algorithms. It is a typical classification problem, where instance g of the dataset S is categorized as vulnerable or non-vulnerable. Primarily, the quantum state |S⟩ is obtained by encoding the data S as defined previously. Further, basis encoding of instance j is to be classified via a supplementary register of k-qubits. Therefore, |j⟩ = |j0 j1 …… jk−1⟩ is obtained. Further, the circuit designed in Figure 2 is utilized to detect liabilities. For achieving this task, the study employed four popular QML learners, namely, QNN, Variational Quantum Classifiers (VQCs), Quantum Support Vector Machines (QSVMs) and Quantum Random Forests (QRFs). Each of these approaches is briefly described below:
  • QNN: As the name suggests, QNN is centered on the concepts of neural network (NN) grounded on the fundamentals of quantum mechanics. The model accelerates learning towards better computation. Here, qubits portray the brain neurons [86]. Neuron models engross the quantum states for interpreting information. |0⟩ and |1⟩ are the quantum states representing classical bit information. The qubit state |γ⟩ sustains coherent superposition of quantum states |0⟩ and |1⟩.
| γ = β | 0 + γ | 1
In Equation (3), β and γ are probable amplitude values, which are generally complex numbers. They satisfy the condition mentioned in Equation (4).
β 2 + γ 2 = 1
The neuron state in Equation (3) is rewritten as Equation (5).
f δ = e i δ = c o s δ + i   s i n δ
The output state of QNN is based on two parameters: threshold ξ and phase estimate represented in the form of weighted associations θ i .
Also, f δ is an alternative representation of the quantum state, where δ is the phase of the quantum state. Weights of neuron state x i is represented by f θ i , where f δ converts input estimate x i into some quantum state with phase value θ i . Here, x i is the state of ith neuron. By multiplying the input x i with weight f θ i , the neuron would rotate, grounded on rotation gates. Based on these parameters, the output state is mathematically represented as follows:
v = i I f θ i x i f ξ = i I f θ i   f y i f ξ ,
y = π 2 · g μ a r g v
H = f ( y )
The state v of neuron is expressed as the weighted summation of input states subtracted from the threshold, as represented in Equation (6). The output qubit state y is adjusted roughly in Equation (7) as compared to Equation (6). Here, a r g v depicts the argument of v, which is a complex number. It is applied as a r c t a n I m v R e v . Neuron state H is the output state of the QNN model. It is calculated as the weighted estimation of i discrete neuron states. Further, the activation function g μ used in Equation (7) deduces the general inverted illustration of quantum logic gates like CNOT. The value of g is computed using the sigmoid function:
g μ = 1 1 + e μ
ii.
QSVM: Using a kernel for quantum computing is the basis of QSVM. QSVM is the quantum variant of the classical SVM algorithm used in multiple ML tasks [87]. The quantum kernel is often estimated as an inner product of quantum states derived from two data coordinates. It can be mathematically defined as follows:
K t ,   t = t | t 2 = 0 m | U t U t | 0 m 2
Here, two data points are considered as t, and t′. The kernel depicts the extent of similarity amongst two data points in high dimension space. The quantum kernel estimated using quantum circuit is displayed in Figure 2.
Further, for five instances of vulnerabilities in our dataset, the multiclass QSVM model was designed based on reducing the energy estimate derived from the quantum annealing approach to maximize the hyperplane [88]. Primarily, the SVM model is trained in an equivalent manner using quadratic programming (QP).
minimize                                     E = 1 2 m G n G α m α n t m t n k x m ,   x n m α m
such   that                                                           0 α m C
and                                     m α m t m = 0
Here, in Equation (11), G is the number of instances of features in datasets and xm R e is an instance in the e-dimensional feature space. Also, tm = ±1 is the output label allocated to xm·αm and ∈ R are the members of set with M coefficients, where C is the regularization estimate, and the kernel function is k   ·   ,   · . The coordinates αm are computed by SVM. It defines a (e − 1) dimension hyperplane, which partitions R e into two regions based on the class label. The kernel function used here is the Gaussian kernel.
α m = l = 0 L 1 B l q A m + l
Here, in Equation (14), q A m + l   0 ,   1 are binary estimates derived from the quantum annealer. L is the count of binary features incorporated into encode α m , while B is the base of encoding. Equation (11) is further modified as follows:
E = 1 2 m , n , l , o q A m + l q A m + o B l + o t m t n · k x m ,   x n   m , l B l q A m + l + ϑ m , l B l q A m + l t m 2
E = m , n = 0 M 1 l , o = 0 L 1 q A m + l Q ~ L m + o , L n + o ,   Q n + o
Here, in Equation (15), ϑ is the penalty metric, which is squared, and Q ~ is the LM × LM matrix. Employing the Karush–Kuhn–Tucker (KKT) constraints results in minimizing the energy metric using the Lagrangian function as follows:
m a x i m i z e                                                           W α = p = 1 n α p   1 2 p ,   q = 1 n y p y q α p α q x p , y p
s u c h   t h a t                                                           0 α p C ,   p = 1 ,   2 ,   ,   n
a n d                                                           p = 1 n α p y p = 0
In Equation (17), W(α) is a function of α, whereas 〈xp, yp〉 is the kernel estimate of the Gaussian (or radial basis function, i.e., RBF) kernel. On solving these equations, QSVM estimates the largest margin amongst classes by minimizing the energy estimate. Thus, quantum annealer can be utilized to apply the QSVM model on multiclass problems.
iii.
VQC: VQC is a variant of QNN employed for supervised learning. It optimizes the quantum circuit and minimizes the loss metric represented in triplet notation [89]:
f b ,   w , x = y
In Equation (18), the network is represented by f, where the output neuron is y, which is used to compute the loss function L. Here, the network comprises three trainable parameters, i.e., b, w and x, the input data. Like QNN, the quantum circuit is modelled using CNOT and rotation gate. The gate rotates by learning from parameters γ, δ and ε, which are subsets of the weight matrix W     R q × 3 × r , where q is the count of qubits and r is the number of layers in the VQN network. Each layer in the model includes two CNOT gates, a typical 2-qubit gate with no trainable metrics. Using a Hadamard date with a CNOT gate will establish entanglement in the circuit, which in turn repeals a qubic state based on the estimate of the alternative control bit. Once the gates are passed through the circuit, its output is estimated by employing the Pauli Z metric and deriving the expectation estimate E. Further, the model optimizes the estimates of w and b during the training process to derive the loss function. A forward pass is performed on the model, like a classical NN model, to estimate the loss function. Furthermore, backpropagation is performed to update the learnable parameters from network.
The mean square error (MSE) metric is computed for figuring the loss function, L.
L = 1 r j = 1 r y j r e a l f b ,   w , x j 2
It is the difference between real and predicted estimates. Further, the model will be trained, and backpropagation approaches are applied on the network by optimizing the parameters ρ = b ,   w . Fluctuations in output are captured by varying ρ as the gradient ρ   f . The gradient of network is estimated for quantum circuits using parameter-shift regulations.
  • QRF: RF is a variant of the decision tree (DT) algorithm used for regression and classification tasks [90,91]. RF is composed of U discrete quantum DTs (QDTs), which form a group of weak ensembles, which is input for QRF. Given training data with V instances, x v t r a i n     R D , with class labels vc, y v t r a i n = 0 ,   1 ,   ,   v c 1 , to be trained from interpreted data, and W = x v t r a i n , y v t r a i n v = 1 V , from underlying distribution E. Every tree is trained using the partition size (i.e., VpV). These instances are sampled from data V. When every classifier is trained, the model is evaluated on a separate dataset Vtrain, by linking the distribution of forecasted class labels. The overall predictions are derived by averaging predictions from every QDT, which in turn yields a probabilistic distribution.
Q r x ; c = P r o b c | x     c C
The predictions from QRF for an input x   will be of the following form:
y ~ x = a r g m a x c   C 1 T t = 1 T Q r x ; c
Accuracy of the model can be deduced by associating estimates from real instances. Probabilities of model overfitting are avoided by identifying differences amongst train and test datasets.

3.7. Architecture of QML Models

All QML models in this study used PCA-related feature vectors as input, followed by appropriate quantum feature encoding schemes. The architecture of each model is described below:
  • QNN: The model is implemented as a layered variational circuit with L blocks. Each block comprises a data encoding layer, parameterized rotation layer and entangling layer. The unitary block l is given by
    U l θ l , l = C N O T r i n g · i R Y θ I l R Z i l
    The expected value Z 0 of the first qubit was estimated and mapped to probability via p = 1 + Z 0 / 2 . The network was trained using the parameter-shift rule and Adam optimizer.
  • QSVM: The model utilized an entangling feature map U x , where each qubit undergoes rotation operation R Z α i x i followed by CNOT entanglement. The quantum kernel between two feature vector x and x’ is computed using the SWAP test:
    K x ,   x 0 | U x t U x | 0 2
    The resulting kernel matrix is passed to a classical SVM solver with a precomputed kernel.
  • VQC: VQC employs angle encoding followed by a strongly entangling ansatz. Each layer of the model comprises a rotation block and entanglement block. The output obtained from expectation values of designated qubits would be mapped to class probabilities of susceptibility, where cross-entropy was utilized for training.
  • QRF: The ensemble of Quantum Decision Tree (QDT) is QRF. Each QDT encodes a random subset of features using RY rotations, followed by applying a shallow entangling circuit, and measures a decision qubit. Further, predictions from T QDTs are aggregated using the majority voting approach. Also, random feature selection and bootstrap sampling were applied to enhance diversity among trees.

4. Experiments

To ensure fair evaluation of diverse approaches, the models were trained and evaluated on homogeneous environments. All computations were accomplished on desktop with Intel I7 14700 K CPU clocked at 2.5 Ghz base frequency and 5.6 Ghz turbo frequency. We used RTX 3090 GPU with 24 GB VRAM, 32 GB RAM, deployed on Windows OS, with PyCharm software with version 2025.1.1, and python computing including Qiskit, Pennylane, TensorFlow dependencies being installed. An instance of smart contracts generated from expert audits is displayed in Table 3.

4.1. Hyperparameter Settings

To train the QML models on smart contract datasets, fine tuning of hyperparameters was accomplished. For the QNN model, Adam’s optimizer was employed to conduct a grid search for estimating optimal settings of the parameters. The search ranges for hyperparameters were as follows: batch size—(32, 64, 128); learning rate—(5 × 10−5, 1 × 10−5, 1 × 10−4, 4 × 10−4); completely connected neural layers—(1, 2, 3); dropout estimate—(0.1, 0.2. 0.3. 0.4. 0.5, 0.6); decay for learning rate, gamma—(0.97, 0.98, 0.99); L2 regularization—(1 × 10−3, 1 × 10−4, 1 × 10−5, 1 × 10−6); epoch count—(100, 200, 300, 400, 500). The loss was evaluated using the cross-entropy approach. The best estimates of parameters for the QNN model are enlisted in Table 4.
Similarly, ideal parameter settings for the QSVM model are represented in Table 5.
Optimal parameters for VQC are represented in Table 6.
Finally, parameters for the QRF approach are enlisted in Table 7.

4.2. Metrics for Performance Evaluation

The QML model’s performances were evaluated using conventional statistical approaches like precision, F1 score, accuracy and recall. These metrics are mathematically defined below:
  • Precision, also known as positive predicted instances, estimates the ratio of accurately forecasted positive instances (i.e., true positives) to total count of instances predicted positive.
P r e c i s i o n = T r u e   p o s i t i v e s F a l s e   p o s i t i v e s + T r u e   p o s i t i v e s
  • Accuracy indicates the inclusive amount of perfection in a mathematical model. It is the ratio of correctly predicted values (i.e., True negative, True positive) to the total count of data instances.
A c c u r a c y = T r u e   n e g a t i v e s + T r u e   p o s i t i v e s T r u e   n e g a t i v e s + T r u e   p o s i t i v e s + F a l s e   n e g a t i v e s + F a l s e   p o s i t i v e s
  • Recall estimates the capability of a mathematical model to ascertain all positive occurrences. It is also called sensitivity and estimated as the ratio of accurately forecasted positive occurrences to all positive occurrences in data.
R e c a l l = T r u e   p o s i t i v e s F a l s e   n e g a t i v e s + T r u e   p o s i t i v e s
  • F1 score is a significant estimate that combines recall and precision metrics. It finds out the balance and trade-off their estimates. The estimate is essential when the dataset is unbalanced.
F 1   s c o r e = 2 × R e c a l l × P r e c i s i o n R e c a l l + P r e c i s i o n

5. Results and Discussion

Here, SolidiFI data were utilized as test data and performance QML models were assessed as represented in Table 8. Each of these models were evaluated using precision, recall, accuracy and F1 score.
It is evident from the table that the performance of the QNN model is superior compared to other QML approaches. It has the maximum estimate for all statistical metrics. The model has the highest F1 score of 81.20%, which is better than the other models. It has learnt nonlinear decision boundaries through trainable rotation gates and entangling operations.
Additionally, the outcomes of performance estimates from five types of susceptibilities are reflected in Table 9.
From the above table, it is evident that the QNN model identifies all five vulnerabilities with better detection. It is also identified access control and reentrancy with better accuracy of 82.80% and 82.43%. The QNN model has better precision, accuracy, recall and F1 score as compared to other approaches in discovering liabilities. QNN, a parameterized quantum circuit, learns nonlinear boundary towards susceptible and non-susceptible smart contracts. Despite having the same training dataset, the performance of QML algorithms varies due to the diverse capabilities and generalizations of models. To conclude, the QNN model was identified as the best model in identifying susceptibilities in smart contracts.
Also, diverse tools were compared to understand their performance capabilities in detecting smart contract susceptibilities. The outcomes from comparative analysis are reflected in Table 10.
The table portrays vulnerabilities detected from diverse tools and QML approaches. As tabulated, the QNN and Slither tool identified vulnerabilities better than other techniques. Smartcheck detected the least vulnerabilities from the dataset. These outcomes are further visualized in Figure 3 by comparing recall estimates from these detectors.
As the above figure depicts, the recall metric was compared with all the seven vulnerability detectors. Experimentations revealed that the QNN model had the highest recall rate of 82.43%, overriding Slither by 5.75%. The figure confirms the superior performance of the QNN model in discovering true positive occurrences of vulnerabilities. Other QML approaches like VQC, QSVM and QRF delivered lower recall values at 62.41%, 65.98% and 69.63%, respectively.
Also, performance accuracy was compared across QML approaches to analyze the capabilities of the algorithms. The analysis is visualized as Figure 4.
The figure reveals the superior performance of the QNN model with accuracy being stationary after 2000 epochs at 82.43%. On the contrary, the VQC algorithm achieves a lower accuracy of 62.41%. Similarly, loss function was evaluated and plotted for QML approaches to validate their performance. The visualization of loss function is depicted in Figure 5.
As observed from the figure, the conclusions are homologous with the accuracy analysis. At an epoch value of 400, the QNN algorithm’s loss function remains stationary with a minimal loss of 0.21. Other algorithms were not stabilized by 500 epochs with variations in loss function, as compared to the QNN model. To conclude, the QNN model achieves superior performance by achieving minimal loss value in deducing vulnerabilities.

McNemar’s Test

Finally, McNemar’s test [92] was performed to further validate performances of the QNN approach in ascertaining liabilities in smart contracts. The consequences are tabulated in Table 11.
Table 10 depicts significant differences in accuracy with QNN and other QML approaches amongst four vulnerabilities, namely, gas limit, uninitialized storage pointer, access control and reentrancy. But there was very little difference in accuracy for overflow vulnerability. This might be due to the conspicuous features of overflow susceptibility, enabling the quantum model to identify and categorize it effectively.
Also, stability analysis was performed across ten different random seeds to validate the performance of the models. Under simulated depolarizing noise with p = 0.05 and p = 0.01, the QML models retained over 90% of noiseless accuracy, indicating robustness of hardware-level imperfections.
Both these tests validated the performance and generalization of models.

6. Conclusions

The present study employed QML approaches to detect vulnerabilities from smart contracts. Experimentations revealed that the QNN model outperformed other models in ascertaining susceptibilities. The models were assessed with statistical measures such as precision, accuracy and F1 metric. The study utilized three variants of smart contract data for training QML models. Initially, smart contracts were pre-processed to extract bytecodes from code segments. Further, bytecodes were encoded to a 258-dimention feature subset, which was further minimized to generate an optimal subset for quantum computing. Performances of all models were evaluated based on statistical metrics specific to each susceptibility. The QNN model was able to ascertain four types of vulnerabilities with minimal instances of false positives and false negatives. Other models were not superior in performance due to differences in training methodologies and generalization. In future, QML approaches can be employed in other areas of blockchain to minimize security threats and breaches [93,94].
Despite the promising outcomes, several shortcomings need to be addressed. For instance, all experiments were conducted on quantum simulators due to limited access to fault tolerant quantum hardware. Ral-device noise and decoherence effects were not completely accounted for. Also, the number of qubits available poses an upper bound on feature vector dimensionality, necessitating aggressive dimension reduction that may discard potentially relevant information. It is observed that these QML models performed on the benchmark smart contract dataset; therefore, their ability to generalize novel or emergent contract susceptibilities remains to be evaluated. In this direction, future work should focus on evaluating the proposed QML models on real quantum hardware, exploring hybrid quantum-classic architectures to minimize circuit depth while preserving accuracy and incorporating domain-specific feature engineering for smart contract analysis.

Author Contributions

Conceptualization, A.S. and K.N.; methodology, K.N.; validation, A.S., K.N. and S.B.R. formal analysis, A.S.; data curation, S.K.; writing—original draft preparation, A.S. and K.N.; writing—review and editing, S.B.R. and S.K.; visualization, K.N.; supervision, A.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data will be made available on reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
QMLQuantum Machine Learning
QNNQuantum Neural Network
QSVMQuantum Support Vector Machine
QRFQuantum Random Forest

References

  1. Besley, T.; Coate, S. Centralized versus decentralized provision of local public goods: A political economy approach. J. Public Econ. 2003, 87, 2611–2637. [Google Scholar] [CrossRef]
  2. Aggarwal, S.; Kumar, N. Cryptographic Consensus Mechanisms. In Advances in Computer; Elsevier: Amsterdam, The Netherlands, 2021; pp. 211–226. [Google Scholar] [CrossRef]
  3. Arooj, A.; Farooq, M.S.; Umer, T. Unfolding the Blockchain Era: Timeline, Evolution, Types and Real-World Applications. J. Netw. Comput. Appl. 2022, 207, 103511. [Google Scholar] [CrossRef]
  4. Sunyaev, A. Distributed Ledger Technology. In Internet Computing; Springer Nature: Cham, Switzerland, 2024; pp. 239–272. [Google Scholar] [CrossRef]
  5. Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System; United Staes Sentencing Commission (USSC): Washington, DC, USA, 2008. Available online: https://www.ussc.gov/sites/default/files/pdf/training/annual-national-training-seminar/2018/Emerging_Tech_Bitcoin_Crypto.pdf (accessed on 12 June 2025).
  6. Szabo, N. Smart Contracts: Building Blocks for Digital Markets. 1996. Available online: https://www.truevaluemetrics.org/DBpdfs/BlockChain/Nick-Szabo-Smart-Contracts-Building-Blocks-for-Digital-Markets-1996-14591.pdf (accessed on 12 June 2025).
  7. Zou, W.; Lo, D.; Kochhar, P.S.; Le, X.-B.D.; Xia, X.; Feng, Y.; Chen, Z.; Xu, B. Smart Contract Development: Challenges and Opportunities. IEEE Trans. Softw. Eng. 2021, 47, 2084–2106. [Google Scholar] [CrossRef]
  8. Onifade, M.; Adebisi, J.A.; Zvarivadza, T. Recent Advances in Blockchain Technology: Prospects, Applications and Constraints in the Minerals Industry. Int. J. Min. Reclam. Environ. 2024, 38, 497–533. [Google Scholar] [CrossRef]
  9. Zamani, E.; He, Y.; Phillips, M. On the Security Risks of the Blockchain. J. Comput. Inf. Syst. 2020, 60, 495–506. [Google Scholar] [CrossRef]
  10. Atzei, N.; Bartoletti, M.; Cimoli, T. A Survey of Attacks on Ethereum Smart Contracts (SoK). In Principles of Security and Trust; Springer: Berlin/Heidelberg, Germany, 2017; pp. 164–186. [Google Scholar] [CrossRef]
  11. Liu, Y.; Yu, F.R.; Li, X.; Ji, H.; Leung, V.C.M. Blockchain and Machine Learning for Communications and Networking Systems. IEEE Commun. Surv. Tutor. 2020, 22, 1392–1431. [Google Scholar] [CrossRef]
  12. Wang, S.; Ouyang, L.; Yuan, Y.; Ni, X.; Han, X.; Wang, F.-Y. Blockchain-Enabled Smart Contracts: Architecture, Applications, and Future Trends. IEEE Trans. Syst. Man Cybern. Syst. 2019, 49, 2266–2277. [Google Scholar] [CrossRef]
  13. Kaulartz, M.; Heckmann, J. Smart Contracts—Anwendungen Der Blockchain-Technologie. Comput. Recht. 2016, 32, 618–624. [Google Scholar] [CrossRef]
  14. Ghaleb, A.; Rubin, J.; Pattabiraman, K. ETainter: Detecting Gas-Related Vulnerabilities in Smart Contracts. In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis, Virtual, Republic of Korea, 18–22 July 2022; ACM: New York, NY, USA, 2022; pp. 728–739. [Google Scholar] [CrossRef]
  15. Schär, F. Decentralized Finance: On Blockchain- and Smart Contract-Based Financial Markets. Review 2021, 103, 22. [Google Scholar] [CrossRef]
  16. Mehar, M.I.; Shier, C.L.; Giambattista, A.; Gong, E.; Fletcher, G.; Sanayhie, R.; Kim, H.M.; Laskowski, M. Understanding a Revolutionary and Flawed Grand Experiment in Blockchain. In Research Anthology on Blockchain Technology in Business, Healthcare, Education, and Government; IGI Global: Hershey, PA, USA, 2021; pp. 1253–1266. Available online: https://www.igi-global.com/gateway/chapter/268659 (accessed on 12 June 2025).
  17. bZx Protocol Token (BZRX). Etherscan. Available online: https://etherscan.io/token/0x56d811088235f11c8920698a204a5010a788f4b3 (accessed on 12 June 2025).
  18. Tang, X.; Du, Y.; Lai, A.; Zhang, Z.; Shi, L. Deep Learning-Based Solution for Smart Contract Vulnerabilities Detection. Sci. Rep. 2023, 13, 20106. [Google Scholar] [CrossRef]
  19. Park, D.; Zhang, Y.; Saxena, M.; Daian, P.; Roşu, G. A Formal Verification Tool for Ethereum VM Bytecode. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, Lake Buena Vista, FL, USA, 4–9 November 2018; ACM: New York, NY, USA, 2018; pp. 912–915. [Google Scholar] [CrossRef]
  20. Jiang, B.; Liu, Y.; Chan, W.K. ContractFuzzer: Fuzzing Smart Contracts for Vulnerability Detection. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, Montpellier, France, 3–7 September 2018; ACM: New York, NY, USA, 2018; pp. 259–269. [Google Scholar] [CrossRef]
  21. Kalra, S.; Goel, S.; Dhawan, M.; Sharma, S. ZEUS: Analyzing Safety of Smart Contracts. In Proceedings of the 2018 Network and Distributed System Security Symposium, San Diego, CA, USA, 18–21 February 2018; Internet Society: Reston, VA, USA, 2018. [Google Scholar] [CrossRef]
  22. Durieux, T.; Ferreira, J.F.; Abreu, R.; Cruz, P. Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea, 27 June–19 July 2020; ACM: New York, NY, USA, 2020; pp. 530–541. [Google Scholar] [CrossRef]
  23. Luu, L.; Chu, D.-H.; Olickel, H.; Saxena, P.; Hobor, A. Making Smart Contracts Smarter. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, New York, NY, USA, 24–28 October 2016; ACM: New York, NY, USA, 2016; pp. 254–269. [Google Scholar] [CrossRef]
  24. Feist, J.; Grieco, G.; Groce, A. Slither: A Static Analysis Framework for Smart Contracts. In Proceedings of the 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, Canada, 27 May 2019; IEEE: New York, NY, USA, 2019; pp. 8–15. [Google Scholar] [CrossRef]
  25. Jiao, J.; Wei Lin, S.; Sun, J. A Generalized Formal Semantic Framework for Smart Contracts. In Proceedings of the 2020 International Conference on Fundamental Approaches to Software Engineering, Dublin, Ireland, 25 April 2020; pp. 75–96. [Google Scholar] [CrossRef]
  26. Tsankov, P.; Dan, A.; Drachsler-Cohen, D.; Gervais, A.; Bünzli, F.; Vechev, M. Securify: Practical Security Analysis of Smart Contracts. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, ON, Canada, 15–19 October 2018; ACM: New York, NY, USA, 2018; pp. 67–82. [Google Scholar] [CrossRef]
  27. Tikhomirov, S.; Voskresenskaya, E.; Ivanitskiy, I.; Takhaviev, R.; Marchenko, E.; Alexandrov, Y. SmartCheck. In Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain, Gothenburg, Sweden, 27 May 2018; ACM: New York, NY, USA, 2018; pp. 9–16. [Google Scholar] [CrossRef]
  28. Grimmelmann, J. All Smart Contracts Are Ambiguous. J. Law Innov. 2019, 2, 1–22. [Google Scholar]
  29. Singh, U.K.; Joshi, C.; Kanellopoulos, D. A Framework for Zero-Day Vulnerabilities Detection and Prioritization. J. Inf. Secur. Appl. 2019, 46, 164–172. [Google Scholar] [CrossRef]
  30. Kiani, R.; Sheng, V.S. Ethereum Smart Contract Vulnerability Detection and Machine Learning-Driven Solutions: A Systematic Literature Review. Electronics 2024, 13, 2295. [Google Scholar] [CrossRef]
  31. Gaur, R.; Prakash, S.; Kumar, S.; Abhishek, K.; Msahli, M.; Wahid, A. A Machine-Learning–Blockchain-Based Authentication Using Smart Contracts for an IoHT System. Sensors 2022, 23, 4793. [Google Scholar] [CrossRef]
  32. Wang, M.; Xie, Z.; Wen, X.; Li, J.; Zhou, K. Ethereum Smart Contract Vulnerability Detection Model Based on Triplet Loss and BiLSTM. Electronics 2023, 12, 2327. [Google Scholar] [CrossRef]
  33. Shafay, M.; Ahmad, R.W.; Salah, K.; Yaqoob, I.; Jayaraman, R.; Omar, M. Blockchain for Deep Learning: Review and Open Challenges. Clust. Comput. 2023, 26, 197–221. [Google Scholar] [CrossRef]
  34. Zhang, L.; Chen, W.; Wang, W.; Jin, Z.; Zhao, C.; Cai, Z.; Chen, H. CBGRU: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model. Sensors 2022, 22, 3577. [Google Scholar] [CrossRef]
  35. Zhang, L.; Wang, J.; Wang, W.; Jin, Z.; Zhao, C.; Cai, Z.; Chen, H. A Novel Smart Contract Vulnerability Detection Method Based on Information Graph and Ensemble Learning. Sensors 2022, 22, 3581. [Google Scholar] [CrossRef]
  36. Zhang, L.; Li, Y.; Jin, T.; Wang, W.; Jin, Z.; Zhao, C.; Cai, Z.; Chen, H. SPCBIG-EC: A Robust Serial Hybrid Model for Smart Contract Vulnerability Detection. Sensors 2022, 22, 4621. [Google Scholar] [CrossRef]
  37. Liu, Z.; Jiang, M.; Zhang, S.; Zhang, J.; Liu, Y. A Smart Contract Vulnerability Detection Mechanism Based on Deep Learning and Expert Rules. IEEE Access 2023, 11, 77990–77999. [Google Scholar] [CrossRef]
  38. Huang, T.T.H.-D. Hunting the Ethereum Smart Contract: Color-inspired Inspection of Potential Attacks. arXiv 2018, arXiv:1807.01868v1. [Google Scholar] [CrossRef]
  39. Liao, J.-W.; Tsai, T.-T.; He, C.-K.; Tien, C.-W. SoliAudit: Smart Contract Vulnerability Assessment Based on Machine Learning and Fuzz Testing. In Proceedings of the 2019 Sixth International Conference on Internet of Things: Systems, Management and Security (IOTSMS), Granada, Spain, 22–25 October 2019; IEEE: New York, NY, USA, 2019; pp. 458–465. [Google Scholar] [CrossRef]
  40. Yu, X.; Zhao, H.; Hou, B.; Ying, Z.; Wu, B. DeeSCVHunter: A Deep Learning-Based Framework for Smart Contract Vulnerability Detection. In Proceedings of the 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 18–22 July 2021; IEEE: New York, NY, USA, 2021; pp. 1–8. [Google Scholar] [CrossRef]
  41. Zhou, X.; Pang, J.; Yue, F.; Liu, F.; Guo, J.; Liu, W.; Song, Z.; Shu, G.; Xia, B.; Shan, Z. A New Method of Software Vulnerability Detection Based on a Quantum Neural Network. Sci. Rep. 2022, 12, 8053. [Google Scholar] [CrossRef]
  42. Menon, P.S.; Ritwik, M. A Comprehensive but Not Complicated Survey on Quantum Computing. IERI Procedia 2014, 10, 144–152. [Google Scholar] [CrossRef]
  43. Hassanien, A.E.; Elhoseny, M.; Kacprzyk, J. Quantum Computin: An Environment for Intelligent Large Scale Real Application; Springer International Publishing: Cham, Switzerland, 2018; Volume 33. [Google Scholar] [CrossRef]
  44. Biamonte, J.; Wittek, P.; Pancotti, N.; Rebentrost, P.; Wiebe, N.; Lloyd, S. Quantum Machine Learning. Nature 2017, 549, 195–202. [Google Scholar] [CrossRef] [PubMed]
  45. Schuld, M.; Petruccione, F. Machine Learning with Quantum Computers; Springer International Publishing: Cham, Switzerland, 2021. [Google Scholar] [CrossRef]
  46. Abbaszade, M.; Salari, V.; Mousavi, S.S.; Zomorodi, M.; Zhou, X. Application of Quantum Natural Language Processing for Language Translation. IEEE Access 2021, 9, 130434–130448. [Google Scholar] [CrossRef]
  47. Di Sipio, R.; Huang, J.-H.; Chen, S.Y.-C.; Mangini, S.; Worring, M. The Dawn of Quantum Natural Language Processing. In Proceedings of the ICASSP 2022–2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Singapore, 23–27 May 2022; IEEE: New York, NY, USA, 2022; pp. 8612–8616. [Google Scholar] [CrossRef]
  48. Bikku, T.; Thota, S.; Shanmugasundaram, P. A Novel Quantum Neural Network Approach to Combating Fake Reviews. Int. J. Netw. Distrib. Comput. 2024, 12, 195–205. [Google Scholar] [CrossRef]
  49. Li, F.; Zhao, S.; Zheng, B. Quantum Neural Network in Speech Recognition. In Proceedings of the 6th International Conference on Signal Processing, Beijing, China, 26–30 August 2002; IEEE: New York, NY, USA, 2002; pp. 1267–1270. [Google Scholar] [CrossRef]
  50. Tang, E. A Quantum-Inspired Classical Algorithm for Recommendation Systems. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, Phoenix, AZ, USA, 23–26 June 2019; ACM: New York, NY, USA, 2019; pp. 217–228. [Google Scholar] [CrossRef]
  51. Xiong, H.; Duan, X.; Yu, Y.; Zhang, J.; Yin, H. Image Classification Based on Quantum Machine Learning. In Proceedings of the 2023 5th International Conference on Intelligent Control, Measurement and Signal Processing (ICMSP), Chengdu, China, 19–21 May 2023; IEEE: New York, NY, USA, 2023; pp. 891–895. [Google Scholar] [CrossRef]
  52. Chen, Y. A Novel Image Classification Framework Based on Variational Quantum Algorithms. Quantum Inf. Process. 2024, 23, 362. [Google Scholar] [CrossRef]
  53. Li, R.Y.; Di Felice, R.; Rohs, R.; Lidar, D.A. Quantum Annealing versus Classical Machine Learning Applied to a Simplified Computational Biology Problem. npj Quantum Inf. 2018, 4, 14. [Google Scholar] [CrossRef]
  54. Satuluri, V.K.R.R.; Ponnusamy, V. Quantum-Enhanced Machine Learning. In Proceedings of the 2021 Smart Technologies, Communication and Robotics (STCR), Sathyamangalam, India, 9–10 October 2021; IEEE: New York, NY, USA, 2021; pp. 1–6. [Google Scholar] [CrossRef]
  55. Durgut, S.; Küçüksille, E.U.; Tokmak, M. Hybrid Quantum–Classical Deep Neural Networks Based Smart Contract Vulnerability Detection. Appl. Sci. 2025, 15, 4037. [Google Scholar] [CrossRef]
  56. Feng, X.; Liu, H.; Wang, L.; Zhu, H.; Sheng, V.S. An Interpretable Model for Large-Scale Smart Contract Vulnerability Detection. Blockchain Res. Appl. 2024, 5, 100209. [Google Scholar] [CrossRef]
  57. Wu, C.; Xiong, J.; Xiong, H.; Zhao, Y.; Yi, W. A Review on Recent Progress of Smart Contract in Blockchain. IEEE Access 2022, 10, 50839–50863. [Google Scholar] [CrossRef]
  58. Liu, B. Two-Thirds of EVM Smart Contract Deployments in 2024 Are from Optimism: Report, Blockworks. Available online: https://blockworks.co/news/evm-smart-contract-deployments-optimism (accessed on 12 June 2025).
  59. Abdelhamid, M.; Hassan, G. Blockchain and Smart Contracts. In Proceedings of the 2019 8th International Conference on Software and Information Engineering, Cairo, Egypt, 9–12 April 2019; ACM: New York, NY, USA, 2019; pp. 91–95. [Google Scholar] [CrossRef]
  60. Wu, G.; Wang, H.; Lai, X.; Wang, M.; He, D.; Chan, S. A Comprehensive Survey of Smart Contract Security: State of the Art and Research Directions. J. Netw. Comput. Appl. 2024, 226, 103882. [Google Scholar] [CrossRef]
  61. Cernera, F.; La Morgia, M.; Mei, A.; Sassi, F. Token Spammers, Rug Pulls, and Sniper Bots: An Analysis of the Ecosystem of Tokens in Ethereum and in the Binance Smart Chain (BNB). In Proceedings of the SEC’ 23: 32nd USENIX Conference on Security Symposium, Anaheim, CA, USA, 9–11 August 2023; pp. 3349–3366. Available online: https://www.usenix.org/system/files/usenixsecurity23-cernera.pdf (accessed on 25 August 2025).
  62. Kirlappos, I.; Sasse, M.A.; Harvey, N. Why Trust Seals Don’t Work: A Study of User Perceptions and Behavior. In Trust and Trustworthy Computing; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; pp. 308–324. [Google Scholar] [CrossRef]
  63. Turing, A.M. Computing Machinery and Intelligence. 1950. Available online: https://web.iitd.ac.in/~sumeet/Turing50.pdf (accessed on 12 June 2025).
  64. Momeni, P.; Wang, Y.; Samavi, R. Machine Learning Model for Smart Contracts Security Analysis. In Proceedings of the 2019 17th International Conference on Privacy, Security and Trust (PST), Fredericton, NB, Canada, 26–28 August 2019; IEEE: New York, NY, USA, 2019; pp. 1–6. [Google Scholar] [CrossRef]
  65. Surucu, O.; Yeprem, U.; Wilkinson, C.; Hilal, W.; Gadsden, S.A.; Yawney, J.; Alsadi, N.; Giuliano, A. A Survey on Ethereum Smart Contract Vulnerability Detection Using Machine Learning. In Disruptive Technologies in Information Sciences VI; Blowers, M., Hall, R.D., Dasari, V.R., Eds.; SPIE: Bellingham, WA, USA, 2022; p. 12. Available online: https://www.spiedigitallibrary.org/conference-proceedings-of-spie/12117/2618899/A-survey-on-ethereum-smart-contract-vulnerability-detection-using-machine/10.1117/12.2618899.short (accessed on 12 June 2025).
  66. Huang, J.; Zhou, K.; Xiong, A.; Li, D. Smart Contract Vulnerability Detection Model Based on Multi-Task Learning. Sensors 2022, 22, 1829. [Google Scholar] [CrossRef] [PubMed]
  67. Zhang, L.; Wang, J.; Wang, W.; Jin, Z.; Su, Y.; Chen, H. Smart Contract Vulnerability Detection Combined with Multi-Objective Detection. Comput. Netw. 2022, 217, 109289. [Google Scholar] [CrossRef]
  68. Deng, W.; Wei, H.; Huang, T.; Cao, C.; Peng, Y.; Hu, X. Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion. Sensors 2023, 23, 7246. [Google Scholar] [CrossRef]
  69. Nguyen, H.H.; Nguyen, N.-M.; Xie, C.; Ahmadi, Z.; Kudendo, D.; Doan, T.-N.; Jiang, L. MANDO-HGT: Heterogeneous Graph Transformers for Smart Contract Vulnerability Detection. In Proceedings of the 2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR), Melbourne, Australia, 15–16 May 2023; IEEE: New York, NY, USA, 2023; pp. 334–346. [Google Scholar] [CrossRef]
  70. Colin, L.S.H.; Mohan, P.M.; Pan, J.; Keong, P.L.K. An Integrated Smart Contract Vulnerability Detection Tool Using Multi-Layer Perceptron on Real-Time Solidity Smart Contracts. IEEE Access 2024, 12, 23549–23567. [Google Scholar] [CrossRef]
  71. Wang, W.; Song, J.; Xu, G.; Li, Y.; Wang, H.; Su, C. ContractWard: Automated Vulnerability Detection Models for Ethereum Smart Contracts. IEEE Trans. Netw. Sci. Eng. 2021, 8, 1133–1144. [Google Scholar] [CrossRef]
  72. Narayana, K.L.; Sathiyamurthy, K. Automation and Smart Materials in Detecting Smart Contracts Vulnerabilities in Blockchain Using Deep Learning. Mater. Today Proc. 2023, 81, 653–659. [Google Scholar] [CrossRef]
  73. Pour, F.G.; Costa, G.; Galletta, L. Welcome back: A systematic literature review of smart contract reentrancy and countermeasures. Blockchain Res. Appl. 2025, in press. [Google Scholar] [CrossRef]
  74. Liao, S.; Grishman, R. Using Document Level Cross-Event Inference to Improve Event Extraction. In Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics (ACL ’10), Uppsala, Sweden, 11 July 2010; pp. 789–797. [Google Scholar]
  75. Zhang, Y.; Ge, C.; Hong, S.; Tian, R.; Dong, C.; Liu, J. DeleSmell: Code Smell Detection Based on Deep Learning and Latent Semantic Analysis. Knowl. Based Syst. 2022, 255, 109737. [Google Scholar] [CrossRef]
  76. Pearson, K. LIII. On Lines and Planes of Closest Fit to Systems of Points in Space. Lond. Edinb. Dublin Philos. Mag. J. Sci. 1901, 2, 559–572. [Google Scholar] [CrossRef]
  77. Li, T.; Luo, Y.; Wan, X.; Li, Q.; Liu, Q.; Wang, R.; Jia, C.; Xiao, Y. A Malware Detection Model Based on Imbalanced Heterogeneous Graph Embeddings. Expert Syst. Appl. 2024, 246, 123109. [Google Scholar] [CrossRef]
  78. Nguyen, H.H.; Nguyen, N.M.; Xie, C.; Ahmadi, Z.; Kudendo, D.; Doan, T.N.; Jiang, L. MANDO: Multi-Level Heterogeneous Graph Embeddings for Fine-Grained Detection of Smart Contract Vulnerabilities. arXiv 2022, arXiv:2208.13252v2. [Google Scholar]
  79. Liang, C.; Wei, Q.; Du, J.; Wang, Y.; Jiang, Z. Survey of Source Code Vulnerability Analysis Based on Deep Learning. Comput. Secur. 2025, 148, 104098. [Google Scholar] [CrossRef]
  80. Rossini, M. Slither Audited Smart Contracts Dataset. Hugging Face. Available online: https://huggingface.co/datasets/mwritescode/slither-audited-smart-contracts (accessed on 12 June 2025).
  81. Ferreira, J.F. Smartbugs-Wild. GitHub. Available online: https://github.com/smartbugs/smartbugs-wild (accessed on 12 June 2025).
  82. Li, J.; Lu, G.; Gao, Y.; Gao, F. A Smart Contract Vulnerability Detection Method Based on Multimodal Feature Fusion and Deep Learning. Mathematics 2023, 11, 23. [Google Scholar] [CrossRef]
  83. Sun, Y.; Gu, L. Attention-Based Machine Learning Model for Smart Contract Vulnerability Detection. J. Phys. Conf. Ser. 2021, 1820, 012004. [Google Scholar] [CrossRef]
  84. Berti, A.; Bernasconi, A.; Del Corso, G.M.; Guidotti, R. The Role of Encodings and Distance Metrics for the Quantum Nearest Neighbor. Quantum Mach. Intell. 2024, 6, 62. [Google Scholar] [CrossRef]
  85. Ventura, D. Quantum Associative Memory. Inf. Sci. 2000, 124, 273–296. [Google Scholar] [CrossRef]
  86. Kak, S. On Quantum Neural Computing. Inf. Sci. 1995, 83, 143–160. [Google Scholar] [CrossRef]
  87. Cortes, C.; Vapnik, V. Support-Vector Networks. Mach. Learn. 1995, 20, 273–297. [Google Scholar] [CrossRef]
  88. Dema, B.A.; Arai, J.; Horikawa, K. Support Vector Machine for Multiclass Classification Using Quantum Annealers. Proceedings of the DEIM Forum 2020, Online, 2–4 March 2020; pp. 1–6. Available online: https://proceedings-of-deim.github.io/DEIM2020/papers/F3-4.pdf (accessed on 22 April 2025).
  89. Blance, A.; Spannowsky, M. Quantum Machine Learning for Particle Physics Using a Variational Quantum Classifier. J. High Energy Phys. 2021, 2021, 212. [Google Scholar] [CrossRef]
  90. Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
  91. Srikumar, M.; Hill, C.D.; Hollenberg, L.C.L. A Kernel-Based Quantum Random Forest for Improved Classification. Quantum Mach. Intell. 2024, 6, 10. [Google Scholar] [CrossRef]
  92. Lachenbruch, P.A. McNemar Test. In Wiley StatsRef: Statistics Reference Online; John Wiley and Sons: Hoboken, NJ, USA, 2014. [Google Scholar] [CrossRef]
  93. Chandolu, S.B.; Praveen, S.P.; Tirumalasetti, N.R.; Swathi, K.; Sirisha, U. Enhancing Real-Time Malware Analysis with Quantum Neural Networks. J. Intell. Syst. Internet Things 2024, 12, 57–69. [Google Scholar] [CrossRef]
  94. Srinidhi, S.K.; Vishal, K.S.; Shashank, U.S.; Belwal, M. Quantum Machine Learning Compiler for Hybrid Quantum-Classical Models. In Proceedings of the 2024 15th International Conference on Computing Communication and Networking Technologies (ICCCNT), Kamand, India, 24–28 June 2024; IEEE: New York, NY, USA, 2024; pp. 1–9. [Google Scholar] [CrossRef]
Figure 1. Protocol for identifying susceptibilities in smart contracts.
Figure 1. Protocol for identifying susceptibilities in smart contracts.
Entropy 27 00933 g001
Figure 2. Quantum circuit designed for smart contract features.
Figure 2. Quantum circuit designed for smart contract features.
Entropy 27 00933 g002
Figure 3. Recall metric for diverse smart contract vulnerability detectors.
Figure 3. Recall metric for diverse smart contract vulnerability detectors.
Entropy 27 00933 g003
Figure 4. Accuracy analysis of QML approaches in detecting liabilities.
Figure 4. Accuracy analysis of QML approaches in detecting liabilities.
Entropy 27 00933 g004
Figure 5. Loss function analysis of QML approaches in detecting vulnerabilities.
Figure 5. Loss function analysis of QML approaches in detecting vulnerabilities.
Entropy 27 00933 g005
Table 1. Notations of mathematical symbols used in study.
Table 1. Notations of mathematical symbols used in study.
SymbolMeaningDimension/Type
nNumber of smart contractsInteger
mNumber of extracted opcode-level featuresInteger
kNumber of principal components derived from PCAInteger
XOriginal feature matrix R n × m
x ¯ Feature mean vector R m
XcMean-centered feature matrix R n × m
ƩCovariance matrix R m × m
λ i , w i Eigenvalue, Eigenvector Scalar / R m
WPCA Projection matrix R m × k
ZReduced feature matrix R n × k
qNumber of qubitsInteger
θTrainable quantum circuit parametersReal vector
y ^ i Predicted outputScalar
yiTrue labelBinary
TP, TN, FP, FNConfusion matrix termsInteger
Table 2. Description of datasets employed for discovering vulnerabilities.
Table 2. Description of datasets employed for discovering vulnerabilities.
DataDatasetInstancesSusceptibilities Included
Gas LimitUninitialized PointersAccess ControlReentrancyOverflow
TrainingSlither dataset10,000YesYesYesYesYes
Smartbugs dataset20,000YesYesYesYesYes
Audited dataset5000YesYesYesYesYes
TestSolidiFI dataset9369NoYesNoYesYes
Table 3. Sample smart contract dataset generated from expert audits.
Table 3. Sample smart contract dataset generated from expert audits.
Contract_IDBytecodeSusceptibility Identified
Contract_336080604052348015600e575f5ffd5b5060d580601a5f395ff3fe6080604052348015600e5..................................00081c0033Normal
Contract_3906080604052348015600e575f5ffd5b5060ba80601a5f395ff3fe6080604052348015600e57...........................................634300081c0033Access control
Contract_9596080604052348015600e575f5ffd5b506102268061001c5f395ff3fe60806040526004361061003....................................................4300081c0033Reentrancy
Contract_28546080604052348015600e575f5ffd5b50610219861001c5f395ff3fe608060405234801561000f57.........................................................00081c0033Gas limit
Contract_37506080604052348015600e575f5ffd5b506101218061001c5f395ff3fe6080604052348015600e57................................................634300081c0033Overflow
Table 4. Optimized hyperparameters for QNN model.
Table 4. Optimized hyperparameters for QNN model.
ParametersOptimal Configuration
Layers of network3
OptimizerAdam
Batch size128
Learning rate1 × 10−5
Dropout estimate0.1
Decay of learning rate0.97
L2 regularization1 × 10−3
Loss metricCross entropy
Table 5. Optimized parameters for the QSVM model.
Table 5. Optimized parameters for the QSVM model.
ParametersOptimal Configuration
Regularization constant, C0.8
No. of support vectors14
Table 6. Optimized parameters for VQC model.
Table 6. Optimized parameters for VQC model.
ParametersOptimal Configuration
Layers of network2
Quantum gateCNOT
Batch size64
Number of qubits10
OptimizerAdam
Loss metricCross entropy
Table 7. Optimized parameters for QRF model.
Table 7. Optimized parameters for QRF model.
ParametersOptimal Configuration
Number of decision trees220
Maximum depth9
Qubit count20
Quantum gateCNOT
Learning rate1 × 10−5
Table 8. Comparison of QML algorithm performance.
Table 8. Comparison of QML algorithm performance.
QML ApproachPrecision (%)Accuracy (%)Recall (%)F1 Score (%)
QNN83.5082.4381.1781.20
QSVM68.2065.9863.0064.50
VQC61.0062.4163.3055.50
RF70.1069.6363.5060.20
Table 9. Comparison of performance of QML algorithms for smart contract liabilities.
Table 9. Comparison of performance of QML algorithms for smart contract liabilities.
VulnerabilityQML ModelPrecision (%)Accuracy (%)Recall (%)
Gas limitQNN82.9081.5579.80
QSVM67.1265.5062.50
VQC60.5061.1261.80
QRF69.5068.1566.80
Uninitialized storage pointersQNN83.2082.1081.00
QSVM66.2064.0061.80
VQC62.5061.9060.00
QRF70.2068.9068.00
Access controlQNN84.0082.8081.00
QSVM68.0066.5063.20
VQC62.5061.9060.00
QRF70.2068.9068.00
ReentrancyQNN83.5082.4381.50
QSVM67.5066.0063.00
VQC62.8062.1060.50
QRF70.5069.2068.20
OverflowQNN83.4082.2581.20
QSVM68.5067.9063.50
VQC63.0062.4160.20
QRF70.8069.6368.50
Table 10. Analysis of TP instances in detecting susceptibilities.
Table 10. Analysis of TP instances in detecting susceptibilities.
Vulnerability DetectorGas LimitUninitialized Storage PointersAccess ControlReentrancy
Mythril935108101
Smartcheck0289282
Slither3566198300
QNN6589225351
QSVM2948104229
VQC223994194
QRF3251145254
Table 11. Analysis of differences in accuracy amongst QNN and other QML models.
Table 11. Analysis of differences in accuracy amongst QNN and other QML models.
VulnerabilitiesModelsDiscordant Pairs, i.e., BContinuity Correction, i.e., CChi-Square Estimatep-ValueDifference in Accuracy
Gas limitQNN and other QML variants398111873.920Most significant
Uninitialized storage pointer9981289.930Most significant
Access control7831209.620Most significant
Reentrancy267312341.890Extremely significant
Overflow3101Not significant
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Sridhar, A.; Nagaraj, K.; Bangalore Ravi, S.; Kurup, S. Ascertaining Susceptibilities in Smart Contracts: A Quantum Machine Learning Approach. Entropy 2025, 27, 933. https://doi.org/10.3390/e27090933

AMA Style

Sridhar A, Nagaraj K, Bangalore Ravi S, Kurup S. Ascertaining Susceptibilities in Smart Contracts: A Quantum Machine Learning Approach. Entropy. 2025; 27(9):933. https://doi.org/10.3390/e27090933

Chicago/Turabian Style

Sridhar, Amulyashree, Kalyan Nagaraj, Shambhavi Bangalore Ravi, and Sindhu Kurup. 2025. "Ascertaining Susceptibilities in Smart Contracts: A Quantum Machine Learning Approach" Entropy 27, no. 9: 933. https://doi.org/10.3390/e27090933

APA Style

Sridhar, A., Nagaraj, K., Bangalore Ravi, S., & Kurup, S. (2025). Ascertaining Susceptibilities in Smart Contracts: A Quantum Machine Learning Approach. Entropy, 27(9), 933. https://doi.org/10.3390/e27090933

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop