<oembed><type>rich</type><version>1.0</version><title>Rusty Russell [ARCHIVE] wrote</title><author_name>Rusty Russell [ARCHIVE] (npub1zw…hkhpx)</author_name><author_url>https://yabu.me/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2020-02-24&#xA;📝 Original message:&#xA;Anthony Towns &lt;aj at erisian.com.au&gt; writes:&#xA;&gt; On Fri, Feb 21, 2020 at 12:35:20PM +1030, Rusty Russell wrote:&#xA;&gt;&gt; And if there is a grace period, I can just gum up the network with lots&#xA;&gt;&gt; of slow-but-not-slow-enough HTLCs.&#xA;&gt;&#xA;&gt; Well, it reduces the &#34;gum up the network for &lt;timeout&gt; blocks&#34; to &#34;gum&#xA;&gt; up the network for &lt;grace period&gt; seconds&#34;, which seems like a pretty&#xA;&gt; big win. I think if you had 20 hops each with a 1 minute grace period,&#xA;&gt; and each channel had a max_accepted_htlcs of 30, you&#39;d need 25 HTLCs per&#xA;&gt; second to block 1000 channels (so 2.7% of the 36k channels 1ml reports),&#xA;&gt; so at the very least, successfully performing this attack would be&#xA;&gt; demonstrating lightning&#39;s solved bitcoin&#39;s transactions-per-second&#xA;&gt; limitation?&#xA;&#xA;But the comparison here is not with the current state, but with the&#xA;&#34;best previous proposal we have&#34;, which is:&#xA;&#xA;1. Charge an up-front fee for accepting any HTLC.&#xA;2. Will hang-up after grace period unless you either prove a channel&#xA;   close, or gain another grace period by decrypting onion.&#xA;&#xA;(There was is an obvious extension to this, where you pay another HTLC&#xA;first which covers the (larger) up-front fee for the &#34;I know the next&#xA;HTLC is going to take a long time&#34;).&#xA;&#xA;That proposal is simpler, and covers this case quite nicely.&#xA;&#xA;&gt; at which point the best B can do is unilaterally close the B/C channel&#xA;&gt; with their pre-HTLC commitment, but they still have to wait for that to&#xA;&gt; confirm before they can safely cancel the HTLC with A, and that will&#xA;&gt; likely take more than whatever the grace period is, so B will be losing&#xA;&gt; money on holding fees.&#xA;&gt;&#xA;&gt; Whereas:&#xA;&gt;&#xA;&gt;   A-&gt;B: here&#39;s a HTLC, locked in&#xA;&gt;&#xA;&gt;   B-&gt;C: HTLC proposal&#xA;&gt;   C-&gt;B: sure: updated commitment with HTLC locked in&#xA;&gt;   B-&gt;C: great, corresponding updated commitment, plus revocation&#xA;&gt;   C-&gt;B: revocation&#xA;&gt;&#xA;&gt; means that if C goes silent before B receives a new commitment, B can&#xA;&gt; cancel the HTLC with A with no risk (B can publish the old commitment&#xA;&gt; still even if the new arrives later, and C can only publish the pre-HTLC&#xA;&gt; commitment), and if C goes silent after B receives the new commitment, B&#xA;&gt; can drop the new commitment to the blockchain and pay A&#39;s fees out of it.&#xA;&#xA;Interesting; this adds a trip, but not in latency (since C can still&#xA;count on the HTLC being locked in at step 3).&#xA;&#xA;I don&#39;t see how it helps B though?  It still ends up paying A, and C&#xA;doesn&#39;t pay anything?&#xA;&#xA;It forces a liveness check of C, but TBH I dread rewriting the state&#xA;machine for this when we can just ping like we do now.&#xA;&#xA;&gt;&gt; There&#39;s an old proposal to fast-fail HTLCs: Bob sends an new message &#34;I&#xA;&gt;&gt; would fail this HTLC once it&#39;s committed, here&#39;s the error&#34; &#xA;&gt;&#xA;&gt; Yeah, you could do &#34;B-&gt;C: proposal, C-&gt;B: no way!&#34; instead of &#34;sure&#34; to&#xA;&gt; fast fail the above too. &#xA;&gt;&#xA;&gt; And I think something like that&#39;s necessary (at least with my view of how&#xA;&gt; this &#34;keep the HTLC open&#34; payment would work), otherwise B could send C a&#xA;&gt; &#34;1 microsecond grace period, rate of 3e11 msat/minute, HTLC for 100 sat,&#xA;&gt; timeout of 2016 blocks&#34; and if C couldn&#39;t reject it immediately would&#xA;&gt; owe B 50c per millisecond it took to cancel.&#xA;&#xA;Well, surely grace period (and penalty rate) are either fixed in the&#xA;protocol or negotiated up-front, not per-HTLC.&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>