Rusty Russell [ARCHIVE] on Nostr: 📅 Original date posted:2020-02-04 📝 Original message: Rusty Russell <rusty at ...
📅 Original date posted:2020-02-04
📝 Original message:
Rusty Russell <rusty at rustcorp.com.au> writes:
> Bastien TEINTURIER <bastien at acinq.fr> writes:
>> That's of course a solution as well. Even with that though, if Alice opens
>> multiple channels to each of her Bobs,
>> she should use Tor and a different node_id each time for better privacy.
>
> There are two uses for this feature (both of which I started implementing):
>
> 1. Simply always use a temporary id when you have a private channel, to
> obscure your onchain footprint. This is a nobrainer.
>
> 2. For an extra layer of transience, apply a new temporary id and new
> nodeid on every invoice *which applies only for that invoice*.
>
> But implementing the latter securely is fraught!
>
> Firstly, need to brute-force the onion against your N keys. Secondly,
> if you use a temporary key, then you *don't* end up using the HTLC to
> pay an invoice matching that key, you *MUST* pretend you couldn't
> decrypt the onion! This applies to all code paths between the two,
> including parsing the TLV, etc: they must ALL return
> WIRE_INVALID_ONION_HMAC.
>
> Otherwise, Mallory can get an invoice, then send malformed payments to
> Alice using the transient key in the invoice and see if she decrypts it.
Actually, that was too hasty. You can use the payment_hash as a
fastpath:
1. Look up invoice using payment_hash.
2. If there is an invoice, and it has a temporary id associated with it,
try using that to decrypt the onion. If that works, and the onion is
on the final hop, and the TLV decodes, and the payment_secret is
correct, you can go back and use this temporary key to decrypt the onion.
Otherwise, go back and use the normal node key.
That's still quite a bit of tricky code though...
Cheers,
Rusty.
Published at
2023-06-09 12:58:33Event JSON
{
"id": "e9ee00ef7c43f55de4b8cea6fa6165d1390193cfb6b5690c3a4cbc7a28520285",
"pubkey": "13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425",
"created_at": 1686315513,
"kind": 1,
"tags": [
[
"e",
"3ed35742512a6038c8a47910d5915af4fefd8766015db6ab01e4ef19d4ac6fff",
"",
"root"
],
[
"e",
"d41610f23f17847fb2730a3699fbbb7faad9cb79407ce468bc0f55d49144d043",
"",
"reply"
],
[
"p",
"13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425"
]
],
"content": "📅 Original date posted:2020-02-04\n📝 Original message:\nRusty Russell \u003crusty at rustcorp.com.au\u003e writes:\n\u003e Bastien TEINTURIER \u003cbastien at acinq.fr\u003e writes:\n\u003e\u003e That's of course a solution as well. Even with that though, if Alice opens\n\u003e\u003e multiple channels to each of her Bobs,\n\u003e\u003e she should use Tor and a different node_id each time for better privacy.\n\u003e\n\u003e There are two uses for this feature (both of which I started implementing):\n\u003e\n\u003e 1. Simply always use a temporary id when you have a private channel, to\n\u003e obscure your onchain footprint. This is a nobrainer.\n\u003e\n\u003e 2. For an extra layer of transience, apply a new temporary id and new\n\u003e nodeid on every invoice *which applies only for that invoice*.\n\u003e\n\u003e But implementing the latter securely is fraught!\n\u003e\n\u003e Firstly, need to brute-force the onion against your N keys. Secondly,\n\u003e if you use a temporary key, then you *don't* end up using the HTLC to\n\u003e pay an invoice matching that key, you *MUST* pretend you couldn't\n\u003e decrypt the onion! This applies to all code paths between the two,\n\u003e including parsing the TLV, etc: they must ALL return\n\u003e WIRE_INVALID_ONION_HMAC.\n\u003e\n\u003e Otherwise, Mallory can get an invoice, then send malformed payments to\n\u003e Alice using the transient key in the invoice and see if she decrypts it.\n\nActually, that was too hasty. You can use the payment_hash as a\nfastpath:\n\n1. Look up invoice using payment_hash.\n\n2. If there is an invoice, and it has a temporary id associated with it,\n try using that to decrypt the onion. If that works, and the onion is\n on the final hop, and the TLV decodes, and the payment_secret is\n correct, you can go back and use this temporary key to decrypt the onion.\n Otherwise, go back and use the normal node key.\n\nThat's still quite a bit of tricky code though...\n\nCheers,\nRusty.",
"sig": "86edb2d7a8fe7fd2fd5a33f0727689f4e89da198abb603ce89a20aad0381c872d78e150b13626beb28041fd0a058e3fb2f5fe7617b8f15317f276b4963604792"
}