pull down to refresh
490 sats \ 3 replies \ @C_Otto 25 Jun 2023 \ on: How are LN payments routed? bitcoin
When you initiate a payment, your node is responsible for coming up with a route to the destination. For this, it uses its knowledge of the whole LN graph (which is created based on other nodes telling your node their version of the graph). Then, using this graph, some routing algorithm is used so that the resulting route is (ideally) cheap, has a high probability of success, and minimized certain issues. This route is attempted and, if it reaches the destination, everything is fine.
The intermediate nodes have to follow the route given by your node, as they are unable to decrypt the information they don't need. If my node forwards some amount from node A to node B, I just see the corresponding details, without having access to the information node B is able to access (for example, it could be the final recipient, or continue forwarding to node C).
If not, your node integrates the information about the failure into its data set (for example: node X cannot send amount Y to node Z) and tries again. And, possibly, again after that. Usually, you don't see how many failed attempts it took, but every (failed) attempt increases the total time your payment takes.
It is possible to split a payment into several pieces which take different routes, but arrive at the same time (or not at all). If you want to have a closer look at this, and how this relates to payment success probability, I can highly recommend Rene Pickhardt's research work (#PickhardtPayments).
Thanks!
Are there any known/expected limitations to scalability due to requiring knowledge of the global graph?
reply
I did not know LN us using a graph in order to do routes. Is there any way I could pull this information and map it visually? It would be interesting to see how LN nodes route visually.
reply
lncli describegraph
is one way to get a textual representation. If you're not used to this kind of stuff, I'd rather look at existing visualizations, though. One example: https://lnrouter.app/graphreply