What occurs when your Lightning Community routing node is fed with rubbish transactions that by no means resolve? Briefly, it causes a number of grief for routing nodes. What was as soon as a clean, international fee system will be locked up with trivial effort from a savvy script author.
Working in a small workforce of routing nodes, we efficiently ran a take a look at of the assault with actual funds and demonstrated the “griefing” assault described by Joost Jager. The assault is named a grief assault since it’s not a theft of funds, however it causes a sufferer’s Lightning funds to be frozen: a serious upset. What we discovered is that griefing is a critical risk to massive “wumbo” channels anticipating to earn a yield on their bitcoin, solely to have their funds frozen for a time frame.
That is largely a grief assault: no lack of funds, however the sufferer may be pressured to pay for an costly channel power shut. This can be a identified vulnerability on mainnet Lightning and it must be understood and prioritized, particularly at this early market stage of Bitcoin’s Lightning Community.
Because of Clark Burkhardt and Phillip Sheppard for his or her willingness to take part on this take a look at and to Jager for his tireless work to convey consideration and precedence to this vulnerability. Jager performed the function of the attacker for our demonstration, whereas Burkhardt and Sheppard joined me as linked sufferer routing nodes.
How The Assault Works
The attacker saturates one (or a number of) channel(s) with Hashed Time Locked Contracts (HTLCs) that don’t resolve as a finalized fee. These are a particular breed of HTLCs often called HODL invoices. Solely 483 of those unresolved HTLCs are required to overwhelm a channel per route. As soon as these HTLCs are within the channel, any transactions utilizing that very same channel route are not possible, together with a transaction to cooperatively shut that channel.
In idea, an attacker may contact the sufferer (maybe through a keysend message or in an “onion blob”) and demand a ransom be paid to halt the assault. As soon as the ransom is paid, the attacker may take away the unresolved funds, ending the assault. The assault will be sustained indefinitely, halting all routing and fee exercise in that channel. This freezes the funds within the Lightning channel.
Each instructions of funds will be stalled in a channel through the use of 483 HTLCs in every route, each inbound and outbound.
Why Would An Attacker Do One thing Like This?
The primary motive that involves thoughts is to demand a ransom. This assault causes ache for the sufferer and paying a ransom may be enticing to a sufferer, even with out assurance that the assault would cease. Contacting the sufferer is perhaps dangerous for an attacker, however a ransom fee won’t be the one cause somebody would do that.
A secondary incentive for launching a griefing assault could be to disrupt routing competitors. Jamming a competitor’s route may create extra demand for a route owned by an attacker.
As a benchmark, think about that Lightning Labs’ Loop node has an ongoing demand for liquidity for which it is going to typically pay a 2,500 elements per million of the fee (ppm) (0.25 p.c) charge charge. In my expertise, they’d usually exhaust 16 million sats’ worth of liquidity in about two weeks (5.2 p.c annual share charge), however that’s with competitors current.
If an attacker may disable any competing route with decrease charge charges, Loop may be keen to pay a better charge charge (for the reason that provide of liquidity is now diminished). Let’s say Loop would pay 3,00Zero ppm (0.Three p.c), in addition to use that liquidity extra rapidly since no different channels are functioning. Loop may use that liquidity in half the time, say one week. The attacker would greater than double their normal yield to 15.6 p.c APR on this instance. The one value to the attacker is the price of operating a script on an current channel and the psychological value of doing one thing immoral/damaging to the Lightning Community. With a single attacker channel, a malicious actor may jam about 9 channels (see Jager’s tweets about this).
What Would The Sufferer Of This Assault Expertise?
The sufferer of this assault wouldn’t actually know that this assault was taking place until that they had some particular alerts set for pending HTLCs. For Thunderhub customers (a extremely really helpful device), the house display will present a chart of pending HTLCs in addition to a warning stating that channels can solely maintain 483 pending HTLCs.
In observe, my node rapidly grew to become unreliable and skilled a number of app crashes, together with Thunderhub, which was the one app to inform me of the issue. Then, because of my “Balance of Satoshis” Telegram bot, I acquired a channel closing notification. The channel underneath assault force-closed itself! That was not imagined to be a part of the experiment. (For extra technical info on the involuntary power shut, see beneath for added force-close knowledge.)
What Can The Sufferer Do To Cease A Griefing Assault?
As soon as an assault begins, a sufferer basically can’t do something to cease it. The one alternate options out there to halt an ongoing assault could be to force-close the channel being attacked, which implies that the terrorists win.
So as to add insult to damage, force-closing the channel will push the unresolved funds to the on-chain transaction knowledge, triggering secondary on-chain transactions for the initiator of the power shut. At 50 sats/vbyte and 483 on-chain transactions, that’s simply a 1 million sat price tag to power shut a single channel underneath assault (a $368 channel shut charge at at the moment’s costs). The a number of on-chain transactions solely happen if the output is above the minimal fee “dust” restrict. (See this instance on testnet.)
How To Forestall A Griefing Assault
Jager has been engaged on a proof-of-concept program to assist isolate and struggle attackers. He’s calling his program “Circuitbreaker.” The Circuitbreaker works at a community stage, which sadly implies that everybody has to take part for it to be efficient.
Past that, this subject wants prioritization and a spotlight from devoted engineers/builders to seek out higher options. There have additionally been some good discussions on modifying the protocol within the Bitcoin Optech e-newsletter (subject #122 or #126).
This assault will be executed at the moment. It’s a miracle that it hasn’t already been used maliciously. It’s a mirrored image of the incentives for these utilizing Lightning at the moment in order that it could develop into an open, common fee community. Please share this submit as you see match to encourage and encourage extra work to repair this drawback earlier than it causes actual hurt.
Extra Technical Info About The Involuntary Pressure-Shut
Listed here are the logs from my node operating LND 0.11 in the mean time that the above talked about involuntary force-close occured:
2020-11-26 21:24:47.374 [ERR] HSWC: ChannelLink(657759:561:0): failing hyperlink: ChannelPoint (c37bec006b18df172698a84739ca47128935e0a8666fecd1a843e49b01db207c:0): acquired error from peer: chan_id=7c20db019be443a8d1ec6f66a8e035891247ca3947a8982617df186b00ec7bc3, err=rejected dedication: commit_height=455, invalid_commit_sig=3044022076fd65191eb6305b723fa6012be378413b6326e2786c38db58b4c02e1f3999d202207605ca31de8b4c5b1d9cd20dc1581dfa2383e0b4e06c8ad4f718ab5c434d8cf5, commit_tx=02000000017c20db019be443a8d1ec6f66a8e035891247ca3947a8982617df186b00ec7bc300000000008a792e8002210d0000000000002200201031cf10a1efef261edd3d0a1a6a953b27bc25bd7150bb2b07afdc69805e02157213000000000000160014de650929042bef58b71783ae1a44834a902a8f2d542ca720, sig_hash=4e0fb804c74376020e4c44a60969b9206eb0aaa9a89b76017d60f23ad5cf63e5 with error: distant error
The logs present an “invalid_commit_sig” which is a identified subject in LND. Supposedly, this may occur upon reconnecting and isn’t a direct results of the channel jamming. The amount of pending HTLCs sadly makes it extra more likely to occur. Jager helped clarify the method as channel jamming –> infinite fee loop (bug) –> node down –> reconnect –> invalid commit sig (bug) –> channel force-close.
The “endless” loop bug is a identified bug that happens when the HTLC restrict is reached and a further HTLC is distributed. As a substitute of ending in a fee failure, LND will proceed to try the fee in a loop. To assist with this bug, see LND subject #4656.