Anthony Towns [ARCHIVE] on Nostr: 📅 Original date posted:2020-02-20 📝 Original message: On Tue, Feb 18, 2020 at ...
📅 Original date posted:2020-02-20
📝 Original message:
On Tue, Feb 18, 2020 at 10:23:29AM +0100, Joost Jager wrote:
> A different way of mitigating this is to reverse the direction in which the
> bond is paid. So instead of paying to offer an htlc, nodes need to pay to
> receive an htlc. This sounds counterintuitive, but for the described jamming
> attack there is also an attacker node at the end of the route. The attacker
> still pays.
I think this makes a lot of sense. I think the way it would end up working
is that the further the route extends, the greater the payments are, so:
A -> B : B sends A 1msat per minute
A -> B -> C : C sends B 2msat per minute, B forwards 1msat/min to A
A -> B -> C -> D : D sends C 3 msat, etc
A -> B -> C -> D -> E : E sends D 4 msat, etc
so each node is receiving +1 msat/minute, except for the last one, who's
paying n msat/minute, where n is the number of hops to have gotten up to
the last one. There's the obvious privacy issue there, with fairly
obvious ways to fudge around it, I think.
But that's rational, because that last node can either (a) collect the
payment, covering their cost; or (b) forward the payment, at which point
they'll start collecting funds rather than paying them; or (c) cancel
the payment releasing all the locked up funds all the way back.
I think it might make sense for the payments to have a grace period --
ie, "if you keep this payment open longer than 20 seconds, you have to
start paying me x msat/minute, but if it fulfills or cancels before
then, it's all good".
I'm not sure if there needs to be any enforcement for this beyond "this
peer isn't obeying the protocol, so I'm going to close the channel"; not
even sure it's something that needs to be negotiated as part of payment
routing -- it could just be something each peer does for HTLCs on their
channels? If that can be made to work, it doesn't need much crypto or
bitcoin consensus changes, or even much deployment coordination, all of
which would be awesome.
I think at $10k/BTC then 1msat is about the fair price for locking up $5
worth of BTC (so 50k sat) for 1 minute at a 1% pa interest rate, fwiw.
Maybe this opens up some sort of an attack where a peer lies about the
time to make the "per minute" go faster, but if msats-per-minute is the
units, not sure that really matters.
Maybe this also implies a different protocol for HTLC forwarding,
something like:
1. A sends the HTLC onion packet to B
2. B decrypts it, makes sure it makes sense
3. B sends a half-signed updated channel state back to A
4. A accepts it, and forwards the other half-signed channel update to B
so that at any point before (4) Alice can say "this is taking too long,
I'll start losing money" and safely abort the HTLC she was forwarding to
Bob to avoid paying fees; while only after (4) can she start the time on
expecting Bob to start paying fees that she'll forward back. That means
1.5 round-trips before Bob can really forward the HTLC on to Carol;
but maybe it's parallelisable, so Bob/Carol could start at (1) as soon
as Alice/Bob has finished (2).
Cheers
aj
Published at
2023-06-09 12:58:56Event JSON
{
"id": "3a649efd6b89fe05fee6679ab6f43f901ea83e4df5b5654742a84580d91a4060",
"pubkey": "f0feda6ad58ea9f486e469f87b3b9996494363a26982b864667c5d8acb0542ab",
"created_at": 1686315536,
"kind": 1,
"tags": [
[
"e",
"45cf63b0d2d71c68e5ad79035b26c58f0d0a7f08c912c1e3fb49d13bc9edb573",
"",
"root"
],
[
"e",
"7e5ede9339defd45ff36827bd3a300c1730364ec1af5d5fd9a86612d001a1f3e",
"",
"reply"
],
[
"p",
"ec3fb08b335b94aace30d13181f2ad0280df9bc34f1a99832c4e2da8fb125eb3"
]
],
"content": "📅 Original date posted:2020-02-20\n📝 Original message:\nOn Tue, Feb 18, 2020 at 10:23:29AM +0100, Joost Jager wrote:\n\u003e A different way of mitigating this is to reverse the direction in which the\n\u003e bond is paid. So instead of paying to offer an htlc, nodes need to pay to\n\u003e receive an htlc. This sounds counterintuitive, but for the described jamming\n\u003e attack there is also an attacker node at the end of the route. The attacker\n\u003e still pays.\n\nI think this makes a lot of sense. I think the way it would end up working\nis that the further the route extends, the greater the payments are, so:\n\n A -\u003e B : B sends A 1msat per minute\n A -\u003e B -\u003e C : C sends B 2msat per minute, B forwards 1msat/min to A\n A -\u003e B -\u003e C -\u003e D : D sends C 3 msat, etc\n A -\u003e B -\u003e C -\u003e D -\u003e E : E sends D 4 msat, etc\n\nso each node is receiving +1 msat/minute, except for the last one, who's\npaying n msat/minute, where n is the number of hops to have gotten up to\nthe last one. There's the obvious privacy issue there, with fairly\nobvious ways to fudge around it, I think.\n\nBut that's rational, because that last node can either (a) collect the\npayment, covering their cost; or (b) forward the payment, at which point\nthey'll start collecting funds rather than paying them; or (c) cancel\nthe payment releasing all the locked up funds all the way back.\n\nI think it might make sense for the payments to have a grace period --\nie, \"if you keep this payment open longer than 20 seconds, you have to\nstart paying me x msat/minute, but if it fulfills or cancels before\nthen, it's all good\".\n\nI'm not sure if there needs to be any enforcement for this beyond \"this\npeer isn't obeying the protocol, so I'm going to close the channel\"; not\neven sure it's something that needs to be negotiated as part of payment\nrouting -- it could just be something each peer does for HTLCs on their\nchannels? If that can be made to work, it doesn't need much crypto or\nbitcoin consensus changes, or even much deployment coordination, all of\nwhich would be awesome.\n\nI think at $10k/BTC then 1msat is about the fair price for locking up $5\nworth of BTC (so 50k sat) for 1 minute at a 1% pa interest rate, fwiw.\n\nMaybe this opens up some sort of an attack where a peer lies about the\ntime to make the \"per minute\" go faster, but if msats-per-minute is the\nunits, not sure that really matters.\n\nMaybe this also implies a different protocol for HTLC forwarding,\nsomething like:\n\n 1. A sends the HTLC onion packet to B\n 2. B decrypts it, makes sure it makes sense\n 3. B sends a half-signed updated channel state back to A\n 4. A accepts it, and forwards the other half-signed channel update to B\n\nso that at any point before (4) Alice can say \"this is taking too long,\nI'll start losing money\" and safely abort the HTLC she was forwarding to\nBob to avoid paying fees; while only after (4) can she start the time on\nexpecting Bob to start paying fees that she'll forward back. That means\n1.5 round-trips before Bob can really forward the HTLC on to Carol;\nbut maybe it's parallelisable, so Bob/Carol could start at (1) as soon\nas Alice/Bob has finished (2).\n\nCheers\naj",
"sig": "8416db8ed19c58ba97ce6c8c6929031b7956e599b5dde81a72feb115f8ccbf0f0e45192e133fbab14d87766b25e8cf6762e57f1556a52429bd740339f56caebd"
}