<p>Yes, you must be online. The solution is for Alice to have a server of her own (no need to trust a third-party), either at home or in the cloud (aws, azure), that would keep a record of all her channel transactions and monitor the btc network 24/7 in case the other party closes the channel. This way she can go offline and not worry because the server will do the monitoring for her. No way she can do that only with her cell (IMHO).</p>

CC BY-SA 4.0
2019-03-08T00:58:32.213Z
2019-03-08T00:58:32.213Z
Joao Leme
<p>The lightning network is comprised of bi-directional payment channels between two nodes.  This means that either one of those nodes should be able to initialize a transaction at any time.  These transactions require both parties to be actively participating in updating the smart contracts that keep the channel alive.  If one party fails to respond, they are essentially in violation of the smart contract, and are forfeiting their claim to any of the funds in the channel.</p>

<p>Non-responsive clients are a liability to anyone opening up a channel.  It means that their bitcoin may be tied up in the channel until the timeout period.  That bitcoin was typically put there either to make a payment (which now is delayed), or to earn network fees for being a hub of other people's transactions.  An unresponsive node means the channel is wasted.  It's similar to a denial of service attack, except it's tying up bitcoin rather than bandwidth.</p>

<p>To illustrate how this works, consider that Alice and Bob have each contributed 1BTC to a shared channel.  The entire channel now has a total of 2BTC in it, but it has a cap in each direction.  Because Alice only put in 1BTC, the most that will ever flow from Alice to Bob is 1BTC.  This is the same for total transactions from Bob to Alice.</p>

<p>Let's say that more money has flowed from Alice to Bob during the lifetime of the channel, so that if it were closed right now, Alice would get 0.5BTC, and Bob would get 1.5BTC (excluding fees for simplicity).  Now let's say Bob all of a sudden went offline, leaving the channel useless.</p>

<p>Due to how the smart contracts work, Alice will have a valid bitcoin transaction from earlier, that was signed by Bob, and could close the channel leaving Alice with <em>more</em> than the 0.5BTC she is owed.  Alice can broadcast this transaction to the Bitcoin network, and after a timeout period, will get Bob's rightful money.  The only thing that prevents this, is that Bob will see the transaction propagate on the network, and can submit the final transaction that he has (already signed by Alice) to get his full payment <em>before</em> Alice's transaction is valid.  If Bob isn't paying attention, then Alice can steal what is rightfully his.</p>

<p>Penalizing unresponsive nodes is a feature of the lightning network, intended to keep it functional.  By leaving the channel unattended, Bob is doing Alice a disservice.  Making that behavior financially disastrous is what makes the system work in the first place.</p>

CC BY-SA 3.0
2017-07-06T21:33:13.830Z
Thanks for the well explained answer. What are your thoughts on how everyday users will use the LN network? As I mentioned in the question, I envision LN clients as mobile apps with sporadic connectivity. Would they have to rely on third-parties to commit for them when they're offline - and how much would you have to trust them? I'm thinking users would at least have to trust them to commit transactions in a timely manner to invalidate past transactions, right? This to me seems an awful lot of trust put onto third-parties.
Luca Matteis
CC BY-SA 3.0
2017-07-06T22:04:01.233Z
My guess is that online services will be popular, although there are other options.  Users who just want to pay, and never be paid, can connect to a special bridge node with a one directional channel.  This node would be a third party that forwards payments on to the actual lightning network.  This could still be trustless, yet much safer when it comes to going offline.  Also the timeouts and gaps between timeouts can greatly effect how frequently you have to go online.  All these problems have solutions and mitigations.
Jestin
CC BY-SA 3.0
2017-07-07T08:47:30.867Z
Ok but my main concern is: do you still have to trust these third-parties, or is there a way to mitigate that? And if so, how?
Luca Matteis
CC BY-SA 3.0
2017-07-07T12:22:36.507Z
With services, you always have to trust them with as much money as they are managing on your behalf.  It's like keeping money on an exchange.  If you choose to have the convenience of going offline with open channels, then the 3rd party risk is the price you pay.  This is the same as with any web wallet.  You are trading trustlessness for convenience.
Jestin
CC BY-SA 3.0
2017-07-06T20:09:30.277Z
2017-07-06T20:09:30.277Z
Jestin
<p>I'm thinking of a scenario where users on mobile devices using a LN client will rarely be online.</p>

<p>Let's say Alice opens a channel with Bob and they make 10 LN transactions. After Alice has received the 10th, she goes offline for longer than the channel's lifetime.</p>

<p>So if the channel was setup to last for 3 days, she'll be offline for say, 5 days.</p>

<p>My question is, when Alice comes back online, how does she know whether Bob commited to the blockchain the 10th and not an earlier transaction (which is in favor of Bob).</p>

<p>I understand that if Alice was online she could check this behavior herself, and readily commit the 10th to get her money. But the key point here is that <strong>she's offline longer than the channel's lifetime</strong>.</p>

<p>Is there a solution to this in LN? Because frankly, most users will not have a node that is online 24/7. And also, I don't want to trust a third-party to commit the 10th transaction at the right time -- what if they don't? Who's to say they will also act honestly and not commit an earlier transaction from the channel?</p>

<lightning-network><ln-node-reliability>
Do parties in a Lightning Network channel need to be online?
Luca Matteis
# Do parties in a Lightning Network channel need to be online?

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

I'm thinking of a scenario where users on mobile devices using a LN client will rarely be online.

Let's say Alice opens a channel with Bob and they make 10 LN transactions. After Alice has received the 10th, she goes offline for longer than the channel's lifetime.

So if the channel was setup to last for 3 days, she'll be offline for say, 5 days.

My question is, when Alice comes back online, how does she know whether Bob commited to the blockchain the 10th and not an earlier transaction (which is in favor of Bob).

I understand that if Alice was online she could check this behavior herself, and readily commit the 10th to get her money. But the key point here is that **she's offline longer than the channel's lifetime**.

Is there a solution to this in LN? Because frankly, most users will not have a node that is online 24/7. And also, I don't want to trust a third-party to commit the 10th transaction at the right time -- what if they don't? Who's to say they will also act honestly and not commit an earlier transaction from the channel?

**Tags:** lightning-network, ln-node-reliability


---

## 2 answers

### Answer by username_2 on 2017-07-06. Score: 8 | Accepted answer

The lightning network is comprised of bi-directional payment channels between two nodes. This means that either one of those nodes should be able to initialize a transaction at any time. These transactions require both parties to be actively participating in updating the smart contracts that keep the channel alive. If one party fails to respond, they are essentially in violation of the smart contract, and are forfeiting their claim to any of the funds in the channel.

Non-responsive clients are a liability to anyone opening up a channel. It means that their bitcoin may be tied up in the channel until the timeout period. That bitcoin was typically put there either to make a payment (which now is delayed), or to earn network fees for being a hub of other people's transactions. An unresponsive node means the channel is wasted. It's similar to a denial of service attack, except it's tying up bitcoin rather than bandwidth.

To illustrate how this works, consider that Alice and Bob have each contributed 1BTC to a shared channel. The entire channel now has a total of 2BTC in it, but it has a cap in each direction. Because Alice only put in 1BTC, the most that will ever flow from Alice to Bob is 1BTC. This is the same for total transactions from Bob to Alice.

Let's say that more money has flowed from Alice to Bob during the lifetime of the channel, so that if it were closed right now, Alice would get 0.5BTC, and Bob would get 1.5BTC (excluding fees for simplicity). Now let's say Bob all of a sudden went offline, leaving the channel useless.

Due to how the smart contracts work, Alice will have a valid bitcoin transaction from earlier, that was signed by Bob, and could close the channel leaving Alice with *more* than the 0.5BTC she is owed. Alice can broadcast this transaction to the Bitcoin network, and after a timeout period, will get Bob's rightful money. The only thing that prevents this, is that Bob will see the transaction propagate on the network, and can submit the final transaction that he has (already signed by Alice) to get his full payment *before* Alice's transaction is valid. If Bob isn't paying attention, then Alice can steal what is rightfully his.

Penalizing unresponsive nodes is a feature of the lightning network, intended to keep it functional. By leaving the channel unattended, Bob is doing Alice a disservice. Making that behavior financially disastrous is what makes the system work in the first place.

> **Comments:**
> **username_0**: Thanks for the well explained answer. What are your thoughts on how everyday users will use the LN network? As I mentioned in the question, I envision LN clients as mobile apps with sporadic connectivity. Would they have to rely on third-parties to commit for them when they're offline - and how much would you have to trust them? I'm thinking users would at least have to trust them to commit transactions in a timely manner to invalidate past transactions, right? This to me seems an awful lot of trust put onto third-parties.  
> **username_2**: My guess is that online services will be popular, although there are other options.  Users who just want to pay, and never be paid, can connect to a special bridge node with a one directional channel.  This node would be a third party that forwards payments on to the actual lightning network.  This could still be trustless, yet much safer when it comes to going offline.  Also the timeouts and gaps between timeouts can greatly effect how frequently you have to go online.  All these problems have solutions and mitigations.  
> **username_0**: Ok but my main concern is: do you still have to trust these third-parties, or is there a way to mitigate that? And if so, how?  
> **username_2**: With services, you always have to trust them with as much money as they are managing on your behalf.  It's like keeping money on an exchange.  If you choose to have the convenience of going offline with open channels, then the 3rd party risk is the price you pay.  This is the same as with any web wallet.  You are trading trustlessness for convenience.  

---

### Answer by username_1 on 2019-03-08. Score: 0

Yes, you must be online. The solution is for Alice to have a server of her own (no need to trust a third-party), either at home or in the cloud (aws, azure), that would keep a record of all her channel transactions and monitor the btc network 24/7 in case the other party closes the channel. This way she can go offline and not worry because the server will do the monitoring for her. No way she can do that only with her cell (IMHO).


---

