<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:2019-11-05&#xA;📝 Original message:&#xA;Good morning Rusty,&#xA;&#xA;Is this intended to be enforceable onchain if a channel is dropped onchain while a message is being routed?&#xA;By a vague sense of the description, it seems to me, it would require a complicated SCRIPT (or multiple tiny 50-msatoshi UTXOs) to enforce onchain.&#xA;&#xA;Also, it is not exactly clear to me, the mechanism you are proposing in detail.&#xA;Can you give a motivating example, for example in a route from ZmnSCPxj, through Rusty, to my imaginary friend YAIjbOJa (who is not in fact me)?&#xA;&#xA;Regards,&#xA;ZmnSCPxj&#xA;&#xA;&#xA;&gt; Hi all,&#xA;&gt;&#xA;&gt; It&#39;s been widely known that we&#39;re going to have to have up-front&#xA;&gt; payments for msgs eventually, to avoid Type 2 spam (I think of Type 1&#xA;&gt; link-local, Type 2 though multiple nodes, and Type 3 liquidity-using&#xA;&gt; spam).&#xA;&gt;&#xA;&gt; Since both Offers and Joost&#39;s WhatSat are looking at sending&#xA;&gt; messages, it&#39;s time to float actual proposals. I&#39;ve been trying to come&#xA;&gt; up with something for several years now, so thought I&#39;d present the best&#xA;&gt; I&#39;ve got in the hope that others can improve on it.&#xA;&gt;&#xA;&gt; 1.  New feature bit, extended messages, etc.&#xA;&gt; 2.  Adding an HTLC causes a push of a number of msat on&#xA;&gt;     commitment_signed (new field), and a hash.&#xA;&gt;&#xA;&gt; 3.  Failing/succeeding an HTLC returns some of those msat, and a count&#xA;&gt;     and preimage (new fields).&#xA;&gt;&#xA;&gt;     How many msat can you take for forwarding? That depends on you&#xA;&gt;     presenting a series of preimages (which chain into a final hash given in&#xA;&gt;     the HTLC add), which you get by decoding the onion. You get to keep 50&#xA;&gt;     msat[1] per preimage you present[2].&#xA;&gt;&#xA;&gt;     So, how many preimages does the user have to give to have you forward&#xA;&gt;     the payment? That depends. The base rate is 16 preimages, but subtract&#xA;&gt;     one for each leading 4 zero bits of the SHA256(blockhash | hmac) of the&#xA;&gt;     onion. The blockhash is the hash of the block specified in the onion:&#xA;&gt;     reject if it&#39;s not in the last 3 blocks[3].&#xA;&gt;&#xA;&gt;     This simply adds some payment noise, while allowing a hashcash style&#xA;&gt;     tradeoff of sats for work.&#xA;&gt;&#xA;&gt;     The final node gets some variable number of preimages, which adds noise.&#xA;&gt;     It should take all and subtract from the minimum required invoice amount&#xA;&gt;     on success, or take some random number on failure.&#xA;&gt;&#xA;&gt;     This leaks some forward information, and makes an explicit tradeoff for&#xA;&gt;     the sender between amount spent and privacy, but it&#39;s the best I&#39;ve been&#xA;&gt;     able to come up with.&#xA;&gt;&#xA;&gt;     Thoughts?&#xA;&gt;     Rusty.&#xA;&gt;&#xA;&gt;     [1] If we assume $1 per GB, $10k per BTC and 64k messages, we get about&#xA;&gt;     655msat per message. Flat pricing for simplicity; we&#39;re trying to&#xA;&gt;     prevent spam, not create a spam market.&#xA;&gt;     [2] Actually, a number and a single preimage; you can check this is&#xA;&gt;     indeed the n&#39;th preimage.&#xA;&gt;     [3] This reduces incentive to grind the damn things in advance, though&#xA;&gt;     maybe that&#39;s dumb? We can also use a shorter hash (siphash?), or&#xA;&gt;     even truncated SHA256 (128 bits).&#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>