<p>It is atomic</p>
<p>If a node goes offline the htlc will not be settled off chain but onchain. of course that is more expensive with respect to fees but that is true for channel closes in any case</p>

CC BY-SA 4.0
2021-05-28T18:39:03.990Z
What happens with the channel update between Chad and David? 

How they know if Bob or other hop goes offline? 

Why they would want to go onchain if they can update they channel state offline?
Grunch
CC BY-SA 4.0
2021-05-29T19:39:49.540Z
Chad and david have settled off chain. Alice can't settle onchain as she did not get the payment secret as bob is offline. Bob looses money but he is offline he has to actively claim the payment. Slice cancled the htlc onchain as the timeout starts to kick in and not resolving the htlc might make her pay Bob later
Rene Pickhardt
CC BY-SA 4.0
2021-05-29T20:58:06.000Z
"Chad and david have settled off chain. Alice can't settle onchain" <== not atomic, correct?
Grunch
CC BY-SA 4.0
2021-05-30T21:03:26.547Z
Yes and no. It is atomic in the sense that a routine node cannot mess up. And make Alice or David loose funds. If the routing node disappeared it might have lost money though as David got Paid but Alice had not to reimburse Bob and cancles the htlc. If Alice goes onchain but Bob appears in time Bob can get reimbursed on chain too.
Rene Pickhardt
CC BY-SA 4.0
2021-05-28T18:36:06.663Z
2021-05-28T18:36:06.663Z
Rene Pickhardt
<p>I have a doubt about HTLC on a lightning network payment. I have this scenario:</p>
<p>Alice wants to pay 100 sats to David using a route she found with Bob and Chad, this would be:</p>
<pre><code>Alice -&gt; Bob -&gt; Chad -&gt; David
</code></pre>
<p>Alices sends the HTLC to Bob, Bob to Chad and Chad to David, everything goes as expected, David wants to reveal the secret to Chad and they update their channel state, now David have +100 sats on his channel balance and Chad have -100 sats.</p>
<p>Chad do the same with Bob and now Chad have +100 sats on his side of the channel and Bob have -100 sats on his side.</p>
<p>At the moment Bob wants to do the same with Alice his node crash and go offline (for days), Alice can wait for the timeout and get her funds back, Bob would lose the funds.</p>
<p>I read before that an HTLC chain was atomic, all payments are successful or none of them, is this true? in this case David and Chad got their payments updating the channel state but not Alice so this case is not atomic.</p>
<p>What I am missing here?</p>

<lightning-network><hash-time-locked-contract>
Atomicity on HTLC payment chain
Grunch
# Atomicity on HTLC payment chain

(Asked by: username_0 on 2021-05-28)

I have a doubt about HTLC on a lightning network payment. I have this scenario:
Alice wants to pay 100 sats to David using a route she found with Bob and Chad, this would be:
Alice -> Bob -> Chad -> David

Alices sends the HTLC to Bob, Bob to Chad and Chad to David, everything goes as expected, David wants to reveal the secret to Chad and they update their channel state, now David have +100 sats on his channel balance and Chad have -100 sats.
Chad do the same with Bob and now Chad have +100 sats on his side of the channel and Bob have -100 sats on his side.
At the moment Bob wants to do the same with Alice his node crash and go offline (for days), Alice can wait for the timeout and get her funds back, Bob would lose the funds.
I read before that an HTLC chain was atomic, all payments are successful or none of them, is this true? in this case David and Chad got their payments updating the channel state but not Alice so this case is not atomic.
What I am missing here?

**Tags:** lightning-network, hash-time-locked-contract


---

## 1 answers

### Answer by username_1 on 2021-05-28. Score: 1

It is atomic

If a node goes offline the htlc will not be settled off chain but onchain. of course that is more expensive with respect to fees but that is true for channel closes in any case

> **Comments:**
> **username_0**: What happens with the channel update between Chad and David?   How they know if Bob or other hop goes offline?   Why they would want to go onchain if they can update they channel state offline?  
> **username_1**: Chad and david have settled off chain. Alice can't settle onchain as she did not get the payment secret as bob is offline. Bob looses money but he is offline he has to actively claim the payment. Slice cancled the htlc onchain as the timeout starts to kick in and not resolving the htlc might make her pay Bob later  
> **username_0**: "Chad and david have settled off chain. Alice can't settle onchain" <== not atomic, correct?  
> **username_1**: Yes and no. It is atomic in the sense that a routine node cannot mess up. And make Alice or David loose funds. If the routing node disappeared it might have lost money though as David got Paid but Alice had not to reimburse Bob and cancles the htlc. If Alice goes onchain but Bob appears in time Bob can get reimbursed on chain too.  

---

