计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
bitcoin-libraries-ldk【效率与协作】Lightning Dev Kit (LDK): modular Rust crates for embedding Lightning in apps. ldk-node for opinionated quick-start. Bindings to Swift / Kotlin / Python. USE WHEN: embedding Lightning in mobile/desktop apps, building custom LN logic.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Modular Rust library for Lightning. Used by Cash App, Casa, ldk-node, more. Mutiny Wallet was a prominent early user; the shutdown was announced 2024-08-05 and the hosted wallet closed 2024-12-31. Its repos took their last commits in September 2024 and are archived today, so treat Mutiny references below as history, not as a live deployment.
See full overview at ../../lightning/ldk/SKILL.md.
lightning — core protocol logic.lightning-net-tokio — async TCP transport.lightning-persister — file persistence.lightning-background-processor — task driver.lightning-block-sync — chain sync via bitcoind RPC.lightning-transaction-sync — chain sync via Esplora / Electrum.lightning-rapid-gossip-sync — fast initial gossip.lightning-invoice — BOLT11 invoice handling.ldk-node — opinionated bundled crate.lightning-liquidity — LSP client/server.lightning and the sibling core crates — 0.2.6 (2026-09-09).
LDK 0.1 (January 2025) was the API-stabilisation milestone; since
then the project ships features in minor releases and backports
fixes as patch releases on older minor lines.lightning-invoice — 0.34.1 (June 2026).ldk-node — 0.7.0 (2025-12-03), which depends on the lightning
0.2 line. main carries an unreleased 0.8.0.lightning 0.3.0-rc1 and lightning-invoice
0.35.0-rc1, both published 2026-08-31. No stable 0.3 yet.ldk-node 0.7.0 added experimental channel splicing, async payments (serving and paying static invoices), a Bitcoin Core REST chain source, and persisted liquidity-service state.
[dependencies]
ldk-node = "0.7"
use ldk_node::Builder;
use ldk_node::bitcoin::Network;
use ldk_node::lightning_invoice::{Bolt11InvoiceDescription, Description};
let mut builder = Builder::new();
builder.set_network(Network::Bitcoin);
builder.set_chain_source_esplora(
"https://mempool.space/api".to_string(), None);
builder.set_storage_dir_path("/path/to/data".to_string());
let node = builder.build()?;
node.start()?;
let description = Bolt11InvoiceDescription::Direct(
Description::new("Test".to_string())?);
let invoice = node.bolt11_payment().receive(
100_000, // 100k msat
&description, 3600,
)?;
Builder setters take &mut self, so build the builder in a let mut binding rather than chaining off a temporary. Network is
re-exported as ldk_node::bitcoin::Network, not ldk_node::Network.
Two separate binding families exist and are not interchangeable:
ldk-node 0.7.0 ships UniFFI bindings for Swift, Kotlin and Python
(plus community Flutter bindings), while an older family is generated
directly over the raw lightning crate on top of ldk-c-bindings.
Each entry below says which family it belongs to.
lightning, not over
ldk-node; the SwiftPM product is named LightningDevKit. Not
archived, but no release or commit since 0.0.125 (2025-02-27), so it
is still on the pre-0.1 0.0.x line and does not track
lightning 0.2.lightning. Java ships as org.lightningdevkit:ldk-java 0.2.5.0 on
Maven Central and TypeScript/WASM as the npm lightningdevkit
package 0.2.5-0, both published 2026-09-01. There is no separate
Kotlin/Android binding over raw lightning — Android consumers use
the Java bindings.lightningdevkit/ldk-nodejs — an older Node.js binding — is archived
and took its last commit in May 2022. The maintained JS/WASM path is
the lightningdevkit npm package above, which wraps raw lightning;
there is still no ldk-node WASM/JS binding.
lightning to WASM before
shutting down in 2024; the pattern is still viable, but there is no
maintained ldk-node WASM/JS binding to build on.See ../../lightning/ldk/SKILL.md for LND/CLN comparison and full feature matrix.
payment_hash was already
forwarded, could leave the ChannelManager unreadable on
deserialization; and a fee-inflation bug letting a malicious splice
counterparty make us over-allocate fee into their output when we
contribute to a splice.ChannelMonitor confused two HTLCs with
equal payment_hash and amount and resolved them incorrectly —
plus several remote-panic DoS vectors (oversized protocol messages,
invalid onion-message reply paths, reorg-time claim batching, and
the 50-unfunded-peer limit not being enforced).possiblyrandom not
generating random data unless explicitly configured (leaving LDK
open to HashDoS), and several remote-triggerable panics.lightning 0.2.0, which is a
caret 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.lightning 0.3.0-rc1 changes defaults and invalidates some persisted
state. Plan for:
ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx now
defaults to true.UserConfig::manually_accept_inbound_channels is removed — it is
always on, so inbound channels must be accepted explicitly from
event handling. ChannelHandshakeLimits::max_funding_satoshis went
with it.ReceiveAuthKey;
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.During the 0.3 cycle primary rust-lightning development moved to
git.rust-bitcoin.org; GitHub remains a synchronised mirror with
issues forwarded.
Persist trait misimplementation → state corruption.0.2 alone is not a floor.