Circuit Breaker (Lightning)

A node-side rate limit on forwarded payments, defending against jamming and abuse.

Basically

You add this tool to a Lightning node to limit the payment traffic each connected peer can send. It helps stop others from blocking your channels or abusing your node.

Key Takeaways

  • A circuit breaker acts as a firewall for your Lightning node. It limits HTLC forwarding per peer and per channel, stopping channel jamming attacks from consuming routing capacity.
  • You can set maximum pending HTLCs, rate limits and an operating mode: fail, queue, or queue with peer-initiated fail. These settings balance protection against lost routing fees.
  • A circuit breaker is a local defence that you control alone. It needs no protocol changes and is one of the few mitigations against Lightning routing attacks that you can deploy today.

What Is a Circuit Breaker?

A Lightning Network circuit breaker is software that acts as a firewall for your routing node. It intercepts incoming HTLCs and applies rate limits before forwarding them. Like an electrical circuit breaker that trips to prevent overload, it rejects or queues excess HTLCs to stop malicious or excessive traffic from exhausting your channel capacity.

Joost Jager, a former Lightning Labs engineer, introduced the concept through the open-source circuitbreaker project. The tool connects to LND via gRPC. It uses the HTLC interceptor API to inspect and control every forwarded payment before it reaches the outgoing channel.

The Lightning protocol allows up to 483 concurrent HTLCs per channel direction without a circuit breaker. One malicious peer can fill all these slots at near-zero cost and block legitimate payments from routing through your node. Configurable per-peer limits cap this exposure.

How It Works

A circuit breaker sits between your node's incoming and outgoing HTLC processing. It checks each HTLC from a peer against your configured limits. It then passes the HTLC through, rejects it, or queues it for later processing.

Operating Modes

Circuit breakers offer three distinct modes. Each mode provides a different balance between protection and routing availability.

Fail mode is the safest default because it prevents liquidity from being locked on the incoming side. It may make your node appear unreliable to pathfinding algorithms. Queue modes are more aggressive: they hold misbehaving peers' HTLCs hostage to create back-pressure, but risk triggering a force-close if HTLCs are held past their timeout. LND v0.16 and above includes auto-fail protection that mitigates this risk.

Configurable Parameters

Operators tune the circuit breaker through a web-based dashboard, available by default at http://127.0.0.1:9235. The primary parameters include:

Example Configuration

The circuitbreaker tool connects to an LND node and provides a CLI and web interface for management. A typical setup:

The web UI shows per-peer statistics, including settled, failed and rejected HTLC counts at hourly and daily intervals. You can set limits for individual peers and choose the operating mode. Configuration changes take effect immediately without restarting the node.

The Problem: Channel Jamming

Channel jamming is a fundamental vulnerability in Lightning's design, and circuit breakers exist to address it. Forwarding HTLCs costs nothing until they settle, so an attacker can lock up your node's entire routing capacity without paying fees. The attack comes in two forms:

Channel jamming attacks are cheap because the attacker ties up their own liquidity for the duration but pays no routing fees when the HTLCs never complete. The damage is asymmetric: one attacker can jam capacity across every hop in a 20-hop route. This amplifies the effect by up to 20x their own locked funds.

A circuit breaker directly counters slot jamming by capping pending HTLCs per peer. Limiting an attacker to 10 pending HTLCs instead of 483 forces them to open roughly 48x more channels at real on-chain cost to achieve the same effect. Rate limiting adds a second layer of defence against rapid-fire spam patterns.

Protecting Routing Nodes

High-volume routing nodes are the primary users of circuit breakers because they earn routing fees by forwarding payments and attract jamming attacks. A jammed routing node loses fee income and degrades the network for all users. Circuit breakers let you protect your capital while continuing to serve legitimate traffic.

Defending Against Competitive Attacks

A malicious node operator could jam a rival's channels in a competitive routing market to divert traffic towards their own routes. Circuit breakers limit the attacker's leverage on each channel. This makes the attack significantly more expensive.

Traffic Shaping

Circuit breakers can shape forwarding traffic as well as provide security. You might set lower limits for peers with poor payment-completion rates and higher limits for peers that consistently forward successful payments. This optimises overall routing revenue and reliability.

Lightning Service Providers

LSPs face heightened jamming risk because they manage channels for many users and play a central role in payment routing. Circuit breakers provide a practical defence that they can deploy immediately. Longer-term protocol solutions are still being developed.

Protection vs. Revenue Tradeoff

Running a circuit breaker involves a core tension: any limit strict enough to stop an attacker will also affect some legitimate traffic. This tradeoff differs by operating mode:

Operators use the monitoring dashboard to tune limits according to observed traffic patterns. Hourly and daily HTLC counters help identify peers sending legitimate traffic and those showing suspicious patterns. You can then make targeted adjustments over time.

Other Jamming Mitigations

Circuit breakers are a local, unilateral defence that requires no cooperation from other nodes and no protocol changes. They sit within a broader ecosystem of proposed channel jamming solutions. Several proposals are progressing towards deployment:

HTLC Endorsement and Reputation

HTLC endorsement is the most advanced protocol-level proposal and is evolving into "accountable signals" under bLIP-4. Nodes track per-peer payment behaviour and flag HTLCs from well-behaved, profitable peers as "endorsed." Endorsed HTLCs receive preferential access to channel slots and liquidity, while unendorsed HTLCs are restricted to a smaller resource pool. Research by Carla Kirk-Cohen and Clara Shikhelman at Chaincode Labs has shown through simulations that this approach can handle 10x current network traffic without increasing payment failures. Experimental support has been added to LND, Eclair and LDK.

Upfront Fees

The "Unjamming Lightning" paper from Chaincode Labs Research, published in November 2022, proposed unconditional fees on all payment attempts, whether they succeed or fail. Charging a small amount makes rapid-fire jamming economically costly. Simulations suggested that a modest 2% fee increase would fully compensate routing nodes for the disruption.

How Circuit Breakers Fit In

Circuit breakers complement protocol-level proposals rather than compete with them. Running one today gives your node immediate protection. You can relax or retire it as HTLC endorsement and upfront fees are deployed across implementations. For a deeper analysis of routing infrastructure, see the Lightning Network routing deep dive.

LND-Only Availability

The circuitbreaker tool is currently specific to LND because it relies on LND's HTLC interceptor API. Node operators running Core Lightning or Eclair have no equivalent standalone tool. Both implementations are adding protocol-level jamming mitigations directly.

Alpha-Quality Software

The circuitbreaker project explicitly warns that it is alpha-quality software. Running it on mainnet nodes with significant capital requires careful monitoring and conservative initial settings. Bugs in the HTLC interceptor path could cause forwarding failures or, in extreme cases, stuck channels.

Incomplete Protection Against Amount Jamming

Circuit breakers effectively counter slot jamming by limiting HTLC count, but offer less protection against amount jamming. One large HTLC within the per-peer limit can still lock up most of a channel's balance. Addressing amount jamming requires protocol-level solutions such as upfront fees, which make holding large HTLCs costly.

False Positives

Legitimate payment spikes, such as a merchant receiving a burst of orders, can trigger circuit breaker limits and cause real payments to fail. You must balance security against the risk of degrading service for honest users. Channels with variable traffic patterns need particular care.

No Network-Wide Coordination

Circuit breakers protect only the node running them, so an attacker can still jam downstream hops without protection. True network-wide resilience requires protocol-level solutions adopted by a critical mass of nodes. The Lightning development community therefore continues to pursue HTLC endorsement and fee-based mitigations alongside local tools like circuit breakers. For more on Lightning Network scaling challenges, see the Lightning Network scalability limits analysis.

The information in this glossary entry is for informational purposes 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