An Exposition of Pathfinding Strategies Within Lightning Network Clients
Sindura Saraswathi, Christian Kümmerle
TL;DR
This work analyzes how pathfinding is implemented in prominent Lightning Network clients by comparing weight design, constraints, and algorithm choices across LND, CLN, LDK, and Eclair. It treats path costs with additive, additive+multiplicative, and probability-based terms, highlighting that many formulations are NP-complete and not guaranteed optimal under production tweaks. Through simulations on a realistic LN graph with uniform and bimodal liquidity distributions, it reveals that Eclair achieves the best overall reliability and low fees, while LND and LDK exhibit trade-offs between reliability, fees, and timelocks, and CLN emphasizes low timelock. The study argues for exploring more sophisticated routing algorithms beyond standard Dijkstra variants and for refining channel-probability models to improve routing performance, with implications for single- and multi-path payments alike.
Abstract
The Lightning Network is a peer-to-peer network designed to address Bitcoin's scalability challenges, facilitating rapid, cost-effective, and instantaneous transactions through bidirectional, blockchain-backed payment channels among network peers. Due to a source-based routing of payments, different pathfinding strategies are used in practice, trading off different objectives for each other such as payment reliability and routing fees. This paper explores differences within pathfinding strategies used by prominent Lightning Network node implementations, which include different underlying cost functions and different constraints, as well as different greedy algorithms of shortest path-type. Surprisingly, we observe that the pathfinding problems that most LN node implementations attempt to solve are NP-complete, and cannot be guaranteed to be optimally solved by the variants of Dijkstra's algorithm currently deployed in production. Through comparative analysis and simulations, we evaluate efficacy of different pathfinding strategies across metrics such as success rate, fees, path length, and timelock. Our experiments indicate that the strategies used by Eclair are advantageous in terms of payment reliability and result in paths with low fees. LND exhibits moderate success rates, while LDK results in paths with higher fee levels for smaller payment amounts; furthermore, CLN stands out for its minimal timelock paths. Additionally, we investigate the impact of Lightning node connectivity levels on routing efficiency. The findings of our analysis provide insights towards future improvements of pathfinding strategies and algorithms used within the Lightning Network.
