Chapter 12. Pathfinding and Payment Delivery

Payment delivery on the Lightning Network depends on finding a path from the sender to the recipient, a process called pathfinding. Since the routing is done by the sender, the sender must find a suitable path to reach the destination. This path is then encoded in an onion, as we saw in Chapter 10.

In this chapter we will examine the problem of pathfinding, understand how uncertainty about channel balances complicates this problem, and look at how a typical pathfinding implementation attempts to solve it.

Pathfinding in the Lightning Protocol Suite

Pathfinding, path selection, multipart payments (MPP), and the payment attempt trial-and-error loop occupy the majority of the payment layer at the top of the protocol suite.

These components are highlighted by an outline in the protocol suite, shown in Figure 12-1.

Payment delivery in the Lightning protocol suite
Figure 12-1. Payment delivery in the Lightning protocol suite

Where Is the BOLT?

So far we’ve looked at several technologies that are part of the Lightning Network and we have seen their exact specification as part of a BOLT standard. You may be surprised to find that pathfinding is not part of the BOLTs!

That’s because pathfinding isn’t an activity that requires any form of coordination or interoperability between different implementations. As we’ve seen, the path is selected by the sender. Even though the routing details ...

Get Mastering the Lightning Network now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.