Research
LNTest: A Testbed for Evaluating Bitcoin Lightning Network-Based Botnets
Two prior designs, LNBot and D-LNBot, showed that Bitcoin's Lightning Network can carry botnet commands as ordinary-looking keysend payments, but both were evaluated only in simulation.

- arXiv
- 2606.12887
- Published
- 2026-06-11
- Authors
- Thomas Bakaysa, Ahmet Kurt, Abdul-Salem Beibitkhan, Jesus Maria Romo Diaz de Leon, Tag Kalat, Joshua Kramer, Estela Rodriguez, Abraham Watkins, Abdullah Aydeger
AI summary
Overview
Research area: Blockchain security and botnet command-and-control (C&C) — specifically, using Bitcoin's Lightning Network (LN) as a covert C&C channel, and building reproducible infrastructure to study it.
Technical level: Intermediate to Advanced. Readers should be comfortable with payment channels, HTLCs, keysend payments, graph topology, and containerized testbeds; the paper explains LN fundamentals but assumes familiarity with networking and botnet literature.
Scope (one sentence): The paper introduces LNTest, a Docker-based testbed of Core Lightning nodes on a Bitcoin regtest chain, and uses it to measure how three overlay topologies affect command propagation speed and resilience to takedowns.
What This Paper Is About
Two prior designs, LNBot and D-LNBot, showed that Bitcoin's Lightning Network can carry botnet commands as ordinary-looking keysend payments, but both were evaluated only in simulation. That left open whether D-LNBot's peer-discovery protocol actually builds the uniform chain it describes, whether its claimed O(m log n) propagation holds on real Lightning software, and how vulnerable different overlays are to partial takedowns. The authors build LNTest — a reusable testbed of real, unmodified Core Lightning nodes containerized with Docker over a shared Bitcoin Core regtest chain — and run the first experimental study of LN-based botnet topologies on production-grade nodes.
Key Contributions
- A reusable testbed. LNTest is presented as the first testbed for LN-based botnets, with three overlay modes — a deterministic D-LNBot chain, autonomous peer discovery, and user-supplied graphs from a JSON file — so topology can be a controlled experimental variable.
- First real-node run of D-LNBot's formation protocol. Running it in autonomous mode at
n = 20andn = 50(both withm = 4) does not produce the uniform chain from the original design; it produces a "clustered chain" of cliques joined by bridge nodes whose removal fragments the network. - Corrected propagation complexity. Measured over 10 to 500 C&C nodes at
m = 4, delay grows linearly,Θ(n), not theO(m log n)D-LNBot claimed — and is effectively flat in the neighbor countm. - Topology-dependent takedown analysis. Random and targeted removals at 10%–50% across three topologies (
n = 50,m = 4) show that structure, not just botnet size, decides whether a takedown fragments the overlay. - Open-source release. Code, documentation, and a script reproducing all experiments at
https://github.com/ThomasBakaysaJr/LNTest.
Main Findings
- Linear, size-bound propagation. In D-LNBot mode with
m = 4and mid-chain injection, delay fitst = 0.143n − 1.20(R² = 0.993) up ton = 100, adding about 0.14 s per C&C server; atn = 100the mean delay is 13.5 s. Atn = 500the mean is 104 s, with 100% coverage at every size and no command ever lost. - A second, steeper regime above 100 nodes. From
n = 100upward the fit becomest = 0.229n − 11.28(R² = 0.998), so per-node cost rises from 0.14 s to 0.23 s. The authors attribute this to slower per-keysend HTLC settlement on busier channel graphs, not to longer paths (hop count stays at⌈n/(2m)⌉) and not to host resource limits (roughly half of the 16 CPU cores used even atn = 500). - Why the logarithmic claim fails. The real overlay is a chain of overlapping neighborhoods, not an
m-ary tree: each hop advances the wavefront only ~mpositions while costing ~min relay time, soT ≈ (n/(2m)) · m = Θ(n). The authors argue this is a lower bound as well as an upper bound. - Autonomous formation creates a clustered chain, not a uniform chain. At
n = 20andn = 50the topology was a sequence of cliques of roughlymnodes at degree2m = 8, ringed by peripheral nodes at degreem = 4, joined by bridge nodes. The degree distribution is roughly bimodal at 8 and 4. - Cliques arise from concurrent discovery. Because each node keeps scanning while active and accepts peers until
mhave connected, and new nodes arrive roughly every 30 s (the median), aboutmnodes end up forming concurrently and interconnect. Atn = 20, all five formations produced the identical clustered chain with two bridges (CC9 and CC17); atn = 50, the bridge count varied between two and four across five formations. - Comparable speed, worse structure. At
n = 50andm = 4injected from CC25, the ideal chain has average degree 7.6, diameter 13, zero bridge nodes, mean delay 5.58 s and 100% coverage; the clustered chain has average degree 6.2, diameter 12, 2–4 bridge nodes, mean delay 5.45 s and 100% coverage. In the representative run, removing the four bridges split the overlay into five components. - Uniform-degree chains resist targeted removal. Under random removal the D-LNBot chain holds 100% coverage (delays around 5 s) through 30% and partitions at 40%, falling to 57%. Under targeted removal it partitions already at 10% — yet coverage there is 91%, higher than random removal at 40%, and stays at 84% even at 50%. The reason: 42 of the 50 nodes share degree
2m = 8, so degree ranking carries no signal; the strategy removes consecutive index blocks (CC5–CC9 at 10%, CC5–CC14 at 20%), making one clean cut and orphaning only CC1–CC4. - Scale-free (Barabási–Albert) graphs show the mirror image. Random removal leaves 100% coverage through 30%, 97% at 40%, and 92% at 50%. Targeted removal gives 100% at 10%, then 98% at 20%, 60% at 30%, 30% at 40%, and 20% at 50% as hubs are stripped away.
- The clustered chain is fragile to both. Random removal drops coverage from 100% at 10% to about 68% at 20% and roughly 45% at 50%; targeted removal gives 93% at 10%, 83% at 20%, and 26% at 50%. It is the only one of the three topologies that fragments under both strategies.
- Neighbor count barely matters. Table 2 (mean delay in seconds, mid-chain injection) is essentially flat in
m: atn = 50, 5.60 / 5.45 / 5.74 / 5.38 / 5.63 s form = 2through 6; atn = 100, 11.79 / 12.67 / 13.46 / 13.50 / 13.67 s; atn = 200, 26.20 / 29.74 / 32.41 / 33.84 / 35.05 s. - Note on scope of the provided text. The supplied content ends mid-sentence in Section 5.4, so the analyses of Sections 5.5, 5.6, 6 and 7 (and any figures or results they contain) are not reported here.
Methodology in Plain English
Everything runs on a single workstation. A Bitcoin Core node in regtest mode — a private chain the researchers fully control, where blocks are mined on demand — runs on the host and provides the on-chain layer for channel funding and confirmations. Each Lightning participant is an unmodified Core Lightning node inside its own Docker container, sharing the host's network namespace and bound to 127.0.0.1 on a deterministic port, so no traffic ever leaves the machine. Four logical roles exist: the C&C servers that form the botnet overlay, a botmaster that injects commands, an "innocent node" used as a rendezvous point during autonomous discovery, and a Python orchestrator that drives experiments and reads node state from POSIX shared memory rather than parsing logs.
Overlays are built three ways. In D-LNBot mode the orchestrator itself opens the exact chain channels (node CC_i links to its m immediate predecessors). In custom mode it wires an arbitrary graph read from JSON. In autonomous mode it launches containers one at a time with log-normal delays (median 30 s, clamped to [10, 90] s) and lets each node find peers through a shared capacity-based rule, with a small Core Lightning plugin capping inbound C&C channels at 2m.
Commands travel as standard keysend payments with the command text and a sequence counter placed in a custom TLV field, which onion routing keeps readable only to the final recipient. Receiving nodes forward immediately and in parallel to every neighbor, using the counter to discard duplicates from flooding. The primary metric is propagation delay — time until the last surviving C&C node receives the command — with each data point repeated 10 times and reported as a mean, plus coverage, the fraction of surviving nodes reached.
For takedowns, nodes are removed cumulatively at 10%–50%, either at random or by highest degree first; after each step the botmaster re-injects from the highest-degree node in the largest surviving component, and a command that stalls for 60 s before reaching every survivor counts as a partition.
Why This Matters
Impact on research. The paper turns two simulation-only prototypes into measurable, reproducible claims, and it corrects a complexity result — O(m log n) becomes Θ(n) — that downstream work may have taken at face value. Releasing the testbed with a reproduction script gives defenders a controlled environment where topology, botnet size, neighbor connectivity, injection point and takedown strategy are independent variables, filling a gap left by IoT/DDoS testbeds such as DDoSim and DDoShield-IoT, which do not model blockchain- or payment-channel-based C&C.
Real-world applications:
- Law-enforcement and incident-response planning: choosing between random sinkholing and targeted hub removal based on the observed overlay structure, rather than botnet size alone.
- Detection engineering: the capacity-based discovery rule and TLV-embedded commands are concrete artifacts that monitoring tools on Lightning nodes could look for.
- Node-operator risk assessment: understanding how channel-opening patterns and gossip exposure can reveal or expose C&C infrastructure.
- Network-science experiments: reusing the custom-graph mode to test resilience hypotheses on real LN node software using snapshot topologies.
Industry relevance. The findings line up with prior empirical work on the real Lightning Network — high centralization with the top 5% of nodes carrying the vast majority of payment routes (Zabka et al.) and centrality-based removal disconnecting the LN with only a small fraction of nodes removed (Rohrer et al.). For anyone operating routing nodes or building LN monitoring, the paper shows that low-cost, near-instant payments are a viable covert channel and that network structure, not just scale, governs how hard such an overlay is to dismantle.
Future Directions
- Close the gap between chain analysis and deployed reality. The study stops at 500 nodes in a single-host
regtestenvironment; extending to multi-host or geographically distributed setups — and to the unmeasured Sections 5.5/5.6 analyses left out of this excerpt — would test whether the second, steeper linear regime persists. - Detection and defense. The paper frames LNTest as support for research on defenses, but no countermeasure is evaluated here; the discovery rule, the
2minbound cap, and the TLV-embedded sequence counter are candidate detection signals worth testing. - Topology-aware takedown strategy. Since degree-based targeting fails on uniform-degree chains while succeeding on scale-free graphs, a natural next question is a strategy that first infers overlay structure and then selects removals accordingly — the paper identifies the problem but does not propose such a strategy.
- Broader topology space. Custom mode supports small-world networks, real LN snapshots, and hand-crafted graphs, but the reported experiments cover only three topologies (
n = 50,m = 4); other structures and larger takedown sweeps remain unexplored.
Target Audience
Blockchain and network-security researchers; defenders and incident responders working on botnet takedowns; Lightning Network node operators and protocol engineers interested in abuse of keysend and gossip; and graduate students or tooling developers who need a reproducible experimental platform for payment-channel-network security. Readers focused on purely theoretical complexity results will find the empirical correction most valuable.
Authors’ abstract
Bitcoin's Lightning Network (LN) can be exploited as a covert, low-cost command-and-control (C&C) channel for botnets, as demonstrated by the LNBot and D-LNBot designs. However, both remain proof-of-concept prototypes evaluated only through simulation, leaving key questions about real-world topology formation, propagation complexity, and resilience to takedowns unanswered. We present LNTest, the first reusable testbed for LN-based botnets, built from Core Lightning nodes…
The full abstract on arXiv