Lightning Network Routing — How Your Payment Finds Its Path
Your Lightning payment bounces through multiple nodes in milliseconds. Here's the graph theory and onion routing behind it.
Uvin Vindula — IAMUVIN
Published 2025-05-28 · Updated 2026-01-25
Lightning Network Routing Explained
When you tap "send" on a Lightning payment, your wallet calculates a path through thousands of nodes, constructs an onion-encrypted packet, and routes your payment through multiple hops — all in milliseconds.
The Network Graph
Lightning is a graph network. Nodes are vertices, channels are edges. Every node maintains a local graph copy, updated through a gossip protocol. Each channel has attributes:
- Capacity: Total Bitcoin locked in the channel
- Base fee: Flat fee per forwarded payment (typically 0-1 sat)
- Fee rate: Proportional fee (typically 1-100 ppm)
- CLTV delta: Time-lock requirement for the HTLC chain
Source-Based Routing
Unlike IP routing where each router decides the next hop, Lightning uses source-based routing. The sender calculates the entire path upfront — a deliberate privacy choice. Intermediate nodes only know their predecessor and successor.
Pathfinding Algorithms
Most implementations use modified Dijkstra's algorithm:
- LND: Probabilistic model penalizing recently-failed channels
- CLN: Dijkstra-based with fee optimization and randomization
- Eclair: Yen's k-shortest-paths for multiple candidate routes
Multi-Part Payments (MPP)
No single path has enough capacity? MPP splits your payment across multiple routes. Send 100,000 sats as four 25,000-sat payments over different paths. The receiver releases the preimage only once all parts arrive.
Onion Routing — Privacy Layer
Lightning uses Sphinx onion routing, inspired by Tor. Each forwarding node peels one encryption layer, sees only the next hop. No intermediate node can determine the original sender, final recipient, total hops, or full amount. This is genuinely strong privacy.
The Routing Fee Market
The average Lightning routing fee in 2025 is approximately 1-5 satoshis for a typical payment. That's less than 0.001%. Try getting that rate from any bank in Sri Lanka.
For more on running your own node and earning routing fees, check our guides.

By Uvin Vindula — IAMUVIN
Sri Lanka's leading Bitcoin educator. Author of "The Rise of Bitcoin".
Learn more →Related Articles
The Bitcoin Brief: LK
Weekly Bitcoin insights, market analysis, and Sri Lanka crypto news. Join 1,000+ readers.
Unsubscribe anytime · Educational content only