Core Lightning (CLN)

A modular Lightning node implementation written in C, extended through plugins.

Basically

Core Lightning is software for sending and receiving Bitcoin through the Lightning Network. Blockstream maintains it, and you can add features through plugins.

Key Takeaways

  • Core Lightning is a lightweight Lightning Network implementation maintained by Blockstream. It is written mainly in C, follows the BOLT specifications closely, and focuses on correctness and low resource use.
  • CLN keeps its core daemon small and adds extra features through plugins. These plugins communicate through JSON-RPC over stdin/stdout and can be written in Python, Rust, Go, JavaScript, or any other language.
  • Core Lightning was formerly called c-lightning. Blockstream renamed it in April 2022 to reflect its role as a reference implementation focused on interoperability with implementations such as LND and Eclair.

What Is Core Lightning?

Core Lightning (CLN) is one of the main implementations of the Lightning Network protocol, alongside LND from Lightning Labs and Eclair from ACINQ. It enables fast, low-cost Bitcoin payments through Lightning channels between nodes. Payments can travel across a network of these channels without an on-chain transaction for every transfer.

CLN follows a modular design inspired by the UNIX principle of doing one thing well. Its core daemon, lightningd, handles the Lightning protocol, channel management, and peer connections. Plugins handle everything else, from automatic channel management and REST APIs to advanced routing, keeping the core lightweight and auditable while letting you install only the features you need.

Blockstream released the project in August 2015 as c-lightning, making it the first Lightning Network implementation. Rusty Russell, a former Linux kernel developer known for creating iptables, led its development from the start. The project entered production on Bitcoin mainnet in early 2018, when the Blockstream Store launched as one of the first real-world Lightning merchants.

How It Works

CLN uses a multi-process architecture in which the master daemon coordinates specialised subdaemons with separate functions. This process isolation provides defence in depth. A vulnerability in one subdaemon does not automatically compromise the whole system.

Subdaemon Architecture

Lightningd spawns several subdaemons when it starts. Each subdaemon handles a distinct responsibility.

The master daemon passes peer file descriptors to the appropriate subdaemon instead of proxying data. Each channel has its own channeld process, so a crash in one channel does not affect the others. The node implementation comparison provides a deeper look at how Lightning implementations differ.

The Plugin System

Plugins run as standalone processes and communicate with lightningd through JSON-RPC over stdin/stdout. CLN initialises each plugin through a two-step handshake when it starts.

The plugin interface is language-agnostic because it uses JSON over stdio. You can therefore write plugins in any programming language. Official libraries are available for the most common choices.

Plugins can be static or dynamic. Static plugins load at startup through --plugin=, while dynamic plugins start and stop at runtime through the plugin RPC command. You can therefore add or remove functionality without restarting your node.

APIs and Remote Access

CLN exposes three API layers. Each layer builds on the one below it.

The built-in Commando plugin enables remote RPC access over Lightning's own encrypted peer connections, so you do not need separate networking. Authentication uses runes, which are base64-encoded permission tokens. These tokens can restrict which methods may be called, how often they may be called, and for how long.

Notable Plugins

The CLN ecosystem includes dozens of community-maintained plugins. Several stand out for the functionality they provide.

CLBOSS: Automated Node Management

CLBOSS is an autopilot plugin that automates most operational decisions involved in running a Lightning node. It handles these tasks for operators who want hands-off node management.

CLBOSS covers the tasks described in the Lightning channel management guide. You can exclude individual channels from automation with the clboss-unmanage command.

BOLT12 Offers

CLN was the first major implementation to support BOLT12 offers natively. BOLT12 sending and receiving have been enabled by default on all CLN nodes since late 2024. Offers provide reusable payment requests, payer-initiated payments, and refund flows without requiring a web server, making them a significant upgrade over traditional BOLT11 invoices.

Splicing

Splicing lets you add funds to an existing channel or remove funds from it without closing the channel. CLN moved splicing out of experimental status in its April 2025 release, v26.04, with support for splice-in, splice-out, and cross-splicing between channels. The feature interoperates with Eclair, and the splicing deep dive provides technical details.

HSM Key Management

The hsmd subdaemon provides hardware-security-module-style key isolation by keeping all signing operations in a dedicated process separated from network-facing code. New CLN nodes have generated a BIP-39 12-word mnemonic phrase as their root secret since late 2024, replacing the previous binary format. CLN also supports remote signing through external hardware, with the hsmd process delegating to a signing proxy.

xpay Payment Engine

Xpay is CLN's next-generation payment engine, introduced in late 2024. It uses a minimum-cost-flow solver to calculate optimal multi-path payment routes and learns from previous payment attempts to improve future routing decisions. It supports BOLT11 and BOLT12 invoices and can pay BIP-353 human-readable addresses, such as user@domain.com style Lightning addresses.

Use Cases

CLN has a modular architecture that suits specific deployment scenarios. You can shape your node around the features your deployment requires.

CLN vs. LND

CLN and LND are the two most widely deployed Lightning implementations. They take fundamentally different design approaches.

LND and CLN each have advantages, and neither approach is universally better. LND's integrated feature set requires less configuration for common use cases, while CLN's modularity gives operators with specific requirements more flexibility. Both implement the same BOLT protocol and interoperate on the same Lightning Network.

Smaller Ecosystem

LND has a larger share of the Lightning Network by node count. More third-party tools, wallet integrations, and community support are therefore built for LND first. CLN operators may find fewer ready-made solutions and may need to rely more on the plugin ecosystem or custom development.

Plugin Dependency

CLN's modular strength also creates a potential risk because critical functionality can live in plugins maintained by individual developers rather than the core team. Operators who rely on a key plugin such as CLBOSS must find alternatives or maintain forks if its maintainer stops working on it. Community plugins vary in quality and update frequency.

C Language Considerations

C gives CLN strong performance and low resource use, but C programs are more susceptible to memory safety issues such as buffer overflows and use-after-free than programs written in memory-safe languages. The CLN team mitigates these risks through extensive testing and subdaemon isolation. The language choice still involves an inherent trade-off.

Operational Complexity

CLN's modular design requires operators to know which plugins to install and configure for their use case. A new operator running CLN without plugins such as CLBOSS may find the default experience more hands-on than LND's integrated defaults. Tools such as Reckless, the plugin manager, help, but non-technical users still face a steeper learning curve.

This glossary entry provides information only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms