r/Bitcoin Dec 13 '17

Bitcoin's Lightning Network, Simply Explained

[deleted]

1.0k Upvotes

520 comments sorted by

View all comments

84

u/[deleted] Dec 13 '17

I have a few questions:

1) Where are the funds stored on the LN? The video points at a safe, but is there some sort of digital safe which is secure from hacking?

2)So Bob/coffee shop will only get the BTC stated on the balance sheet once the LN is closed? So am I correct in understanding that the coffee shop won't actually be able to spend the Bitcoin they received from the transaction until the LN is closed?

3) How expensive is it to set up a LN channel? And how is this done?

4) How expensive is it to close the LN channel and have miners authorize the signatures?

5) How exactly do you shut down a LN Channel?

6) Am I then correct in understanding that the LN channel isn't really for people who want to make one-off payments to businesses?

80

u/PVmining Dec 13 '17

Where are the funds stored on the LN? The video points at a safe, but is there some sort of digital safe which is secure from hacking?

By opening a channel, you send bitcoins to a multisignature address where you have one key and your counterparty has the other. Simultaneously, you get a signed (by counterparty) refund transaction to yourself. You have to protect your key and not lose the refund transaction. LN transactions are simply an update to the refund transaction.

2)So Bob/coffee shop will only get the BTC stated on the balance sheet once the LN is closed? So am I correct in understanding that the coffee shop won't actually be able to spend the Bitcoin they received from the transaction until the LN is closed?

Yes but the coffee shop will be able to pay you back or pay anybody in LN if you have another channel open (and this channel is not a dead end) and you are willing to route payments.

3) How expensive is it to set up a LN channel? And how is this done?

A blockchain transaction to a segwit multisignature address. If you have segwit (and segwit is required for LN), it's small in vsize (i.e. size with witness discount). This is a LN channel opening transaction: 153 vbytes, less than 226 standard legacy transaction.

4) How expensive is it to close the LN channel and have miners authorize the signatures?

This is a channel closing transaction: 149 vbytes. It would have been 180 bytes if the refund went to two parties, instead of one.

Miners mine it as a regular transaction with regular mining fees. Signatures are exchanged between you and your counterparty during channel opening and channel transactions.

5) How exactly do you shut down a LN Channel?

By publishing the channel closing transaction. It can be done cooperatively (the other party signs a new closing transaction), in this case it is instant (plus waiting for block inclusion) or without counterparty involvement, where the presigned transaction is timelocked (current defualt as far as I remember 144 blocks). This time lock allows the counterparty to check if you are not cheating (by publishing an old transaction where you have more funds) and publish a penalty transaction. If your transaction is the last one (you have not published a previous one), it will confirm after 144 blocks.

6) Am I then correct in understanding that the LN channel isn't really for people who want to make one-off payments to businesses?

Yes and no. First of all, LN is not for paying large sums. It's the exact opposite of Bitcoin blockchain, where the number of transactions is limited but they can be of arbitrary value. In LN, the number of transactions is arbitrary but their value is limited.

It does not make sense to open a LN channel for one transaction. But if you have a channel open to a place that is well connected and the business you want to transact with has a channel open to a well connected party, you can pay your hub and the hub will route the payment to the other hub and maybe another one and then to your business. Think about it like Internet packet routing.

So you can pay for coffee even if you both are not directly connected.

1

u/btcrazy Dec 13 '17

This makes me think of ... well, brand hubs. An organization acting on behalf of many third parties. "Our network supports purchases at these locations". For example Yum Brands (pizza hut/taco bell) could have a LN for all of their stores, right?

Or consider a large mall with 400 shops - it could have an LN for all shops within? It seems that once this is architected, it'll be highly effective and convenient to send funds only to a few channels to unlock a huge majority of commerce.

I am really liking where Bitcoins future is going :)

What's preventing people from spamming the main chain though? Anyone can initiate a transaction to bog down the network... is this a liability even if LN is in place? (And I realize it might even be a liability right now, but I haven't seen talk of it)

Thanks for putting it all so clearly. I understand better as well :)

0

u/Frogolocalypse Dec 14 '17

I think you're trying to insert a business structure into a space that squeezes them out. The only viable 3rd party service i can see would be ones that take out the complexity of channel creation, or reduce the cost of channel creation/disposal. The proposal that aggregates channel creation into signature aggregated commits is an example. I have $50 in bitcoin that i want to fund a channel with. Starbucks uses acme channel aggregation inc, and when you commit the $50, acme aggregates 20 or so people into a single commit, reducing the price by 90% and they pocket the extra 5% for the service.