lightning-ldk
- Repo stars 0
- Author updated Live
- Author repo skills-registry
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @tomevault-io · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: lightning-ldk
description: | Use when this capability is needed. LDK is a library, not a daemon. Provides Rust crates with…
category: other
runtime: Node.js
---
# lightning-ldk output preview
## PART A: Task fit
- Use case: | Use when this capability is needed. LDK is a library, not a daemon. Provides Rust crates with C/Swift/ Kotlin/JS bindings. Used by Mutiny Wallet, Cash App, Casa, ldk-node, runs entirely locally; runs on Node.js. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Crates (selected) / Core primitives / ldk-node (quick-start)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “| Use when this capability is needed. LDK is a library, not a daemon. Provides Rust crates with C/Swift/ Kotlin/JS bindings. Used by Mutiny Wallet, Cash App, Casa, ldk-node, runs entirely locally; runs on Node.js. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “Crates (selected) / Core primitives / ldk-node (quick-start)” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “Crates (selected) / Core primitives / ldk-node (quick-start)”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: lightning-ldk
description: | Use when this capability is needed. LDK is a library, not a daemon. Provides Rust crates with…
category: other
source: tomevault-io/skills-registry
---
# lightning-ldk
## When to use
- | Use when this capability is needed. LDK is a library, not a daemon. Provides Rust crates with C/Swift/ Kotlin/JS bin…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Crates (selected) / Core primitives / ldk-node (quick-start)” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "lightning-ldk" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Crates (selected) / Core primitives / ldk-node (quick-start)
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} LDK (Lightning Dev Kit)
LDK is a library, not a daemon. Provides Rust crates with C/Swift/ Kotlin/JS bindings. Used by Mutiny Wallet, Cash App, Casa, ldk-node, Phoenix (parts), etc.
Crates (selected)
lightning— core protocol logic.lightning-net-tokio— async TCP transport.lightning-persister— file-based persistence.lightning-background-processor— background task driver.lightning-block-sync— chain sync.lightning-transaction-sync— alternative tx-only sync.lightning-rapid-gossip-sync— fast gossip via signed snapshot.lightning-invoice— BOLT11 invoice handling.ldk-node— opinionated bundling for quick-start.lightning-liquidity— LSP client/server primitives.bdkintegration crates.
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:
- KeysManager — produces/derives keys.
- NetworkGraph — channel graph storage.
- EventHandler — react to events (payment received, channel opened).
- Persister — save state to disk / DB.
- FeeEstimator — fee rate source.
- BroadcasterInterface — broadcast txs.
ldk-node (quick-start)
use ldk_node::{Builder, Network};
let builder = Builder::new()
.set_network(Network::Bitcoin)
.set_chain_source_esplora("https://blockstream.info/api".into())
.set_storage_dir_path("/path/to/data".into());
let node = builder.build().unwrap();
node.start().unwrap();
// Use the node
let address = node.onchain_payment().new_address().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:
- File:
lightning-persisterwrites channel state to disk. - Database: SQLite, PostgreSQL — implement
Persisttrait. - Cloud: persist channel state encrypted to cloud storage (Mutiny does this).
- Trustless replication: VSS (Versioned Storage Service) — Lightning Labs' encrypted cloud storage protocol.
Chain sync options
- bitcoind RPC —
lightning-block-syncpolls / ZMQs. - Esplora API —
lightning-transaction-syncvia Esplora REST. - Electrum — same crate, via Electrum protocol.
- Neutrino (BIP157/158) — light-client; for mobile.
Mobile uses Neutrino: lightning-block-sync downloads filters, scans locally for UTXO matches, downloads only relevant blocks.
Bindings
LDK provides:
- Rust native crates.
- C via
lightning-c-bindings. - Swift / iOS via
LDKSwiftandLDKNode. - Kotlin / Android via
LDKKotlinandldk-node-kotlin. - JS / WASM via
ldk-node-js(experimental).
ldk-node specifically targets Swift/Kotlin/JS so mobile devs get a single API.
Use cases
- Mutiny Wallet — browser-based LN via WASM + LDK.
- Cash App — backend LN.
- Casa — vault + LN integration.
- Phoenix (partial) — uses LDK components.
- Greenlight (Blockstream) — alternative; CLN-based.
Memory footprint
LDK is light: ~10-20 MB RAM for a typical mobile node. Bitcoin Core
- LND can use 1+ GB. This is the main reason LDK dominates mobile.
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 |
Common issues
Persisttrait misimplementation: missed updates → state corruption on restart.- Async signer race conditions: signing requests racing with channel updates.
- Chain sync gaps: skipped blocks → channel state diverges.
- ldk-node migration: upgrading minor versions sometimes requires state migration; back up first.
See also
Source: claude-dev-suite/claude-dev-suite — distributed by TomeVault.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review