LDK/rust-lightning
is a highly performant and flexible
implementation of the Lightning Network protocol.
The primary crate, lightning
, is runtime-agnostic. Data persistence, chain interactions,
and networking can be provided by LDK's sample modules, or you may provide your
own custom implementations.
More information is available in the About
section.
The project implements all of the BOLT specifications, and has been in production use since 2021. As with any Lightning implementation, care and attention to detail is important for safe deployment.
Communications for rust-lightning
and Lightning Development Kit happen through
our LDK Discord channels.
no_std
and exposes only relatively low-level interfaces.rust-lightning
network stack using the
Tokio async
runtime. For rust-lightning
clients which wish to make direct connections to Lightning P2P nodes, this is
a simple alternative to implementing the required network stack, especially
for those already using Tokio.rust-lightning
channel data persistence and retrieval.
Persisting channel data is crucial to avoiding loss of channel funds.LDK/rust-lightning
is a generic library that allows you to build a Lightning
node without needing to worry about getting all of the Lightning state machine,
routing, and on-chain punishment code (and other chain interactions) exactly
correct. Note that LDK isn't, in itself, a node. For an out-of-the-box Lightning
node based on LDK, see LDK-sample. However, if you
want to integrate Lightning with custom features such as your own chain sync,
key management, data storage/backup logic, etc., LDK is likely your best option.
Some rust-lightning
utilities such as those in
chan_utils
are also suitable for use in
non-LN Bitcoin applications such as Discreet Log Contracts (DLCs) and bulletin boards.
Also check out LDK-node library if you want to easily integrate lightning in your application without taking care of all the boiler plate code.
In general, rust-lightning
does not provide (but LDK has implementations of):
block_connected
/block_disconnected
API which you provide block headers and transaction information to. We also
provide an API for getting information about transactions we wish to be
informed of, which is compatible with Electrum server requests/neutrino
filtering/etc.LDK's customizability was presented about at Advancing Bitcoin in February 2020: https://vimeo.com/showcase/8372504/video/412818125
The goal is to provide a fully-featured and incredibly flexible Lightning
implementation, allowing users to decide how they wish to use it. With that
in mind, everything should be exposed via simple, composable APIs. More
information about rust-lightning
's flexibility is provided in the About
section above.
For security reasons, do not add new dependencies. Really do not add new
non-optional/non-test/non-library dependencies. Really really do not add
dependencies with dependencies. Do convince Andrew to cut down dependency usage
in rust-bitcoin
.
rust-lightning
refers to the core lightning
crate within this repo, whereas
LDK encompasses rust-lightning
and all of its sample modules and crates (e.g.
the lightning-persister
crate), language bindings, sample node
implementation(s), and other tools built around using rust-lightning
for
Lightning integration or building a Lightning node.
"Rust-Lightning, not Rusty's Lightning!"
Contributors are warmly welcome, see CONTRIBUTING.md.
For a rust-lightning
high-level API introduction, see ARCH.md.
License is either Apache-2.0 or MIT, at the option of the user (ie dual-license Apache-2.0 and MIT).