<p>Question 1 </p>

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

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

<p>Question 2</p>

<blockquote>
  <p>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?</p>
</blockquote>

<p>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.</p>

<p>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:</p>

<pre><code>Charlie &lt;----&gt; Alice &lt;----&gt; Bob &lt;----&gt; Dave
</code></pre>

<p>Because the payments from Dave to Charlie put money <em>back</em> 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 <a href="https://wiki.treasurers.org/wiki/Deferred_net_settlement" rel="nofollow noreferrer">deferred net settlement</a>.</p>

<p>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 <em>negative</em> fee rather than incur the costs of re-opening a channel.</p>

<p>Question 3:</p>

<blockquote>
  <p>"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?</p>
</blockquote>

<p>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.</p>

CC BY-SA 3.0
2017-07-13T18:41:15.607Z
Can you elaborate on "negative fee"?
Richard Ginsberg
CC BY-SA 3.0
2017-07-13T18:51:04.303Z
@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
CC BY-SA 3.0
2017-07-13T14:23:45.297Z
2017-07-13T14:23:45.297Z
Jestin
<p>Jestin's answer does a great job of covering question 1 and 2, but I would like to add that you can use a <em>submarine swap</em> 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.</p>

CC BY-SA 4.0
2020-09-01T23:28:52.600Z
2020-09-01T23:28:52.600Z
Murch
<p>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.</p>

<p><strong>Question 1</strong>: 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?</p>

<p><strong>Question 2</strong>: 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?</p>

<p><strong>Question 3</strong>: 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?</p>

<transaction-fees><lightning-network><submarine-swaps>
The cost of restarting a lightning channel
Erel Segal-Halevi
# The cost of restarting a lightning channel

(Asked by: username_0 on 2017-07-13)

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?

**Tags:** transaction-fees, lightning-network, submarine-swaps


---

## 2 answers

### Answer by username_1 on 2017-07-13. Score: 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.

> **Comments:**
> **username_2**: Can you elaborate on "negative fee"?  
> **username_1**: @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.  

---

### Answer by username_3 on 2020-09-01. Score: 0

username_1'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.


---

