ZmnSCPxj [ARCHIVE] on Nostr: š
Original date posted:2021-05-23 š Original message: Good morning list, Note ...
š
Original date posted:2021-05-23
š Original message:
Good morning list,
Note that there is a possible jamming attack here.
More specifically, when "failing" an incoming HTLC, the receiver of the HTLC sends its signature for a transaction spending the HTLC and spending it back to the sender revocable contract.
The funds cannot be reused until the channel state is updated to cut-through all the transactions (the HTLC transaction and the failure transaction).
(Well it *could* but that greatly amps the complexity of the whole thing --- no, just no.)
Thus I could jam a particular receiver by sending, via forwarding nodes, to that receiver, payments with a random hash, which with high probability have preimages that are unknown by the receiver.
The receiver can only fail those HTLCs, but "to fail an HTLC" under Fast Forwards makes the funds unusable, until the previous channel state can be revoked and replaced with a new one.
But updating the channel state requires privkeys to be online in order to create the signatures for the new channel state.
This creates a practical limit on how long you can keep privkeys offline; if you keep it offline too long, an attacker can jam all your incoming capacity for long periods of time.
This is not currently a problem without "receiver online, privkey offline", since without "privkey offline" case, the receiver can update the channel state immediately.
However, if the receiver is willing to lose privacy, the protocol can be mildly modified so that the receiver tells the forwarding node to *first* ask the receiver about every HTLC hash before actually instantiating and sending the HTLC.
Only if the receiver agrees will the forwarder actually send the HTLC.
The forwarder is incentivized to go along with this, as otherwise, the receiver cannot actually fail any HTLCs --- it needs to provide a signature, and signatures require privkeys, and the receiver has those offline.
Thus, the forwarder would prefer to ask the receiver *before* it instantiates the HTLC, as otherwise the HTLC cannot be cancelled until the receiver gets its privkeys online, which can take a long time --- and if the HTLC times out in the meantime, that can only be enforced by dropping onchain, and Fast Forwards are *very* expensive in the unilateral close case.
Obviously this tells the forwarding node that the channel is used for receiving and that any payments over it terminate at the next hop, thus a privacy degradation.
On the other hand, unpublished channels remain popular despite my best efforts, and this is the exact problem unpublished channels have, so ---- not a degradation in privacy in practice, since users of unpublished channels already have degraded privacy (axiom of terminus),
This also increases latency once again, as there is now 1.5 roundtrips (forwarder asks receiver if this forwarded HTLC is kosher, receiver responds, forwarder sends signature to HTLC transaction).
However, the increased latency only occurs at the endpoint; forwarders (which need to have privkeys online 100% of the time anyway, and can thus cut-through any number of failed HTLCs at any time) can skip the "is this HTLC kosher" message and just send the HTLC signatures immediately.
Thus, this may be an acceptable tradeoff.
Thus, one might consider this scheme to be usable for *either* Fast Forwards, *or* "receiver online, privkeys offline", but not usefully both (after all, a forwarder is both a receiver and a sender, and a sender needs its keys in order to send, so it cannot use the "privkeys offline" feature anyway).
It may be difficult to understand this, so maybe I will make a convenient presentation of some sort.
Regards,
ZmnSCPxj
Published at
2023-06-09 13:02:28Event JSON
{
"id": "70c9b3571c0ded08721c84a0d8e744afb36d42667109863cf97235a7d254432b",
"pubkey": "4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861",
"created_at": 1686315748,
"kind": 1,
"tags": [
[
"e",
"06e34eda5a8a0c7de05c6d7fb765c1b1b6244f4127232ba197792f82a60b593c",
"",
"root"
],
[
"e",
"3a1128e58913394ffc357fa57bb9a3cdb86d0084cd1a47df75bd94d527aa8d45",
"",
"reply"
],
[
"p",
"4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861"
]
],
"content": "š
Original date posted:2021-05-23\nš Original message:\nGood morning list,\n\nNote that there is a possible jamming attack here.\n\nMore specifically, when \"failing\" an incoming HTLC, the receiver of the HTLC sends its signature for a transaction spending the HTLC and spending it back to the sender revocable contract.\nThe funds cannot be reused until the channel state is updated to cut-through all the transactions (the HTLC transaction and the failure transaction).\n(Well it *could* but that greatly amps the complexity of the whole thing --- no, just no.)\n\nThus I could jam a particular receiver by sending, via forwarding nodes, to that receiver, payments with a random hash, which with high probability have preimages that are unknown by the receiver.\nThe receiver can only fail those HTLCs, but \"to fail an HTLC\" under Fast Forwards makes the funds unusable, until the previous channel state can be revoked and replaced with a new one.\nBut updating the channel state requires privkeys to be online in order to create the signatures for the new channel state.\n\nThis creates a practical limit on how long you can keep privkeys offline; if you keep it offline too long, an attacker can jam all your incoming capacity for long periods of time.\nThis is not currently a problem without \"receiver online, privkey offline\", since without \"privkey offline\" case, the receiver can update the channel state immediately.\n\nHowever, if the receiver is willing to lose privacy, the protocol can be mildly modified so that the receiver tells the forwarding node to *first* ask the receiver about every HTLC hash before actually instantiating and sending the HTLC.\nOnly if the receiver agrees will the forwarder actually send the HTLC.\n\nThe forwarder is incentivized to go along with this, as otherwise, the receiver cannot actually fail any HTLCs --- it needs to provide a signature, and signatures require privkeys, and the receiver has those offline.\nThus, the forwarder would prefer to ask the receiver *before* it instantiates the HTLC, as otherwise the HTLC cannot be cancelled until the receiver gets its privkeys online, which can take a long time --- and if the HTLC times out in the meantime, that can only be enforced by dropping onchain, and Fast Forwards are *very* expensive in the unilateral close case.\n\nObviously this tells the forwarding node that the channel is used for receiving and that any payments over it terminate at the next hop, thus a privacy degradation.\nOn the other hand, unpublished channels remain popular despite my best efforts, and this is the exact problem unpublished channels have, so ---- not a degradation in privacy in practice, since users of unpublished channels already have degraded privacy (axiom of terminus),\n\nThis also increases latency once again, as there is now 1.5 roundtrips (forwarder asks receiver if this forwarded HTLC is kosher, receiver responds, forwarder sends signature to HTLC transaction).\nHowever, the increased latency only occurs at the endpoint; forwarders (which need to have privkeys online 100% of the time anyway, and can thus cut-through any number of failed HTLCs at any time) can skip the \"is this HTLC kosher\" message and just send the HTLC signatures immediately.\nThus, this may be an acceptable tradeoff.\n\nThus, one might consider this scheme to be usable for *either* Fast Forwards, *or* \"receiver online, privkeys offline\", but not usefully both (after all, a forwarder is both a receiver and a sender, and a sender needs its keys in order to send, so it cannot use the \"privkeys offline\" feature anyway).\n\n\nIt may be difficult to understand this, so maybe I will make a convenient presentation of some sort.\n\nRegards,\nZmnSCPxj",
"sig": "5af77c766a49ce91cc7b5c2bcb780ad0fd579a5339974a9f3bb478e72dcc775ef263868c57e4abdf56886363092785c998c30ac1c845814e9ef729b471ccdc6f"
}