<oembed><type>rich</type><version>1.0</version><author_name>npub186h7xm74e8dqvz64kzhx8aq3j47lwf3emlxl7w8j0d0thrth65vs9y2s83</author_name><author_url>https://nostr.ae/npub186h7xm74e8dqvz64kzhx8aq3j47lwf3emlxl7w8j0d0thrth65vs9y2s83</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-07-15&#xA;📝 Original message:&#xA;What would happen in 2) if the node has data but the peer returned an&#xA;incorrect state?&#xA;&#xA;On Wed, Jul 14, 2021, 20:13 Christian Decker &lt;decker.christian at gmail.com&gt;&#xA;wrote:&#xA;&#xA;&gt; Not quite sure if this issue is unique to eltoo tbh. While in LN-penalty&#xA;&gt; loss-of-state equates to loss-of-funds, in eltoo this is reduced to&#xA;&gt; impact only funds that are in a PTLC at the time of the loss-of-state.&#xA;&gt;&#xA;&gt; We have a couple of options here, that don&#39;t touch the blockchain, and&#xA;&gt; are therefore rather lightweight:&#xA;&gt;&#xA;&gt;  1) Do nothing and keep the incentive to keep up to date backups. It&#xA;&gt;  still is a reduction in risk w.r.t. LN-penalty, since this is just an&#xA;&gt;  append only log of secrets, and old secrets don&#39;t harm you like&#xA;&gt;  attempting to close with an old commitment would.&#xA;&gt;  2) Use the peer-storage idea, where we deposit an encrypted bundle with&#xA;&gt;  our peers, and which we expect the peers to return. by hiding the fact&#xA;&gt;  that we forgot some state, until the data has been exchanged we can&#xA;&gt;  ensure that peers always return the latest snapshot of whatever we gave&#xA;&gt;  them.&#xA;&gt;&#xA;&gt; The latter is the encrypted-blob idea that Rusty has been proposing for&#xA;&gt; a while now.&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; Christian&#xA;&gt;&#xA;&gt; Anthony Towns &lt;aj at erisian.com.au&gt; writes:&#xA;&gt; &gt; Hello world,&#xA;&gt; &gt;&#xA;&gt; &gt; Suppose you have some payments going from Alice to Bob to Carol with&#xA;&gt; &gt; eltoo channels. Bob&#39;s lightning node crashes, and he recovers from an&#xA;&gt; &gt; old backup, and Alice and Carol end up dropping newer channel states&#xA;&gt; &gt; onto the blockchain.&#xA;&gt; &gt;&#xA;&gt; &gt; Suppose the timeout for the payments is a few hours away, while the&#xA;&gt; &gt; channels have specified a week long CSV delay to rectify any problems&#xA;&gt; &gt; on-chain.&#xA;&gt; &gt;&#xA;&gt; &gt; Then I think that that means that:&#xA;&gt; &gt;&#xA;&gt; &gt;  1) Carol will reveal the point preimages on-chain via adaptor&#xA;&gt; &gt;     signatures, but Bob won&#39;t be able to decode those adaptor signatures&#xA;&gt; &gt;     because those signatures will need to change for each state&#xA;&gt; &gt;&#xA;&gt; &gt;  2) Even if Bob knows the point preimages, he won&#39;t be able to&#xA;&gt; &gt;     claim the PTLC payments on-chain, for the same reason: he needs&#xA;&gt; &gt;     newer adaptor signatures that he&#39;ll have lost with the state update&#xA;&gt; &gt;&#xA;&gt; &gt;  3) For any payments that timeout, Carol doesn&#39;t have any particular&#xA;&gt; &gt;     incentive to make it easy for Bob to claim the refund, and Bob won&#39;t&#xA;&gt; &gt;     have the adaptor signatures for the latest state to do so&#xA;&gt; &gt;&#xA;&gt; &gt;  4) But Alice will be able to claim refunds easily. This is working how&#xA;&gt; &gt;     it&#39;s meant to, at least!&#xA;&gt; &gt;&#xA;&gt; &gt; I think you could fix (3) by giving Carol (who does have all the adaptor&#xA;&gt; &gt; signatures for the latest state) the ability to steal funds that are&#xA;&gt; &gt; meant to have been refunded, provided she gives Bob the option of&#xA;&gt; claiming&#xA;&gt; &gt; them first.&#xA;&gt; &gt;&#xA;&gt; &gt; However fixing (1) and (2) aren&#39;t really going against Alice or Carol&#39;s&#xA;&gt; &gt; interests, so maybe you can just ask: Carol loses nothing by allowing&#xA;&gt; &gt; Bob to claim funds from Alice; and Alice has already indicated that&#xA;&gt; &gt; knowing P is worth more to her than the PTLC&#39;s funds -- otherwise she&#xA;&gt; &gt; wouldn&#39;t have forwarded the PTLC to Bob in the first place.&#xA;&gt; &gt;&#xA;&gt; &gt; Likewise, everyone&#39;s probably incentivised to negotiate cooperative&#xA;&gt; &gt; closes instead of going on-chain -- better privacy, less fees, and less&#xA;&gt; &gt; delay before the funds can be used elsewhere.&#xA;&gt; &gt;&#xA;&gt; &gt; FWIW, I think a similar flaw exists even in the original eltoo spec --&#xA;&gt; &gt; Alice could simply decline to publish the settlement transaction until&#xA;&gt; &gt; the timeout has been reached, preventing Bob from revealing the HTLC&#xA;&gt; &gt; preimage before Alice can claim the refund.&#xA;&gt; &gt;&#xA;&gt; &gt; So I think that adds up to:&#xA;&gt; &gt;&#xA;&gt; &gt;  a) Nodes should share state on reconnection; if you find a node that&#xA;&gt; &gt;     doesn&#39;t do this, close the channel and put the node on your enemies&#xA;&gt; &gt;     list. If you disagree on what the current state is, share your most&#xA;&gt; &gt;     recent state, and if the other guy&#39;s state is more recent, and all&#xA;&gt; &gt;     the signatures verify, update your state to match theirs.&#xA;&gt; &gt;&#xA;&gt; &gt;  b) Always negotiate a mutual/cooperative close if possible, to avoid&#xA;&gt; &gt;     actually using the eltoo protocol on-chain.&#xA;&gt; &gt;&#xA;&gt; &gt;  c) If you want to allow continuing the channel after restoring an old&#xA;&gt; &gt;     state from backup, set the channel state index based on the real&#xA;&gt; time,&#xA;&gt; &gt;     eg (real_time-start_time)*(max_updates_per_second). That way your&#xA;&gt; &gt;     first update after a restore from backup will ensure that any old&#xA;&gt; &gt;     states that your channel partner may not have told you about are&#xA;&gt; &gt;     invalidated.&#xA;&gt; &gt;&#xA;&gt; &gt;  d) Accept that if you lose connectivity to a channel partner, you will&#xA;&gt; &gt;     have to pay any PTLCs that were going to them, and won&#39;t be able&#xA;&gt; &gt;     to claim the PTLCs that were funding them. Perhaps limit the total&#xA;&gt; &gt;     value of inbound PTLCs for forwarding that you&#39;re willing to accept&#xA;&gt; &gt;     at any one itme?&#xA;&gt; &gt;&#xA;&gt; &gt; Also, layered commitments seem like they make channel factories&#xA;&gt; &gt; complicated too. Nobody came up with a way to avoid layered commitments&#xA;&gt; &gt; while I wasn&#39;t watching did they?&#xA;&gt; &gt;&#xA;&gt; &gt; Cheers,&#xA;&gt; &gt; aj&#xA;&gt; &gt; _______________________________________________&#xA;&gt; &gt; Lightning-dev mailing list&#xA;&gt; &gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; &gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt; _______________________________________________&#xA;&gt; Lightning-dev mailing list&#xA;&gt; Lightning-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210715/54d800a3/attachment.html&gt;</html></oembed>