ELI5 what a lightning channel is and what it does

Reply to this note

Please Login to reply.

Discussion

I’m just learning so do you want to hear bad and possibly wrong attempt at it?

absolutely, the best way to learn for us both 💜

Imagine a game of poker, you buy in chips worth some amount held buy the casino. This buying in of chips is essentially opening up a channel, the casino is mostly a multi sig bitcoin address shared by whomever you’re opening a channel with.

Now you can play with those chips as much as you want make as many bets as you wants and whenever you want to close the game the final amounts are traded back with the casino. This is like the closing of the channel.

Not sure if I made a lot of sense, but it’s the closest analogy o could think of 😅

I like this analogy! As long as your audience realizes it has nothing to do with gambling

True 😅

wonderful analogy, got me even more curious now how the technicals work 💜🫶

All transactions are signed by the parties involved with their keys but are not sent on chain only meant for settlement internally on the channel. On chain settlement only happens once the channel closes.

This is a hand-wavy part for me as well rn. Need to go deep into the internals, learnt some part of the protocol which overlapped with nostr, a lot more still to learn.

A lightning channel creates an open tab between you and me of a fixed amount that automatically updates how much of that amount each of us owns as we pay each other back and forth for different reasons, and it creates it in such a way that either one of us can close the tab at any time and retrieve our portion of the total amount, or we can leave it open perpetually until we both decide to close it out and settle up.

i kinda understand it, but the purpose of it seems blurry for me 🤔💜

It’s much faster than you and me driving across town and paying each other in cash every time we need to pay each other for something.

what are the differences in speed? 🤔

To continue the analogy, it’s the difference of me texting you that I’m moving $20 of our shared balance back to your side of the books, which would take a few seconds, versus me hopping in the car and driving 10 minutes to your house. Well, on average it’s a 10 minute drive, but sometimes there’s a lot of traffic and it may take 30 minutes or an hour, or maybe I just took the scenic slow route because it was cheaper on tolls. Not to mention the added cost/fees associated with me having to make that drive.

To put it in bitcoin terms, a Lightning payment (us updating our shared balance/ledger) is nearly instant, versus an on chain transaction (me driving to your house to pay you in cash) which takes on average 10 minutes, but sometimes more or less depending on various factors.

This makes a lot of sense, thank you so much for this explanation man, the analogies really helped 💜💜💜

💜🙌

And yea the real power is when you start picturing a global network of those “open tabs” constantly forwarding and updating in such a way that keeps the whole process trust-minimized. It’s truly incredible.

The purpose becomes clearer when other people open channels too. So if I also had a tab nostr:npub1lrnvvs6z78s9yjqxxr38uyqkmn34lsaxznnqgd877j4z2qej3j5s09qnw5 now if you wanted to pay me you could go through him instead of having to open a channel through me directly.

So if you want to be me 5 sats you’d debit 5 sats from your “tab” and corn would “forward” that and debit 5 from his tab with me. He’d have the 5 you sent and I would have the 5 he sent me so corn would be whole (no change in how much is on his side).

Now how we keep corn honest (and not keep the 5 sats for himself) goes into more complicated “fairness protocol”.

🤔 thank you so much for this 💜

Yes 🙌 And if you’re the middle hop of that route, or one of several hops in the middle, you can even choose to charge me a small % of the total amount I want forwarded as a way of compensating you for helping me get my payment to the final recipient. That’s where fees on lightning payments come into play.

Also, if there are other hops/forwards in between, those extra nodes only see the nodes directly adjacent to them in the sequence. Aka they even don’t know it was a payment from tanel to wolfbear

(this is true right 🤣)

Yes true 😂 Nodes along the route only know which node they received it from and which they sent it to.

Lighting tutorial team effort! Only on nostr. (I’m afraid some dork would have told me why I’m a moron on “another app”)

Could someone operate as a mass go between? A "mixer" for lack of a better term in my vocabulary.

Yeah there are nodes that provide massive liquidity and are well connected. Only trade off we want to be careful of is centralization where too many people depend on that go between.

Hey kiddo,

So you know how bitcoin is assigned to addresses and how bitcoin assigned to an address can only be spent by the person who created the address?

Well an address can be owned by 2 people too. When owned by 2 people, it means that neither person can spend any bitcoin unless there is unanimous agreement. 2 people own it if they agree with one another, but neither of them own it independently.

A lightning channel is bitcoin stored in one of these shared addresses as well as some private channel state that each participant manages their own copy of.

The channel state dictates how much of the bitcoin in the shared address belongs to who, as well as keeping some pre-signed transactions that will allow either party to withdraw their share of the pot at any time, even if the other person goes dark and becomes unresponsive.

When one person wants to give some of their bitcoin to the other person, the channel state gets updated reflect that and new transactions are created and signed to ensure that there is an exit strategy at all times for both parties.

Needless to say, an update requires both parties to work together since both parties need to update their respective channel states and also need to be involved when signing these exit strategy transactions.

The benefit of channels is that the balance can be updated as many times as you'd like for free, without waiting for it to be mined into a block, and without losing a fraction of the balance for fees. Only when one of you need to withdraw your bitcoin to use for something else, will a transaction be broadcast to be mined into the blockchain which requires waiting for block confirmation and allocating a fraction of the balance for miner fees.

Now that's the benefit of a single channel, but when I have a channel with you and you have another channel with a friend of mine, then we have a network where I can send money to you to give to my friend and the Lightning Network protocol has a way to facilitate that in a way where you can't cheat me by being the middleman. You can, however ask for a small fee to facilitate the payment and if it's cheaper than me making a normal transaction, it's in my interest to make the payment that way.

This just so happens to make channels even more useful. I can now pay others by paying through you using our channel and you could do the same paying through me.

So TLDR; a channel is bitcoin stored in a shared address between 2 people, some channel state that each person uses to keep track of who owns what portion of the funds and a series of signed transactions that ensure there is always an exit strategy in case one of the people go rogue.

This is why we say Lightning bitcoin IS bitcoin. Units of bitcoin on the Lightning Network are backed by actual Bitcoin transactions and neither party can forge a transaction without the other agreeing to it which is why the transaction doesn't need to be mined into a block to know that the allocation of bitcoin in a channel is safe from fraud.