Preprint
Article

This version is not peer-reviewed.

DLG-GNN: Decoupled Local-to-Global Graph Neural Network for Scalable Blockchain Fraud Detection

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: 
;  ;  ;  ;  

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., O ( N 2 ) , 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 O ( K 2 ) 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.

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 G global = ( V all , E all , X all ) . Unlike traditional transductive approaches that load G global as a single monolithic tensor, we decompose the network into a set of M independent contract-level subgraphs:
G = { g 1 , g 2 , , g M } , where g m = ( V m , E m , X m )
To ensure strict memory compliance, we introduce a domain-aware partitioning function Φ [7,13]. If a subgraph exceeds a predefined node limit K (derived from the available VRAM), it is further atomized as follows:
Φ ( g m ) = { g m , 1 , , g m , p } , s . t . k , | V m , k | K

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 j N i within subgraph g m , the dynamic attention score e i j , the normalized attention coefficient α i j , and the updated node representation h i are computed as follows:
e i j = a LeakyReLU W s h i + W t h j
α i j = exp ( e i j ) k N i exp ( e i k )
h i = σ j N i α i j W h j
The full Level 1 forward pass over subgraph g m and the subsequent contract-level embedding z m ( L 1 ) are obtained via a readout function:
H m ( L 1 ) = GATv 2 ( L 1 ) ( g m ; θ L 1 )
z m ( L 1 ) = Readout h i ( L 1 ) v i V m

3.3. Level 2: Inter-contract Relational Contextualization

The extracted embeddings { z m ( L 1 ) } m = 1 M serve as nodes in a relational meta-graph G ( L 2 ) = { z m ( L 1 ) } m = 1 M , E rel . Level 2 applies a second GATv2 stack to learn contextual dependencies between contracts:
Z ( L 2 ) = GATv 2 ( L 2 ) G ( L 2 ) ; θ L 2
The final fraud score s m for contract m is produced by a fusion head that concatenates the local and relational representations:
s m = σ MLP z m ( L 1 ) z m ( L 2 )

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 g m independently, without requiring access to the full graph during training or inference.
The peak GPU memory is bounded by the largest processed subgraph, yielding O ( K 2 ) worst-case memory for dense subgraph operations, where K N 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 z m ( L 1 ) is computed, g m 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 L total that balances local detection and relational propagation:
L total = λ 1 L L 1 + λ 2 L L 2 + η Θ 2
where L L 1 and L L 2 can be instantiated as weighted binary cross-entropy or focal losses [14] to address the extreme class imbalance prevalent in fraudulent blockchain datasets, and η Θ 2 is an 2 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 O ( N 2 ) 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 O ( K 2 ) 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

  1. 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]
  2. 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]
  3. 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]
  4. 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]
  5. Kipf, T. N.; Welling, M. Semi-supervised classification with graph convolutional networks. International Conference on Learning Representations (ICLR), 2017. [Google Scholar]
  6. 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]
  7. 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]
  8. Brody, S.; Alon, U.; Yahav, E. How attentive are graph attention networks? International Conference on Learning Representations (ICLR), 2022. [Google Scholar]
  9. 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]
  10. 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]
  11. 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]
  12. Hamilton, W. L.; Ying, R.; Leskovec, J. Inductive representation learning on large graphs. Adv. Neural Inf. Process. Syst. (NeurIPS) 2017, Vol. 30. [Google Scholar]
  13. 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]
  14. 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 1. Overview of the proposed DLG-GNN architecture.
Preprints 232520 g001
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.
Preprints 232520 g002
Table 1. Multi-Chain Dataset Statistics and Fraud Detection Performance Comparison.
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.
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.