---
title: "LDK (Lightning Dev Kit) — definition | Nuri Glossary"
description: "A Lightning library you embed in your own product, without running a standalone node daemon."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/ldk"
---

# LDK (Lightning Dev Kit)

A Lightning library you embed in your own product, without running a standalone node daemon.

## Basically

LDK lets developers build Lightning payments into an app. They do not need separate node software.

## Key Takeaways

- LDK is a Lightning Network implementation packaged as a library, not a standalone daemon. Developers embed it directly in their applications and retain full control over storage, networking and key management.
- LDK's modular architecture lets you bring your own components. Well-defined Rust traits let you swap in any blockchain data source, persistence layer or networking stack, making LDK suitable for mobile wallets, web apps and large-scale payment platforms.
- Spiral (Block, Inc.) maintains LDK, which powers production Lightning in Cash App, Alby Hub and other wallets. Bindings cover Rust, Swift, Kotlin, Python and JavaScript. Unlike LND or Core Lightning, LDK treats Lightning as a feature you add rather than a service you run.

## What Is LDK?

LDK (Lightning Dev Kit) is an open-source SDK that implements the full Lightning Network protocol as a composable library. It compiles directly into your codebase instead of running as a separate Lightning daemon that your application communicates with over RPC. Your application becomes the Lightning node.
LDK is written in Rust and dual-licensed under Apache 2.0 and MIT. It implements all BOLT specifications and has been in production since 2021. Spiral, the Bitcoin-focused open-source team within Block, Inc. (formerly Square), maintains the project with a dedicated engineering team.
The core insight behind LDK is that most Lightning implementations were built for server environments. That design makes them difficult to embed in mobile apps, web browsers or custom infrastructure. LDK reverses this approach by providing Lightning as a library with pluggable interfaces, so developers can adapt it to any runtime environment.

## How It Works

LDK's architecture centres on Rust traits, which are interfaces that define how the library interacts with external systems. You implement these traits to connect LDK to your chosen infrastructure, or use the default implementations provided for common setups.

## Core Components

The main structs are the core components developers interact with. These structs are your main points of contact with LDK.

## Pluggable Interfaces

LDK's modular trait system makes it fundamentally different from LND and Core Lightning. Each external dependency sits behind a trait that you implement.

## Event-Driven Architecture

LDK uses an event-driven model, so a call returns immediately when you initiate an action such as sending a payment. LDK later notifies your application of the outcome through events. A simplified integration follows this pattern.

## LDK Node: A Higher-Level Wrapper

LDK Node gives developers Lightning functionality without requiring deep protocol knowledge, and the LDK team also maintains it. Raw LDK exposes over 900 methods, while LDK Node simplifies this to roughly 30 API calls by making opinionated choices about architecture.
LDK Node integrates BDK (Bitcoin Dev Kit) for on-chain wallet management and includes built-in persistence via SQLite. It supports rapid gossip sync for mobile-optimised network graph updates. It generates language bindings via UniFFI for Swift, Kotlin, Python and Flutter/Dart.

## Language Bindings

LDK's Rust core generates bindings for multiple languages. These bindings enable integration across platforms.

## LDK vs. Other Lightning Implementations

The Lightning Network has three major implementations. Each takes a fundamentally different approach to how developers integrate Lightning functionality. The node implementation comparison covers these differences in more depth.
The key trade-off is that LND and Core Lightning give you a working node out of the box. LDK gives you building blocks that require more integration work but offer far greater flexibility. Mobile wallets and embedded applications need this flexibility.

## Mobile Self-Custodial Wallets

LDK was specifically designed for mobile environments where running a full daemon is impractical. Its no_std support means the core library can run on resource-constrained devices. Features such as rapid gossip sync minimise bandwidth consumption by compressing network graph updates for mobile clients.
Wallets such as Bitkit and EttaWallet use LDK to provide self-custodial Lightning on mobile without compromising user sovereignty. The persistence trait lets these wallets store channel state alongside their existing data layer.

## Large-Scale Payment Platforms

Cash App, one of the largest payment apps in the United States, uses LDK for Lightning withdrawals and deposits serving millions of users. Its integration uses Java/Kotlin bindings, phantom nodes for multi-server invoice handling, and custom pathfinding algorithms with background probing for reliability.

## Browser-Based Lightning

LDK compiled to WebAssembly (WASM) enabled Mutiny Wallet to become the first self-custodial Lightning wallet running entirely in a web browser. LDK's portability means the same protocol implementation runs natively on servers, on mobile devices and in browser sandboxes.

## Federated Systems

Fedimint uses LDK for its Lightning gateway, connecting the federated ecash system to the broader Lightning Network. The modular architecture lets Fedimint plug LDK into its existing consensus and storage layers without running a separate daemon.

## Why It Matters

LDK represents a shift in how developers think about Lightning integration. It makes Lightning a native capability embedded in your code rather than an external service your application talks to. The shift has several effects.
The broader ecosystem benefits because LDK lowers the barrier to building Lightning-enabled applications. Projects like Spark and other Layer 2 solutions benefit from a growing set of Lightning-capable wallets and services, since deeper Lightning integration across the ecosystem improves liquidity and connectivity for all participants. The wallet SDK comparison gives developers evaluating Lightning SDKs a broader overview of available tooling.

## Integration Complexity

LDK's flexibility comes at a cost because you must wire together components that other implementations handle internally. Persistence must be implemented correctly to avoid channel state loss, and networking must handle reconnection gracefully. The event loop must process events promptly to avoid missed HTLCs or force closures.
LDK Node mitigates this for simpler use cases, but applications with custom requirements still face significant integration work. The mobile wallet architecture guide covers common patterns for handling these challenges.

## State Management

Lightning channel state must be persisted atomically and reliably. A counterparty can claim all funds via a justice transaction if a node loses its latest channel state and broadcasts an outdated commitment transaction. LDK delegates persistence to the developer, so your application must ensure correct, crash-safe storage.

## Ecosystem Maturity

LDK is production-ready and powers major platforms, but its ecosystem of tooling and documentation is smaller than LND's. LND benefits from years of community-built tooling, tutorials and operational knowledge. LDK's documentation has improved substantially, but developers may find fewer community resources for edge cases.

## Rapid Evolution

LDK is under active development with frequent releases. Its API surface can change between versions, requiring applications to update their integration code. The project reached its v0.1 milestone in January 2025, signalling growing stability, but breaking changes are still possible on the path towards a 1.0 release.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
