Submitted:
09 September 2026
Posted:
10 September 2026
You are already at the latest version
Abstract
Existing hierarchical graph neural networks (GNNs) for blockchain fraud detection often suffer from scalability bottlenecks when processing large-scale transaction graphs. This paper proposes DLG-GNN, a Decoupled Local-to Global Graph Neural Network that separates contract-level local encoding from inter-contract relational reasoning. By combining domain-aware partitioning with a sequential inductive pipeline, DLG-GNN maintains peak GPU memory usage below 200 MB and main memory usage below 6.5 GB. Using GATv2-based local and global encoders, DLG-GNN demonstrates superior performance over representative baselines on Ethereum, BSC, and Polygon.
Keywords:
graph neural networks
; graphs of graphs
; fraud detection
; graph attention network
; cryptocurrency
1. Introduction
The decentralization of financial ecosystems has facilitated global economic innovation but has simultaneously provided a veil for sophisticated financial crimes, including money laundering and smart contract-based fraud [1,2,3].
As transaction volumes on platforms such as Ethereum and Binance Smart Chain (BSC) continue to grow rapidly, the need for automated, high-precision monitoring systems has become urgent. Traditional machine learning approaches, which rely on manually engineered features, often fail to capture the complex, higher-order structural dependencies inherent in graph-structured blockchain data. To address these challenges, the research community has shifted toward Graph Neural Networks (GNNs) [4].
Early GNN-based fraud detection models typically treated the entire transaction network as a flat graph, often losing the distinction between individual contract logic and broader relational contexts [5]. The recent “Graphs of Graphs” (GoG) framework addressed this limitation by proposing a hierarchical architecture [6]. However, the original GoG implementation relies on a transductive learning paradigm where the entire global graph must be loaded into memory. This leads to a quadratic increase in memory complexity, i.e., , making deployment on standard hardware impractical for large-scale networks.
To address these limitations, we propose DLG-GNN, a resource-efficient framework specifically designed to overcome the scalability bottlenecks inherent in large-scale blockchain networks.
DLG-GNN employs a decoupled dual-level architecture to separately capture intra-contract logic (Level 1) and inter-contract relational dependencies (Level 2). Unlike existing transductive models that suffer from memory growth with the total number of nodes N, our framework atomizes the global transaction network into logical contract units. By combining a sequential inductive pipeline with proactive garbage collection, the peak memory requirement is bounded by the maximum partition size K, yielding worst-case memory for dense subgraph operations, where K is fixed according to the available GPU memory [7]. Furthermore, the integration of GATv2 layers enables dynamic, context-aware feature extraction for both local contract behaviors and global relational contexts [8].
The remainder of this paper is organized as follows. Section 2 reviews prior research on GNN-based fraud detection and scalability techniques. Section 3 describes the architecture of DLG-GNN, including domain-aware segmentation logic and a hierarchical joint loss function. Section 4 reviews the experimental results, presenting an analysis of memory efficiency and a comparison of the proposed model’s performance. Finally, Section 5 concludes the paper and discusses future research directions.
2. Related Work
2.1. GNNs for Financial Fraud Detection
Early efforts, such as the work by Weber et al. [4], demonstrated that Graph Convolutional Networks (GCNs) could outperform traditional machine learning models on the Elliptic Bitcoin dataset by capturing structural patterns associated with illicit activity. Subsequent studies explored various graph-based anomaly detection architectures, including Graph Attention Networks (GAT) [9], DOMINANT [10], and AnomalyDAE [11], to identify suspicious nodes or transactions in attributed graphs. However, most of these models operate on “flat” graph structures, which can overlook the multi-level abstraction of blockchain data, such as the distinction between intra-contract behavior and inter-contract interactions.
2.2. Hierarchical Graph Learning
To capture the intrinsic hierarchical structure of blockchain ecosystems, Luo et al. [6] introduced the “Graphs of Graphs” (GoG) framework. This approach models individual smart contracts as local graphs (Level 1) and their interactions as a global meta-graph (Level 2). While GoG provides a structured representation of the hierarchical nature of multi-chain blockchain datasets, its reliance on transductive learning poses a significant scalability challenge. In the transductive paradigm, the entire graph or a large global representation must remain accessible during training and inference, leading to substantial memory overhead as the network scales. This limitation restricts the practical application of hierarchical GNNs to relatively small graphs or requires high-end hardware resources.
2.3. Scalability and Efficiency in GNNs
To address the challenges associated with scaling GNNs to large-scale graphs, as discussed earlier, sampling and partitioning techniques have been developed. GraphSAGE [12] introduced inductive learning using neighbor node (graph) sampling, enabling the model to generalize to unknown nodes without having to retrain the entire graph. Cluster-GCN [13] achieved a breakthrough in efficiency by partitioning the graph into smaller clusters, thereby reducing the computational overhead of graph convolutions. GraphSAINT [7] further advanced scalable training by employing graph sampling strategies. Despite these advancements, existing scalable solutions typically prioritize either local neighborhood sampling or global partitioning, and there are few examples of them processing hierarchical blockchain data—which requires maintaining both intra-contract integrity and inter-contract relationships—under resource-constrained environments such as strict memory limitations.
3. Proposed Method
Figure 1 shows an overview of the proposed DLG-GNN architecture. This framework utilizes a “Load-Process-Purge” loop to keep memory usage constant. By partitioning the global transaction graph into contract-level subgraphs, the Level 1 GATv2 [8] encoder can extract local features even under strict VRAM constraints. These compressed embeddings are then used to construct a relational meta-graph for Level 2 learning, enabling the system to capture multi-scale fraud signatures without the scalability bottlenecks inherent in traditional transductive models.
3.1. Problem Formalization and Graph Representation
We define the global blockchain transaction network as a massive directed graph . Unlike traditional transductive approaches that load as a single monolithic tensor, we decompose the network into a set of M independent contract-level subgraphs:
3.2. Level 1: Intra-contract Encoding with GATv2
Level 1 focuses on capturing suspicious patterns within individual smart contracts. We employ the GATv2 (Graph Attention Network v2) [8] layer to overcome the limitations of static attention in the original GAT [9]. For any node i and its neighbor within subgraph , the dynamic attention score , the normalized attention coefficient , and the updated node representation are computed as follows:
The full Level 1 forward pass over subgraph and the subsequent contract-level embedding are obtained via a readout function:
3.3. Level 2: Inter-contract Relational Contextualization
The extracted embeddings serve as nodes in a relational meta-graph . Level 2 applies a second GATv2 stack to learn contextual dependencies between contracts:
The final fraud score for contract m is produced by a fusion head that concatenates the local and relational representations:
3.4. Resource-Efficient Inductive Pipeline
The primary innovation of DLG-GNN lies in its Sequential Fitting and Garbage Collection (GC) strategy. By adopting an inductive paradigm [12], the model processes each subgraph independently, without requiring access to the full graph during training or inference.
The peak GPU memory is bounded by the largest processed subgraph, yielding worst-case memory for dense subgraph operations, where is fixed by the hardware budget. This ensures that peak VRAM usage remains stable (e.g., below 200 MB) regardless of the growth of N. Once is computed, is immediately purged from VRAM, allowing the next subgraph to be loaded without memory accumulation.
3.5. Hierarchical Joint Loss Function
To optimize the dual-level structure, we define a joint loss function that balances local detection and relational propagation:
where and can be instantiated as weighted binary cross-entropy or focal losses [14] to address the extreme class imbalance prevalent in fraudulent blockchain datasets, and is an regularization term.
3.6. Design Rationale
DLG-GNN differs from existing flat anomaly detectors in three key aspects. First, it separates intra-contract behavior from inter-contract relational context, enabling multi-scale representation learning that is invisible to single-level flat models. Second, it adopts an inductive sequential pipeline that avoids loading the entire global graph into GPU memory, fundamentally overcoming the transductive “scalability wall.” Third, it uses domain-aware partitioning based on smart contract boundaries, preserving blockchain-specific semantic units—and thus the “money trail” context—while reducing memory overhead. These design choices allow DLG-GNN to retain local forensic signals and global relational dependencies simultaneously, even under strict hardware constraints.
4. Experiments
4.1. Experimental Setup
Datasets: We utilize transaction datasets from Binance Smart Chain (BSC), Ethereum (ETH), and Polygon (MATIC) [6]. These datasets contain complex smart contract interactions with labeled fraudulent and benign nodes. The fraud-labeled ratio in Table 1 denotes the class distribution within the processed GoG benchmark subset, not the real-world prevalence of fraudulent entities in the entire blockchain network. Because the benchmark subsets are constructed around labeled suspicious activities, some chains exhibit highly skewed fraud-labeled ratios. Since PR-AUC and Best-F1 are sensitive to the positive-class prior, we primarily rely on ROC-AUC for cross-chain comparison while reporting PR-AUC and Best-F1 as supplementary metrics.
Hardware Environment: All experiments for DLG-GNN were conducted on a consumer-grade laptop equipped with an NVIDIA RTX-series laptop GPU with 8 GB VRAM and 32 GB of system RAM.
4.2. Performance Comparison
Table 1 summarizes the detection performance in terms of ROC-AUC, PR-AUC, and Best-F1 score. For the PyGOD-based comparison, we evaluated multiple graph anomaly detection models and report the best-performing baseline for each dataset. All baselines were trained and evaluated under the same data split and metric protocol for fair comparison. DLG-GNN-Full consistently outperforms the reported strongest PyGOD-based baseline across all chains. .
The results indicate that DLG-GNN-Full achieves a substantial performance gain, particularly on the Ethereum network, with an absolute ROC-AUC improvement of 15.49 percentage points over the strongest reported PyGOD-based baseline.
Figure 2 illustrates the detection performance of DLG-GNN variants across the three blockchain networks. Ethereum exhibits higher graph density and more complex interactions between smart contracts than BSC or Polygon, making fraud detection more challenging. The substantial ROC-AUC improvement on Ethereum supports the effectiveness of the proposed decoupling strategy. In high-density transaction graphs, local malicious signals can be obscured by global structural noise; however, the Level 1 encoder of DLG-GNN filters local contract-level features before relational reasoning is performed.
DLG-GNN-L1 captures only internal contract behaviors, whereas DLG-GNN-L1+L2 integrates intra-contract patterns with inter-contract relational dependencies. DLG-GNN-Full represents the complete framework with optimized sequential fitting and GATv2-based dynamic attention. The incremental performance gains from DLG-GNN-L1 to DLG-GNN-Full indicate that relational context is important for capturing multi-hop laundering activities. The integration of GATv2 layers allows the model to assign dynamic importance to inter-contract edges, effectively identifying suspicious money trails that are difficult for single-level detectors to capture.
4.3. Resource Efficiency and Scalability Analysis
The experimental results indicate that main memory (RAM) usage scales proportionally with graph size, reaching a peak of approximately 6.5 GB for the dense Ethereum dataset. Crucially, however, peak GPU VRAM consumption remains consistently below 200 MB across all test scenarios. This demonstrates that while global data structures reside in main memory, DLG-GNN prevents the VRAM-intensive “scalability wall” inherent in legacy transductive models.
4.4. Ablation Study: Impact of Hierarchical Layers
The local-only variant, DLG-GNN-L1, achieves a ROC-AUC of 0.8478, indicating that intra-contract behavioral patterns alone provide meaningful fraud detection signals. When Level 2 relational contextualization is added, DLG-GNN-L1+L2 substantially improves ROC-AUC to 0.9476, corresponding to an absolute gain of 9.98 percentage points over DLG-GNN-L1. This result demonstrates that inter-contract dependencies are critical for detecting sophisticated laundering behaviors that span multiple contracts.
These results suggest that the full framework preserves the discriminative benefits of hierarchical local-to-global learning while improving robustness in positive-class retrieval. Overall, the ablation study confirms that the major performance gain comes from incorporating Level 2 relational reasoning, while the full DLG-GNN configuration provides the most balanced performance across evaluation metrics.
5. Conclusion
In this study, we addressed the critical challenge of scalability in hierarchical Graph Neural Networks (GNNs) for blockchain fraud detection. While previous hierarchical models such as GoG provided useful architectural insights, their transductive nature and quadratic memory complexity posed a significant “scalability wall,” restricting their use to high-end hardware environments. The proposed DLG-GNN overcomes these limitations by introducing a resource-efficient decoupled local-to-global learning pipeline.
By implementing domain-aware partitioning and a sequential inductive fitting strategy with proactive garbage collection, DLG-GNN bounds peak GPU memory usage by the maximum partition size K, yielding worst-case memory for dense subgraph operations. This design allows large-scale networks such as Ethereum to be analyzed within a stable GPU memory footprint below 200 MB.
Our findings suggest that organizing transaction data into logical contract units is not only computationally efficient but also useful for filtering structural noise inherent in massive blockchain graphs. This work provides a foundation for resource-efficient on-chain monitoring systems.
Acknowledgments
This work was supported by the Institute of Information & Communications Technology Planning & Evaluation (IITP) through the Information Technology Research Center (ITRC) grant funded by the Korea government (Ministry of Science and ICT) (IITP-2026-RS-2021-II211835).
References
- Hassan, M. U.; Rehmani, M. H.; Chen, J. Anomaly detection in Blockchain networks: A comprehensive survey. IEEE Commun. Surv. Tutor. 2022, 25(1), 289–318. [Google Scholar] [CrossRef]
- Elmougy, Y.; Manzi, O. Anomaly detection on Bitcoin and Ethereum networks using GPU-accelerated machine learning methods. In Proceedings of the 31st International Conference on Computer Theory and Applications (ICCTA); IEEE, 2021; pp. 166–171. [Google Scholar]
- Ehsan, A.; Iqbal, Z.; Abuowaida, S.; Aljaidi, M.; Zia, H. U.; Alshdaifat, N.; Alshammry, N. K. Enhanced anomaly detection in Ethereum: Unveiling and classifying threats with machine learning. IEEE Access 2024, 12, 176440–176456. [Google Scholar] [CrossRef]
- Weber, M.; Domeniconi, G.; Chen, J.; Weidele, D. K. I.; Bellei, C.; Robinson, T.; Leiserson, C. E. Anti-money laundering in Bitcoin: Experimenting with graph convolutional networks for financial forensics. arXiv 2019, arXiv:1908.02591. [Google Scholar]
- Kipf, T. N.; Welling, M. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017. [Google Scholar]
- Luo, B.; Zhang, Z.; Wang, Q.; He, B. Multi-Chain Graphs of Graphs: A new approach to analyzing Blockchain datasets. In Advances in Neural Information Processing Systems (NeurIPS); 2024. [Google Scholar]
- Zeng, H.; Zhou, H.; Srivastava, A.; Kannan, R.; Prasanna, V. GraphSAINT: Graph sampling based inductive learning method. International Conference on Learning Representations (ICLR), 2020. [Google Scholar]
- Brody, S.; Alon, U.; Yahav, E. How attentive are graph attention networks? International Conference on Learning Representations (ICLR), 2022. [Google Scholar]
- Veličković, P.; Cucurull, G.; Casanova, A.; Romero, A.; Liò, P.; Bengio, Y. Graph attention networks. International Conference on Learning Representations (ICLR), 2018. [Google Scholar]
- Ding, K.; Li, J.; Bhanushali, R.; Liu, H. Deep anomaly detection on attributed networks. In Proceedings of the 2019 SIAM International Conference on Data Mining, SIAM, 2019; pp. 594–602. [Google Scholar]
- Fan, H.; Zhang, F.; Li, Z. AnomalyDAE: Dual autoencoder for anomaly detection on attributed networks. In ICASSP 2020 – 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); IEEE, 2020; pp. 5685–5689. [Google Scholar]
- Hamilton, W. L.; Ying, R.; Leskovec, J. Inductive representation learning on large graphs. Adv. Neural Inf. Process. Syst. (NeurIPS) 2017, Vol. 30. [Google Scholar]
- Chiang, W.-L.; Liu, X.; Si, S.; Li, Y.; Bengio, S.; Hsieh, C.-J. Cluster-GCN: An efficient algorithm for training deep and large graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2019; pp. 257–266. [Google Scholar]
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, 2017; pp. 2980–2988. [Google Scholar]
Figure 1.
Overview of the proposed DLG-GNN architecture.

Figure 2.
Detection performance across model stages on BSC, Ethereum, and Polygon datasets. Gray lines denote representative baseline models, while blue lines denote DLG-GNN variants.
Figure 2.
Detection performance across model stages on BSC, Ethereum, and Polygon datasets. Gray lines denote representative baseline models, while blue lines denote DLG-GNN variants.

Table 1.
Multi-Chain Dataset Statistics and Fraud Detection Performance Comparison.
| Chain | #Nodes | #Edges | #Fraud | #Benign | Model | ROC-AUC | PR-AUC | Best-F1 |
|---|---|---|---|---|---|---|---|---|
| BSC | 7,481 | 59,832 | 1,104 | 6,377 | PyGOD (AnomalyDAE) | 0.7579 | 0.9402 | 0.9199 |
| DLG-GNN-Full (Ours) | 0.8332 | 0.9614 | 0.9366 | |||||
| Ethereum | 14,385 | 115,065 | 6,018 | 8,367 | PyGOD (AnomalyDAE) | 0.7709 | 0.8470 | 0.7547 |
| DLG-GNN-Full (Ours) | 0.9258 | 0.9188 | 0.8933 | |||||
| Polygon | 2,303 | 18,411 | 60 | 2,243 | PyGOD (AnomalyDAE) | 0.7443 | 0.9911 | 0.9857 |
| DLG-GNN-Full (Ours) | 0.9049 | 0.9963 | 0.9928 |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.