<oembed><type>rich</type><version>1.0</version><title>Anthony Towns [ARCHIVE] wrote</title><author_name>Anthony Towns [ARCHIVE] (npub17r…x9l2h)</author_name><author_url>https://yabu.me/npub17rld56k4365lfphyd8u8kwuejey5xcazdxptserx03wc4jc9g24stx9l2h</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-02-20&#xA;📝 Original message:&#xA;On Tue, Feb 18, 2020 at 10:23:29AM +0100, Joost Jager wrote:&#xA;&gt; A different way of mitigating this is to reverse the direction in which the&#xA;&gt; bond is paid. So instead of paying to offer an htlc, nodes need to pay to&#xA;&gt; receive an htlc. This sounds counterintuitive, but for the described jamming&#xA;&gt; attack there is also an attacker node at the end of the route. The attacker&#xA;&gt; still pays.&#xA;&#xA;I think this makes a lot of sense. I think the way it would end up working&#xA;is that the further the route extends, the greater the payments are, so:&#xA;&#xA;  A -&gt; B   : B sends A 1msat per minute&#xA;  A -&gt; B -&gt; C : C sends B 2msat per minute, B forwards 1msat/min to A&#xA;  A -&gt; B -&gt; C -&gt; D : D sends C 3 msat, etc&#xA;  A -&gt; B -&gt; C -&gt; D -&gt; E : E sends D 4 msat, etc&#xA;&#xA;so each node is receiving +1 msat/minute, except for the last one, who&#39;s&#xA;paying n msat/minute, where n is the number of hops to have gotten up to&#xA;the last one. There&#39;s the obvious privacy issue there, with fairly&#xA;obvious ways to fudge around it, I think.&#xA;&#xA;But that&#39;s rational, because that last node can either (a) collect the&#xA;payment, covering their cost; or (b) forward the payment, at which point&#xA;they&#39;ll start collecting funds rather than paying them; or (c) cancel&#xA;the payment releasing all the locked up funds all the way back.&#xA;&#xA;I think it might make sense for the payments to have a grace period --&#xA;ie, &#34;if you keep this payment open longer than 20 seconds, you have to&#xA;start paying me x msat/minute, but if it fulfills or cancels before&#xA;then, it&#39;s all good&#34;.&#xA;&#xA;I&#39;m not sure if there needs to be any enforcement for this beyond &#34;this&#xA;peer isn&#39;t obeying the protocol, so I&#39;m going to close the channel&#34;; not&#xA;even sure it&#39;s something that needs to be negotiated as part of payment&#xA;routing -- it could just be something each peer does for HTLCs on their&#xA;channels? If that can be made to work, it doesn&#39;t need much crypto or&#xA;bitcoin consensus changes, or even much deployment coordination, all of&#xA;which would be awesome.&#xA;&#xA;I think at $10k/BTC then 1msat is about the fair price for locking up $5&#xA;worth of BTC (so 50k sat) for 1 minute at a 1% pa interest rate, fwiw.&#xA;&#xA;Maybe this opens up some sort of an attack where a peer lies about the&#xA;time to make the &#34;per minute&#34; go faster, but if msats-per-minute is the&#xA;units, not sure that really matters.&#xA;&#xA;Maybe this also implies a different protocol for HTLC forwarding,&#xA;something like:&#xA;&#xA;  1. A sends the HTLC onion packet to B&#xA;  2. B decrypts it, makes sure it makes sense&#xA;  3. B sends a half-signed updated channel state back to A&#xA;  4. A accepts it, and forwards the other half-signed channel update to B&#xA;&#xA;so that at any point before (4) Alice can say &#34;this is taking too long,&#xA;I&#39;ll start losing money&#34; and safely abort the HTLC she was forwarding to&#xA;Bob to avoid paying fees; while only after (4) can she start the time on&#xA;expecting Bob to start paying fees that she&#39;ll forward back. That means&#xA;1.5 round-trips before Bob can really forward the HTLC on to Carol;&#xA;but maybe it&#39;s parallelisable, so Bob/Carol could start at (1) as soon&#xA;as Alice/Bob has finished (2).&#xA;&#xA;Cheers&#xA;aj</html></oembed>