A Bitcoin Lightning bug that has been obvious since October 2016 — just some months after the community’s launch — has lastly been patched.
In Could 2016, Elizabeth Stark and Olaoluwa “Roasbeef” Osuntokun co-founded Lightning Labs and its Bitcoin Lightning community node software program, Lightning Community Daemon (LND).
Nevertheless, simply 5 months later, Osuntokun admitted to a severe safety vulnerability inside LND that might stay unresolved for a decade.
Now, after years of assist from innumerable LND contributors, Osuntokun has considerably patched it by merging pull request (PR) 10331.
The “bug” endured for thus lengthy that characterizing it as such is sort of nonsensical.
Certainly, it was most likely a design tradeoff, or consumer expertise compromise, permitting customers to shortly shut LND channels in a principally safe manner — besides within the uncommon occasion of a blockchain reorganization.
Regardless of being the world’s hottest implementation of Lightning, LND customers exiting the layer 2 community have been in danger for years, per the co-founder’s personal admission in challenge 53.
Ten years of labor on this Bitcoin Lightning bug
Once more, LND is node software program that helps customers enter, transact, and exit from Bitcoin’s Lightning community.
When customers fund an LND cost channel to hitch Lightning, they contribute BTC on-chain with a view to then transact BTC off-chain with Lightning customers.
As soon as they end, they use LND software program to exit on-chain, settling their BTC “bar tab” of Lightning transactions.
LND cost channel closing transactions, nevertheless, have been topic to blockchain reorganization threat per challenge 53. Sure, Bitcoin blockchain reorgs have been a threat to LND customers for a decade.
Certainly, LND challenge 53 was the oldest open challenge of the world’s dominant Lightning community implementation.
Lastly, a patch for LND challenge 53
This month, Osuntokun lastly scaled affirmation necessities from one to 6 blocks — proportionately with channel measurement — such that channel closings with extra BTC require extra confirmations.
The extra confirmations an on-chain transaction receives, the safer it’s from reorg threat.
Along with scaling affirmation necessities, Osuntokun additionally revamped LND’s state machine to detect extra delicate dangers of chain reorgs, together with real-time monitoring of competing channel shut transactions, in addition to destructive (i.e. reorg) confirmations.
To his credit score, Osuntokun continued to follow-up on challenge 53 for years in an apparent show of dedication to tackling the issue.
Furthermore, challenge 53 arose throughout the earliest days of Lightning’s inception when funds in danger have been tiny and something near its fashionable state was a theoretical dream.
It’s tough to say whether or not a extra conservative tradeoff of channel closings pace weighed towards an exceedingly unlikely reorg would have unnecessarily hindered the expansion of LND and Osuntokun’s venture-backed LND firm.
