I found the Routing section in the docs, and I think I get it now. The reason most of the smaller blog posts I had read had recommended opening a channel was mainly so that there was "a way" to be found by others by routing through other channels. However, in theory, I could also make a direct peer-to-peer channel to another person directly, given their node's IP:Port combo and lightning invoice. However, that would actually be inefficient if I did that for multiple people as I would start spewing a lot of channels in the form of a BTC transaction on the chain and causing a huge amount of processing. So by using one, or maybe a few more, channels, I can improve routing to and from me, and also keep my traffic and usage under control.

I think I get it now. This also means that should someone end up using my channel, I can collect fees for the routing too. Neat, passive income. :)

It's nearly 5am, im actually impressed i am still able to grasp all that. XD

Reply to this note

Please Login to reply.

Discussion

Noice! I love to read about you digging in to understand this tech. 😁

Two comments:

1. There is a distinction between public (announced) channels and private (unannounced) channels. (They were poorly named, neither type of channel is private.) Routing nodes use announced channels so that others can route payments over them. Non-routing nodes typically don't announce their channels over the peer-to-peer network because they are not interested in the routing fees or in the headaches this causes (rebalancing channels, liveness requirements, etc.). In order to receive a payment over an unannounced channel you need to include a 'routing hint' in the invoices you create (this is why it's not private). Your node software will handle this for you, but its good to be aware of how it works. This is the cause of a lot of routing errors.

2. Invoices have an expiration. So even if you wanted to open a channel to pay a single invoice it would most likely take too long to get confirmed on chain. This is true for BOLT11 invoices, which are the original, most basic, kind of invoice that every lightning wallet and node understands. There is a new spec for BOLT12 invoices that don't time out that is slowly gaining adoption, so look out for those in the future they are super cool.

This is the best starting place to go deep. https://github.com/lnbook/lnbook

TIL this book is free online. 🤯

Foss is the way :)

And its companion book for on-chain bitcoin. Both are freely available online. You don't have to read them in any particular order. https://github.com/bitcoinbook/bitcoinbook