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