Bitcoin's Lightning Network has always promised instant, low-cost, trustless payments at internet scale. But one challenge remains: how to efficiently allocate liquidity so payments can flow freely through the network. Today, we're excited to share the results of our newest research: MPFlow, an AI agent that uses deep graph reinforcement learning to optimize liquidity placement on the Lightning Network.
In collaboration with Stillmark, this research marks a milestone for scaling Bitcoin payments without compromising decentralization.
Why MPFlow Matters
The Lightning Network is built on payment channels that need liquidity to route transactions. When liquidity isn't well-placed, payments fail or take longer paths, reducing network efficiency. Historically, Lightning nodes relied on simple heuristics —like connecting to high-degree nodes (“autopilot” mode)— to guess where liquidity should go.
MPFlow changes that. It learns from the network's topology itself, identifying where liquidity will most improve throughput. The model interprets the Lightning Network as a living graph —an evolving web of connections— and optimizes liquidity allocation through intelligent, data-driven decisions.
How MPFlow Works
MPFlow uses a Message-Passing Neural Network (MPNN) —a type of graph neural network— to represent the Lightning Network's structure and channel capacities. Combined with Proximal Policy Optimization (PPO), the agent learns a simple rule: place liquidity where it most increases total payment throughput.
In technical terms, it treats the problem as a graph reinforcement learning challenge. The model's reward is tied to improvements in max-flow, a classical network theory concept representing the maximum possible throughput between two nodes.
MPFlow's innovation lies in how it “thinks” about bottlenecks:
- It uses max-based aggregation to identify constrained parts of the network (the digital equivalent of a traffic jam).
- It updates its strategy in real time, learning how to “thicken” routes that are likely to boost payment success rates.
- It stays lightweight —just two message-passing layers— so it can run efficiently in production environments.
Measurable Impact on Lightning
In controlled tests across a 5,000-node Lightning Network snapshot, MPFlow achieved up to 11.3% higher throughput compared to leading “autopilot” algorithms. It also consistently outperformed standard heuristics like Betweenness Centrality, the current industry benchmark for peer selection.
The agent was trained and validated on real Lightning Network data, using multiple time-separated network states. It demonstrated strong generalization, maintaining performance across changing network topologies —crucial for a system that evolves every second.
Following research validation, Amboss activated MPFlow on the Rails Cluster, our production environment for self-custody yield-generation. MPFlow now dynamically allocates liquidity across Amboss's infrastructure, making smarter, faster decisions based on live network conditions.
Scaling Bitcoin Payments for the AI Era
“Payment volumes for the AI economy can't be served by adding a new blockchain,” explains Vikash Singh, Principal at Stillmark and Amboss research collaborator. “Even centralized blockchains can't handle one payment per Google search. Lightning, as an off-chain protocol, can. Optimizing Lightning is a perfect problem for geometric deep learning —and MPFlow proves that thesis.”
As global payment demands grow, intelligent liquidity management becomes essential for Lightning's continued evolution. MPFlow's results demonstrate that machine learning and decentralization can coexist —bringing capital efficiency, scalability, and autonomy to Bitcoin's payment layer.
What's Next
The MPFlow research opens a new frontier for AI-driven Bitcoin infrastructure. Future work will extend the agent's decision space to include channel rebalancing, yield optimization, and fee-aware routing, evolving MPFlow from a liquidity allocator to a comprehensive Lightning intelligence system.
The peer-reviewed paper, “MPFlow: A Deep Graph Reinforcement Learning Agent for Maximizing Throughput in the Lightning Network,” is available here.
For media inquiries, contact 21M Communications.