<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-04&#xA;📝 Original message:&#xA;Rusty Russell &lt;rusty at rustcorp.com.au&gt; writes:&#xA;&gt; Bastien TEINTURIER &lt;bastien at acinq.fr&gt; writes:&#xA;&gt;&gt; That&#39;s of course a solution as well. Even with that though, if Alice opens&#xA;&gt;&gt; multiple channels to each of her Bobs,&#xA;&gt;&gt; she should use Tor and a different node_id each time for better privacy.&#xA;&gt;&#xA;&gt; There are two uses for this feature (both of which I started implementing):&#xA;&gt;&#xA;&gt; 1. Simply always use a temporary id when you have a private channel, to&#xA;&gt;    obscure your onchain footprint.  This is a nobrainer.&#xA;&gt;&#xA;&gt; 2. For an extra layer of transience, apply a new temporary id and new&#xA;&gt;    nodeid on every invoice *which applies only for that invoice*.&#xA;&gt;&#xA;&gt; But implementing the latter securely is fraught!&#xA;&gt;&#xA;&gt; Firstly, need to brute-force the onion against your N keys.  Secondly,&#xA;&gt; if you use a temporary key, then you *don&#39;t* end up using the HTLC to&#xA;&gt; pay an invoice matching that key, you *MUST* pretend you couldn&#39;t&#xA;&gt; decrypt the onion!  This applies to all code paths between the two,&#xA;&gt; including parsing the TLV, etc: they must ALL return&#xA;&gt; WIRE_INVALID_ONION_HMAC.&#xA;&gt;&#xA;&gt; Otherwise, Mallory can get an invoice, then send malformed payments to&#xA;&gt; Alice using the transient key in the invoice and see if she decrypts it.&#xA;&#xA;Actually, that was too hasty.  You can use the payment_hash as a&#xA;fastpath:&#xA;&#xA;1. Look up invoice using payment_hash.&#xA;&#xA;2. If there is an invoice, and it has a temporary id associated with it,&#xA;   try using that to decrypt the onion.  If that works, and the onion is&#xA;   on the final hop, and the TLV decodes, and the payment_secret is&#xA;   correct, you can go back and use this temporary key to decrypt the onion.&#xA;   Otherwise, go back and use the normal node key.&#xA;&#xA;That&#39;s still quite a bit of tricky code though...&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>