3

I have some questions about the cost of maintaining a lightning channel between two people. For this question, let's assume that the blockchain mining fee is $1 per transaction.

Question 1: Suppose Alice wants to send Bob 1 mBTC per day, for 100 days. Without lightning, this would have cost $100. With lightning, she has to open a channel to Bob, and after 100 days, close the channel. Is it true that opening the channel and closing the channel each costs $1, so that the total cost is $2?

Question 2: Suppose Alice wants to send Bob 1 mBTC per day, for 200 days, but, she does not have all 200 mBTC now - she only has 100 mBTC (she will get the additional 100 mBTC after 100 days). So, she has to open a channel to Bob, after 100 days close the channel, open a new channel, and after additional 100 days, close the second channel. Is it true that the total cost now is $4?

Question 3: Suppose Alice from question 2 wants to reduce the cost of channel restart, so she says to Bob: "Instead of closing and re-opening the channel, I'll send you 100 mBTC through the blockchain, and you will send me 100 mBTC through the lightning channel. So the restart will only cost us $1 and the total cost will be only $3". Can this trick be done securely, so that neither Alice nor Bob can cheat?

2 Answers 2

3

Question 1

Is it true that opening the channel and closing the channel each costs $1, so that the total cost is $2?

Yes. You will still need opening and closing transactions for the channel, and will have to pay the network fee for each transaction.

Question 2

So, she has to open a channel to Bob, after 100 days close the channel, open a new channel, and after additional 100 days, close the second channel. Is it true that the total cost now is $4?

Maybe. If you were talking about a single direction payment channel, the answer would be yes, but lightning channels are bi-directional. A channel only has so much money in it to begin with. In your situations, we are assuming that Alice is fronting all upfront money for the channel, but this doesn't have to be. It could just as easily be both Alice and Bob who split the funds that are tied up in their channel. Let's say they both put 100 mBTC into opening the channel. Now the most that can ever travel in either direction is 100 mBTC, so if money only ever flows from Alice to Bob, then a new channel will have to be opened when Alice's upfront money is all sent.

What you have forgotten is that in the lightning network, Alice and Bob aren't just terminal nodes...they are also hubs. Other transactions from other parties can be routed over their channel. So let's say that during this time period, Dave wants to pay Charlie. Dave has a channel with Bob, and Charlie has a channel with Alice. Now our network looks like this:

Charlie <----> Alice <----> Bob <----> Dave

Because the payments from Dave to Charlie put money back on Alice's side of the channel, Alice could very well pay Bob the full 200 mBTC without having to close and re-open the channel. This is effectively how the traditional banking system clears transactions using deferred net settlement.

It's also important to note that if the channel is getting lopsided, Alice and Bob can incentivize routing in one direction by lowering the fee they charge to use their channel. As you can see, it is often even in their best interest to charge a negative fee rather than incur the costs of re-opening a channel.

Question 3:

"Instead of closing and re-opening the channel, I'll send you 100 mBTC through the blockchain, and you will send me 100 mBTC through the lightning channel. So the restart will only cost us $1 and the total cost will be only $3". Can this trick be done securely, so that neither Alice nor Bob can cheat?

Hopefully, you could avoid this situation as illustrated above. If not, it sounds like Alice and Bob will have to have either 1) trust in each other, or 2) have some other sort of smart contract in place (which would likely lead to even more transaction fees, not less). I don't see this as a viable or cost effective solution. It would be best to incentivize others to use the channel to restore funds on Alice's side of the channel.

2
  • Can you elaborate on "negative fee"? Jul 13, 2017 at 18:41
  • @Richard, it sounds crazy, but it means the channel paying someone for their traffic. Let's say Dave wants to pay Charlie 50 mBTC. The Alice-Bob channel's current state (if they were to close it now) has 10 mBtc owned by Alice, and 90 mBtc owned by Bob. If Alice still has 30 mBTC she wants to pay to Bob, they may agree to cover part of Dave's payment, just so he'll use their channel. Dave now pays 49 mBTC, Charlie receives 50 mBTC, and the channel is now split Alice-60, Bob-40. The difference likely came from Alice's channel with Charlie, and Alice can now finish paying Bob.
    – Jestin
    Jul 13, 2017 at 18:51
0

Jestin's answer does a great job of covering question 1 and 2, but I would like to add that you can use a submarine swap to tie a payment on Lightning Network (LN) to an on-chain payment. Submarine swaps make use of a smart contract in the on-chain payment that becomes valid in conjunction with the secret from a LN invoice. This smart contract is similar to the HTLCs used in multi-hop LN payments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.