Browse

Reference

Directory

Company

Help & Legal

Follow

Subscribe

Quick Take

The Lightning Development Kit, a library for building Bitcoin Lightning software, merged a fix on Nov. 23 for a bug that could leave routing nodes paying out without collecting the corresponding funds. The bug affects unpatched LDK routing nodes that save channel recovery data asynchronously.

A Lightning routing node forwards a payment on one channel and collects the corresponding funds on another. Bitcoin Optech's Nov. 27 bulletin described a case in which the incoming channel had been force-closed.

If the node crashed before its recovery data was saved, it could come back online without information it needed to collect the incoming funds. Loss was possible if the node had paid the outgoing side and its claim on the Bitcoin blockchain also failed to confirm before expiry.

Asynchronous storage lets a node keep working while its channel data is being saved. In the affected case, LDK could treat a recovery update as saved while the write was still in progress. The LDK fix keeps the update pending until the write is finished. The update goes into a channel monitor, which holds information the node can use to recover funds when a channel closes.

A separate Core Lightning recovery tool addresses pending payments after channel data has already been lost.

When the LDK patch counts a write as saved

Channel recovery data on affected Lightning routing nodes using asynchronous storage.

The patch keeps the recovery update pending through storage completion.

In the described crash scenario, loss also requires the outgoing payment to go through and the incoming on-chain claim to miss its deadline.

Sources

Supporting facts

Method

Conceptual comparison of write events in the LDK merge record and Bitcoin Optech's technical account. The horizontal order shows sequence.

Scope

How to check a running build

Pull request #5663 landed on LDK's main development branch. As of Nov. 29, the project's repository tags and the Rust package history showed no confirmed tagged release carrying the change. Docs.rs dates the 0.2.8 and 0.1.14 packages and the 0.3.0-rc4 release candidate to Nov. 11, before the merge.

The LDK Node 0.7.1 manifest, for example, allows compatible 0.2-series versions of the lightning library. Which one an operator runs depends on the build. The Cargo lockfile for a Rust application records the exact dependency version or Git revision selected for that build.

Operators who compile their own software can check the lockfile used for their build, then verify that the selected release or source revision includes #5663. For a packaged application, start with the distributor's release notes or build records for the installed version. If those leave it unclear, ask the maintainer whether that build includes the fix or a backport and whether it saves channel recovery data asynchronously.

For developers who supply their own storage, the fix also changes when they report that data has been saved. Under the revised LDK contract, custom integrations that mark writes as pending must report when full channel-monitor writes finish.

Bitcoin developers propose fix for transaction verification gap affecting Lightning wallets

Mentioned in this article

Why Bitcoin Core users need a fresh backup after first-time wallet encryption

Cookie Consent

We use cookies to improve your experience on our site. By using our site, you consent to cookies.

Cookie Preferences

Manage your cookie preferences below:

Essential cookies enable basic functions and are necessary for the proper function of the website.

CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.

Service URL: developers.cloudflare.com (opens in a new window)

Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.

Service URL: policies.google.com (opens in a new window)

Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.

Clarity is a web analytics service that tracks and reports website traffic.

Service URL: clarity.microsoft.com (opens in a new window)

You can find more information in our Privacy Policy and .

Loading image…

This image could not be loaded.

The Catalyst