<oembed><type>rich</type><version>1.0</version><author_name>npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_name><author_url>https://nostr.ae/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-02-10&#xA;📝 Original message:&#xA;Bastien TEINTURIER &lt;bastien at acinq.fr&gt; writes:&#xA;&gt;&gt; But Mallory can do the same attack, I think.  Just include the P_I from&#xA;&gt;&gt; the wrong invoice for Bob.&#xA;&gt;&#xA;&gt; Good catch, that&#39;s true, thanks for keeping me honest there! In that case&#xA;&gt; my proposal&#xA;&gt; would need the same mitigation as yours, Bob will need to include the&#xA;&gt; `scid` he received&#xA;&gt; in `update_add_htlc` (this is in fact not that hard once we allow TLV&#xA;&gt; extensions on every&#xA;&gt; message).&#xA;&#xA;Yes, I&#39;ve added this to the PR.  Which gives a new validation path, I&#xA;think:&#xA;&#xA;## Figuring out what nodeid to use to decode onion&#xA;&#xA;1. Look up scid from HTLC; if it didn&#39;t include one, use default.&#xA;2. Look up payment_hash; if no invoice is found, use default.&#xA;3. If invoice specified this scid, get nodeid and use that.&#xA;4. ... and refuse to forward the HTLC (it must terminate here).&#xA;&#xA;My plan is to add an argument to `invoice` which is an array of one or&#xA;more scids: we get a temporary scids for each peer and use them in the&#xA;routehints.  We also assign a random temporary nodeid to that invoice.&#xA;&#xA;The above algo is designed to ensure we behave like any other node which&#xA;has no idea about this nodeid if Mallory:&#xA;&#xA;1. tries to use a temporary node id on a normal channel to us.&#xA;2. tries to pay another invoice using this temporary node id.&#xA;3. tries to probe our outgoing channels using this routing hint&#xA;   (I think we should probably ban forwarding to private channels,&#xA;   too, for similar reasons).&#xA;&#xA;---&#xA;&#xA;Note that with any self-assigned SCID schemes, Alice has to respond to&#xA;unknown scids in update_add_htlc with some BADONION code (which makes&#xA;*Bob* give Carol an error response, since Alice can&#39;t without revealing&#xA;her identity).&#xA;&#xA;With Bob-assigned SCIDs, Alice simply needs to make him unallocate&#xA;it before forgetting the invoice, so she will simply never see old&#xA;invoices.&#xA;&#xA;(All these schemes give limited privacy, of course: Bob knows who Alice&#xA;is, and fingerprinting and liveness attacks are always possible).&#xA;&#xA;&gt; I&#39;m extremely nervous about custodial lightning services restricting&#xA;&gt;&gt; what they will pay to.  This is not theoretical: they will come under&#xA;&gt;&gt; immense KYC pressure in the near future, which means they cannot pay&#xA;&gt;&gt; arbitrary invoices.&#xA;1&gt;&gt;&#xA;&gt;&#xA;&gt; That&#39;s a very good point, thanks for raising this. However I believe that&#xA;&gt; there are (and will be) enough&#xA;&gt; non-custodial wallets to let motivated users pay whatever they want. Users&#xA;&gt; can even run their own&#xA;&gt; node to pay such invoices if needed.&#xA;&#xA;Not if ln_strike (no, the other one!) is the future.&#xA;&#xA;&gt; If you are using a custodial wallet and KYC pressure kicks in, then&#xA;&gt; regardless of that feature law may&#xA;&gt; require users to completely reveal who they are paying, so even normal&#xA;&gt; payments wouldn&#39;t protect&#xA;&gt; them, don&#39;t you think? Regulation could for example disallow paying via&#xA;&gt; unannounced channels entirely&#xA;&gt; (or require you to show the funding tx associated to your unannounced&#xA;&gt; channel).&#xA;&#xA;Actually, as long as the same method is required for both normal private&#xA;channels (which will all use non-tx-based short_channel_ids in the near&#xA;future I hope!), I don&#39;t really mind.  I expect such payments to become&#xA;significant, and as long as paying to a temporary id and paying to a&#xA;private channel looks identical, it&#39;s too draconian to ban.  A business&#xA;would probably meet any KYC requirements by simply asking the user&#xA;(perhaps over a certain amount, etc).&#xA;&#xA;(I&#39;ve put my implementation on hold for a moment while I&#39;m supposed to&#xA;be releasing 0.8.1-rc1 RSN!)&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>