LDK Server is a fully-functional Lightning node in daemon form, built on top of LDK Node, which itself provides a powerful abstraction over the Lightning Development Kit (LDK) and uses a built-in Bitcoin Development Kit (BDK) wallet.
The primary goal of LDK Server is to provide an efficient, stable, and API-first solution for deploying and managing a Lightning Network node. With its streamlined setup, LDK Server enables users to easily set up, configure, and run a Lightning node while exposing a robust, language-agnostic API via Protocol Buffers (Protobuf).
-
Out-of-the-Box Lightning Node:
- Deploy a Lightning Network node with minimal configuration, no coding required.
-
API-First Design:
- Exposes a well-defined API using Protobuf, allowing seamless integration with HTTP-clients or applications.
-
Powered by LDK:
- Built on top of LDK-Node, leveraging the modular, reliable, and high-performance architecture of LDK.
-
Effortless Integration:
- Ideal for embedding Lightning functionality into payment processors, self-hosted nodes, custodial wallets, or other Lightning-enabled applications.
🚧 Work in Progress:
- APIs Under Development: Expect breaking changes as the project evolves.
- Potential Bugs and Inconsistencies: While progress is being made toward stability, unexpected behavior may occur.
- Improved Logging and Error Handling Coming Soon: Current error handling is rudimentary (specially for CLI), and usability improvements are actively being worked on.
- Pending Testing: Not tested, hence don't use it for production!
We welcome your feedback and contributions to help shape the future of LDK Server!
Refer ./ldk-server/ldk-server-config.toml to see available configuration options.
You can configure the node via a TOML file, environment variables, or CLI arguments. All options are optional — values provided via CLI override environment variables, which override the values in the TOML file.
git clone https://github.com/lightningdevkit/ldk-server.git
cargo build
- Using a config file:
cargo run --bin ldk-server ./ldk-server/ldk-server-config.toml
- Using environment variables (all optional):
export LDK_SERVER_NODE_NETWORK=regtest
export LDK_SERVER_NODE_LISTENING_ADDRESS=localhost:3001
export LDK_SERVER_NODE_REST_SERVICE_ADDRESS=127.0.0.1:3002
export LDK_SERVER_NODE_ALIAS=LDK-Server
export LDK_SERVER_BITCOIND_RPC_ADDRESS=127.0.0.1:18443
export LDK_SERVER_BITCOIND_RPC_USER=your-rpc-user
export LDK_SERVER_BITCOIND_RPC_PASSWORD=your-rpc-password
export LDK_SERVER_STORAGE_DIR_PATH=/path/to/storage
cargo run --bin ldk-server
Interact with the node using CLI:
ldk-server-cli -b localhost:3002 --api-key your-secret-api-key --tls-cert /path/to/tls_cert.pem onchain-receive # To generate onchain-receive address.
ldk-server-cli -b localhost:3002 --api-key your-secret-api-key --tls-cert /path/to/tls_cert.pem help # To print help/available commands.
The CLI supports generating shell completions for Bash, Zsh, Fish, Elvish, and PowerShell.
Add completions to your shell config:
# Bash (add to ~/.bashrc)
eval "$(ldk-server-cli completions bash)"
# Zsh (add to ~/.zshrc)
eval "$(ldk-server-cli completions zsh)"
# Fish (add to ~/.config/fish/config.fish)
ldk-server-cli completions fish | sourceContributions are welcome! Please see CONTRIBUTING.md for guidelines on building, testing, code style, and development workflow.