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