Comment by codedaway on 03/01/2018 at 13:31 UTC

2 upvotes, 3 direct replies (showing 3)

View submission: Lightning Network Megathread

View parent comment

I tried to summarize this the best I could to answer the question in the FAQ section

Source[1] - Not necessarily,

1: https://www.reddit.com/r/Bitcoin/comments/7npeh6/lightning_network_megathread/ds4gkt8/?context=3

Example: A and B have a channel. 1 BTC each. A sends B 0.5 BTC. B sends back 0.25 BTC. Balance should be A = 0.75, B = 0.25. If A gets disconnected, B can publish the first Tx where the balance was A = 0.5 and B = 0.5. If the node B does in fact attempt to cheat by publishing an old state (such as the A=0.5 and B=0.5 state), this cheat can then be detected on-chain and used to steal the cheaters funds, i.e., A can see the closing transaction, notice it's an old one and grab all funds in the channel (A=1, B=0). The time that A has in order to react to the cheating counterparty is given by the **CheckLockTimeVerify (CLTV)** in the cheating transaction, which is adjustable. So if A foresees that it'll be able to check in about once every 24 hours it'll require that the CLTV is at least that large, if it's once a week then that's fine too. **You definitely do not need to be online and watching the chain 24/7, just make sure to check in once in a while before the CLTV expires**. Alternatively you can outsource the watch duties, in order to keep the CLTV timeouts low. This can be achieved both with trusted third parties or untrusted ones (watchtowers). In the case of a unilateral close, e.g., you just go offline and never come back, the other endpoint will have to wait for that timeout to expire to get its funds back. So peers might not accept channels with extremely high CLTV timeouts.

--------------------------------------------------------------------------------

Let me know if there's anything incorrect or something that needs changed.

Replies

Comment by FerriestaPatronum at 03/01/2018 at 16:47 UTC

2 upvotes, 1 direct replies

This looks about right from my understanding. Good job.

Also: holy complicated shitstorm, batman. I'm not sure how laymen (and even programmers) aren't going to mess this up and cost people money.

Comment by dodo_gogo at 03/01/2018 at 15:39 UTC

1 upvotes, 1 direct replies

Can the cheater cheat again after the anticheat steals?

Comment by kauefr at 03/01/2018 at 22:26 UTC

1 upvotes, 1 direct replies

Great post OP, lot of useful info.

A can see the closing transaction, notice it's an old one and grab all funds in the channel

What happens if A's tx is not confirmed fast enough? Such as if the mempool if full or if the cheater's tx pays a large fee? Does A (or the watcher) needs to "race" B's tx on the blockchain?