Ldk

From claude-dev-suite/claude-dev-suite · View interactive version

Ldk is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. LDK (Lightning Dev Kit): modular Rust crates for building custom Lightning apps. ldk-node for opinionated quick-start. ChannelManager, ChainMonitor, Router, async signer, persistence. USE WHEN: embedding Lightning into mobile/desktop apps, building custom Lightning logic, scaling beyond LND-style da

How to use this skill

Skill file

LDK (Lightning Dev Kit)

LDK is a library, not a daemon. Provides Rust crates with C/Swift/

Kotlin/JS bindings. See "Use cases" below for who ships it.

LDK is developed under the lightningdevkit GitHub org — it is not

a Lightning Labs project (Lightning Labs ships LND, Loop, Pool and

Taproot Assets). Dual-licensed Apache-2.0 / MIT.

Versions as of September 2026: the core lightning crate is 0.2.6

(2026-09-09), with 0.3.0-rc1 (2026-08-31) in release-candidate;

ldk-node is 0.7.0 (2025-12-03). The long 0.0.x line ended at

0.0.125 (2024-10-14) and was succeeded by 0.1.0 (2025-01-16), so any

0.0.x version floor you see quoted predates the current API.

Crates (selected)

built on the dnssec-prover crate. Versioned on its own track, at

0.3.1 (2026-06-19) while the core crate is on the 0.2 line.

workspace on main for the 0.3 line and not yet released: crates.io

holds only a 0.0.1 name placeholder (2026-08-20, described as a

"Dummy package for name hold") as of September 2026.

Core primitives

// Persistence trait
trait Persist<ChannelSigner> { ... }

// Channel manager — owns all channels
let chan_mgr = ChannelManager::new(...);

// Chain monitoring — watches outputs, force-close events
let chain_mon = ChainMonitor::new(...);

// Router — pathfinding
let router = DefaultRouter::new(...);

// Background processor — drives async tasks
BackgroundProcessor::start(...);

User code provides:

ldk-node (quick-start)

// ldk-node 0.7.0 (2025-12-03): setters take &mut self, so build the
// Builder in place rather than chaining off Builder::new().
use ldk_node::bitcoin::Network;
use ldk_node::lightning_invoice::{Bolt11InvoiceDescription, Description};
use ldk_node::Builder;

let mut builder = Builder::new();
builder.set_network(Network::Bitcoin);
builder.set_chain_source_esplora("https://blockstream.info/api".to_string(), None);
builder.set_storage_dir_path("/path/to/data".to_string());
let node = builder.build().unwrap();
node.start().unwrap();

// Use the node
let address = node.onchain_payment().new_address().unwrap();
let desc = Bolt11InvoiceDescription::Direct(
    Description::new("desc".to_string()).unwrap(),
);
let invoice = node.bolt11_payment().receive(amount_msat, &desc, 3600).unwrap();
node.bolt11_payment().send(&invoice, None).unwrap();

ldk-node exposes a single API surface across Rust + Swift/Kotlin/JS

bindings.

Async signer

For hardware wallets / remote signers:

trait NodeSigner { fn ecdh(&self, ...) -> Result<...>; ... }
trait ChannelSigner { fn sign_counterparty_commitment(&self, ...) -> ...; ... }
trait SignerProvider { fn derive_channel_signer(&self, ...) -> ChannelSigner; ... }

LDK supports async signing via EventHandler::handle_event returning

deferred sigs. Useful for hardware-wallet-backed Lightning.

Persistence model

LDK doesn't dictate storage. Common backends:

(Mutiny did this; see "Use cases").

project's own encrypted cloud storage service

(lightningdevkit/vss-server, Apache-2.0), not a Lightning Labs

product. ldk-node 0.7.0 can persist channel state to a VSS server.

Chain sync options

Mobile uses Neutrino: lightning-block-sync downloads filters, scans

locally for UTXO matches, downloads only relevant blocks.

Bindings

LDK provides:

ldk-node specifically targets Swift/Kotlin/JS so mobile devs get a

single API.

Use cases

Featured on lightningdevkit.org's homepage as of September 2026:

That strip is a highlight reel, not the full user list: the site's

case-studies page enumerates 26 projects as of September 2026, among

them Bitkit, Fedimint, LNDK, Megalith, Sensei, Stable Channels, TEOS,

VLS, Voltage, Zeus and zinqq.

Not on that page (September 2026):

MutinyWallet/mutiny-web repo is archived, last commit September 2024

(checked September 2026).

Not LDK, despite frequent confusion:

page. Casa's only Lightning product was the Casa Node / Sats App,

which ran LND (Casa/Casa-Node-API: "an API into Bitcoind and

LND"; repo archived, last push July 2020) and was sunset 2021-06-30.

casa.io advertises no Lightning product as of September 2026.

Memory footprint

LDK is light: ~10-20 MB RAM for a typical mobile node. Bitcoin Core

Comparing LDK to LND/CLN

| Aspect | LND/CLN | LDK |

|--------|---------|-----|

| Deployment | daemon | library, embedded |

| Mobile | no | yes (primary use) |

| Custom UI/logic | hard | easy (you own everything) |

| Default features | full | you choose |

| Memory | 200 MB+ | 10-20 MB |

Version floor and security history (as of September 2026)

LDK files no GitHub Security Advisories and cuts no GitHub Releases;

the ## Security sections of CHANGELOG.md are the advisory channel,

and a fresh patch release's entry lands on its tag before main.

Per-release detail, the 0.1/0.2 backport pattern and the lockfile

mechanics are in the companion Phase B article

knowledge/bitcoin/lightning/ldk/release-lines-deep.md.

fee-inflation bug letting a malicious splice counterparty make us

over-allocate fee into their output when we contribute to a splice

(#4905), and a denial-of-service where a bogus HTLC rejected

immediately after a second HTLC with the same payment_hash was

successfully forwarded could leave ChannelManager in a state that

fails deserialization — i.e. the node does not restart (#4982).

fixed an on-chain funds-theft vulnerability for forwarding nodes that

accept channels from untrusted peers: ChannelMonitor confused two

HTLCs with equal payment_hash and amount while processing an

un-revoked counterparty's claim, resolving them incorrectly (#4854).

The same releases fixed several remote-panic DoS vectors — oversized

protocol messages, invalid onion-message reply paths naming us as

introduction point, reorg-time claim batching — and the limit of 50

peers with unfunded channels not being enforced against an

open_channel flood. Reported by Project Loupe and Kyle W. Santiago.

anchor-reserve underestimates that could leave a node unable to

force-close properly, possiblyrandom not generating random data

unless explicitly configured (HashDoS by default), and several

remotely-triggerable panics. Most of it credited to Project Loupe.

still the newest 0.1 tag as of September 2026, so it remains the

floor on the 0.1 line. #4905 is splice-only and 0.1 has no splicing,

so it has no 0.1 counterpart; upstream says nothing either way about

whether #4982 reaches 0.1.

requirement: a fresh resolve picks up 0.2.6, but an existing

Cargo.lock needs cargo update -p lightning to actually land on

it. Check the lockfile, not the manifest. The lightning-* satellite

crates are separately versioned and must move as a set.

Migrating to 0.3 (release candidate as of September 2026)

lightning 0.3.0-rc1 (2026-08-31) changes defaults and invalidates

some persisted state. Plan for:

defaults to true.

always on, so inbound channels must be examined in event handling.

ChannelHandshakeLimits::max_funding_satoshis went with it.

**BOLT11 invoices already issued with payment metadata are

invalidated on upgrade** (and newly issued ones on downgrade). This

bites anyone holding long-lived invoices.

0.3+ will not accept payments over blinded paths created by earlier

versions. Existing BOLT12 offers stay valid; issued-but-unclaimed

BOLT12 refunds do not.

A splice negotiated on an earlier version cannot be RBF'd, and

downgrade after an RBF is unsupported.

During the 0.3 cycle primary rust-lightning development moved to

git.rust-bitcoin.org; GitHub remains a synchronised mirror with issues

forwarded.

Common issues

corruption on restart.

channel updates.

state migration; back up first.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.