Markets
BTC $56,292 -8.48% ETH $1,567 -9.10% BNB $517 -8.91% XRP $0.8775 -8.78% SOL $66.11 -8.13% LINK $8.14 -7.11% BTC $56,292 -8.48% ETH $1,567 -9.10% BNB $517 -8.91% XRP $0.8775 -8.78% SOL $66.11 -8.13% LINK $8.14 -7.11% TOTAL $1.97T BTC.D 57.3%

Blockchain Technology

Lightning’s Main Implementation Patched a Bug That Could Drop Settled Payments

A 16-bit counter that wrapped to zero at 65,536 entries meant a restarted node could rebuild an empty record of payments already acknowledged.

Developers of LND, the most widely deployed implementation of Bitcoin’s Lightning Network, have patched a software flaw that could cause a node to lose track of settled payments after a restart, threatening the accounting records that keep payment channels consistent.

Releases v0.21.8-beta and v0.20.8-beta, published Nov. 11, address an error in how the software saved and restored channel updates. The problem, described by LND maintainer Olaoluwa Osuntokun, who goes by Roasbeef, involved a counter tracking acknowledged updates from a connected peer. The software stored the number of entries in a 16-bit unsigned integer, a format that can only represent values up to 65,535.

Once the list reached 65,536 entries the counter rolled over to zero, even though LND kept writing every update to disk. On restarting, the node could read that zero as an empty list and rebuild its state without a previously settled hashed timelock contract, the conditional payment primitive that Lightning uses to move value across channels. A node that believes a payment never settled is a node that may try to claim it again or, depending on its role, fail to account for funds it owes or is owed.

The patch adds write guards so that oversized logs are rejected before commitment progress or revocation is recorded and before record bytes are serialised. The updated reader also validates entries against the stored count when loading, and it can recover complete lists from older oversized records where the data passes those checks. Malformed trailing data is rejected rather than silently discarded.

The change necessarily applies only to the structure that overflowed, the unsigned acknowledged update log. Other channel state records were not affected by this condition, and the fix does not alter how channels are negotiated or how HTLCs are enforced on chain.

No exploitation and no financial loss have been established in connection with the bug. That is the usual shape of a Lightning vulnerability disclosure: because channels can be force-closed on chain, the worst outcomes require a specific sequence of events and a live adversary rather than a passive failure.

The episode is a reminder of where Lightning’s risk actually sits. The protocol’s on-chain guarantees are strong, but the software that tracks channel state between settlements is ordinary database code with counters, serialisation and restart paths, and the cost of a bookkeeping error in that layer is a disagreement about who owns what. Node operators who have not upgraded since Nov. 11 remain exposed to the overflow condition.

Share this article

Viber uses viber://forward?text= when the app is installed.