2 upvotes, 1 direct replies (showing 1)
View submission: ⚡ Lightning Network Megathread ⚡
if Joe purchases a latte and his purchase is routed through Alice, doesn't this use up one of Alice's lattes?
I actually am interested to understand that. So say Joe has a channel to Alice, and Alice has a channel to Bob. Everyone has 1 btc on their side. Joe sends a payment of 1 btc to Bob, which gets routed through Alice. So the new state of the network is: Joe has 0 btc and Bob has 2 btc (his original + 1 btc from Joe). Alice still has 1 btc, but is that btc still usable on her channel with Bob or does she need to close her channel with Joe, and then transfer that 1 btc to her channel with Bob in order to be able to pay Bob again?
Comment by Prodigga at 07/01/2018 at 14:24 UTC*
7 upvotes, 1 direct replies
So, with your example.. you said everyone has 1 BTC on "their side". This means both sides put in 1 BTC to open the channel. Network looks like so:
[Joe] (1) <--->(1) [Bob] (1)<--->(1) Alice[1]<--->(0) [Coffee Shop]
Joe buys an expensive ass coffee for 1 BTC from the coffee shop, he doesn't have a direct link to it. So, lighting network seamlessly routes his payment through everyone until the money hits the coffee shop. Joe pays Bob, Bob pays Alice, Alice pays coffee shop.
The network now looks like this:
[Joe] (0) <--->(2) [Bob] (0)<--->(2) Alice[2]<--->(1) [Coffee Shop]
Due to the new state of this (unrealistically small) network, no one else can buy a coffee. Alice will be disappointed when she goes to buy one because her money isn't in that channel any more, it's on the channel she has with Bob. She still has the 2 BTC. But that 2 BTC is now in the channel with Bob. And she is the one that spent the bitcoin transaction fee to open the channel with the coffee shop to begin with.
Her options are:
[Joe] (0) <--->(2) [Bob] (0)<--->(2) Alice[3]<--->(1) Coffee Shop[4]<--->(1) [Sam]
Sam sends Joe 1 BTC via the lighting network. The network now looks like this:
[Joe] (1) <--->(1) [Bob] (1)<--->(1) Alice[5]<--->(0) Coffee Shop[6]<--->(0) [Sam]
I understand these are just silly little examples, but pretend instead that these channels represented their every day spending accounts or something, and they were load with more money and the coffee shop was a super market instead. Maybe Alice goes out shopping and she wants to spend a few hundred dollars worth of BTC on groceries and such. But as she pushes her trolley to the register, someone decided to splurge on something big elsewhere and the purchase just happened to be routed through Alice. The money she had in the channel linking her to the grocery store has moved to one of her other channels. And what if there is no valid route from the other channel back to the grocery store? Or maybe there is a valid route, but there isn't enough BTC in The channels along that route to fund her purchase?
I know it sounds like I am approaching this all like it's doomed to fail, but that's not my intention. I'm just trying to get a proper understanding for the limitations of the system. It isn't magic, it's a protocol, and I feel it's important to understand how it works before blindly pushing for adoption like a lot of other users seem to be doing.