Is AI Ready for AML in DeFi? A Look Into Transaction-Level Risk Analysis
This talk evaluates the effectiveness of various machine learning models, specifically Graph Neural Networks (GNNs), in detecting money laundering patterns within decentralized finance (DeFi) transactions. The research focuses on identifying illicit transaction flows by analyzing graph-based relationships between wallet addresses and transaction endpoints. The findings demonstrate that GNN models like Graph Isomorphism Network (GIN) significantly outperform traditional machine learning approaches in accuracy and recall. The presentation highlights the challenges of real-time risk assessment and the necessity of optimizing tracing architectures for production environments.
Beyond Heuristics: Why Graph Neural Networks Are the Future of DeFi AML
TLDR: Traditional rule-based anti-money laundering (AML) systems are failing to keep pace with the rapid, automated obfuscation techniques used in DeFi hacks. This research demonstrates that Graph Neural Networks (GNNs), specifically the Graph Isomorphism Network (GIN), significantly outperform traditional machine learning models by learning the structural relationships of illicit transaction flows. For security researchers, this shift highlights that detecting modern financial crime requires moving from static analysis of individual wallets to graph-based analysis of transaction topologies.
The current state of anti-money laundering in decentralized finance is broken. While we see billions of dollars drained from bridges and protocols annually, the industry still relies heavily on legacy heuristics—simple rules that flag transactions based on volume or known blacklisted addresses. Attackers know this. They have moved toward sophisticated, automated laundering chains that involve rapid token swapping, chain hopping, and the use of privacy-focused mixers. If you are still looking at a single wallet address to determine risk, you are already behind.
The Failure of Traditional Models
During a recent presentation at BSides London 2025, researcher Yash Nimbalkar provided a compelling look at why traditional machine learning models, such as Random Forest, struggle to identify illicit activity in the Ethereum ecosystem. The core issue is that traditional models treat transactions as isolated data points. They look at features like gas price, transaction frequency, or wallet age, but they fail to capture the "topology" of the crime.
In a typical DeFi hack, the attacker does not simply move funds from A to B. They create a complex, multi-hop graph where funds are split, merged, and routed through various decentralized exchanges (DEXs) and bridges. A Random Forest model might see a high-volume transaction and flag it, but it cannot understand that this transaction is part of a larger, coordinated effort to obfuscate the origin of stolen assets.
Why Graph Neural Networks Win
The research highlights a shift toward Graph Neural Networks (GNNs), which are designed specifically to process data structured as graphs. In this context, a wallet is a node, and a transaction is an edge. By training models like GraphSAGE or the Graph Isomorphism Network (GIN), researchers can teach the model to recognize the "shape" of a money laundering operation.
The results are stark. In comparative testing, GIN models achieved an F1 score of 88.4%, compared to just 61.9% for Random Forest. The GIN model’s ability to learn relationships—rather than just static features—is the key differentiator. It identifies the structural patterns inherent in how attackers move funds to avoid detection, such as the specific way they interact with Tornado Cash or other obfuscation protocols.
The Practical Reality for Pentesters
For those of us conducting security assessments or bug bounty hunting, this research changes how we should approach the "impact" section of our reports. If you are auditing a DeFi protocol, you are not just looking for reentrancy bugs or logic errors in the smart contract. You are looking at the entire lifecycle of the asset.
When you identify a vulnerability that allows for unauthorized fund withdrawal, you need to be able to articulate how those funds would be laundered. Understanding the graph-based nature of these attacks allows you to build better PoCs. You can simulate the "getaway" phase of an exploit by mapping out how an attacker would likely route the stolen funds through the current DeFi landscape.
However, there is a significant bottleneck: the tracing architecture. The research found that while the GNN models themselves are fast, the process of tracing transactions to build the graph is computationally expensive. If you are building a tool to monitor these flows, you cannot rely on public RPC nodes. You need a dedicated, high-performance node to handle the volume of data required for real-time analysis.
The Defensive Perspective
Defenders must stop viewing AML as a post-facto compliance exercise. If your security operations center (SOC) is only looking at alerts after the money has already hit a centralized exchange, the game is over. The goal is to integrate graph-based risk assessment directly into the transaction validation pipeline.
This means moving toward a model where the risk score of a transaction is calculated in real-time, based on the graph-based history of the sender. If a wallet has a high "closeness centrality" to known malicious actors or has interacted with a series of suspicious endpoints, the transaction should be blocked before it is ever included in a block.
What Comes Next
The next frontier for researchers is adversarial robustness. As we get better at using GNNs to detect laundering, attackers will inevitably start training their own models to generate "clean-looking" transaction graphs that bypass these detectors. We are entering an arms race where the battlefield is the graph itself.
If you are working in the blockchain security space, start looking into how these graph structures are built. Don't just rely on Etherscan. Use tools that allow you to query the chain as a graph, such as The Graph, and start visualizing the flow of funds. The ability to see the "shape" of an attack is the most powerful tool you have in your arsenal. The era of simple, rule-based detection is over; the era of graph-based intelligence has begun.
Vulnerability Classes
Target Technologies
Attack Techniques
All Tags
Up Next From This Conference
Similar Talks

Where's My Crypto, Dude? The Ultimate Guide to Crypto Money Laundering

Your AI Assistant Has a Big Mouth: A New Side-Channel Attack




