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