Lesson 2.18Bitcoin Professional · 18 of 20
Overall 38 / 60 (63%)
Bitcoin Professional progress90%
Full curriculum63%

2.18 Routing: Paying People You Don't Have a Channel With

How a Lightning payment hops across multiple channels.

Slide 1 of 5

Routing: Paying People You Don't Have a Channel With

You only have channels with a handful of people, so how do you pay someone you've never met? Through hops, like passing a message in a classroom.

1 / 5

You only have channels with a handful of people, so how do you pay someone you've never met? Through hops, like passing a message in a classroom.

If you have a channel with Alice, and Alice has one with Bob, and Bob has one with the coffee shop, you can pay the coffee shop by sending the payment through Alice and Bob. Each hop just nudges the IOU balance in the next channel.

Behind the scenes, Lightning uses a clever trick called an HTLC (Hashed Time-Locked Contract) that makes the whole multi-hop payment all-or-nothing: either every hop succeeds together, or nothing moves at all. Nobody's funds are ever at risk, even if one hop in the middle goes offline.

Routing nodes (the Alices and Bobs of the world) earn tiny fees for forwarding payments, which gives them a reason to keep their channels online and well-funded. The whole network self-organises into millions of paths.

Most users never think about routing — your wallet just figures out a route automatically in milliseconds.