Quantum Threats and the Fragile Privacy of the Lightning Network: How HTLC Preimages and Symmetric Encryption of the Lightning Network Are Resistant to Quantum Attacks with Grover’s Quadratic Speedup Results with Quantum Cryptanalysis of ECDSA Bitcoin is Vulnerable to Shor’s Algorithm

04.11.2026

This paper examines how a probabilistic model of Lightning Network (LN) payment channel balance uncertainty allows us to quantify privacy leakage and payment reliability—and why the same framework is necessary for a fair assessment of quantum threats to Bitcoin cryptography. Building on the preprint by Pickhardt et al. (2021), we show that payment success is determined by the product of path probabilities, the expected number of attempts is \(k/s\), and information leakage is measured by the KL divergence \(\delta=\log(c+1)-\log(a)\). Optimized path selection reduces the number of attempts by 20%, and in combination with BOLT14 rebalancing, by 48%. We relate these results to quantum cryptanalysis: Bitcoin’s ECDSA is vulnerable to Shor’s algorithm, while HTLC preimages and LN symmetric encryption are resistant to Grover-accelerated quantum attacks. The central conclusion is that the quantitative risk assessment culture demonstrated in the LN preprint must be transferred to the analysis of post-quantum migration—otherwise, decisions will be made at the level of slogans, not measurements.

Content

⚙️ Detailed research option

  1. Statement of the problem and intrigue
  2. Mechanism: from HTLC to probabilistic model
  3. History and scientific debate
  4. Infrastructure and scaling
  5. Algorithms and mathematical model
  6. Errors, reliability and correction
  7. Quantum advantage and fair comparison
  8. Experiment and reproducibility
  9. Cryptography and cryptanalysis
  10. Communications and related areas
  11. Practical value and economics
  12. The Future and Open Questions

1. Statement of the problem and intrigue

⚙️ Detailed research option

Questions 1–6

The Lightning Network solves Bitcoin’s scalability problem by moving payments to off-chain channels. But this architecture has a hidden cost:  channel balances are known only to their owners . When choosing a route through a public graph, a sender doesn’t know whether there’s enough liquidity at each hop. They’re forced to resort to trial and error—and each failed attempt  reveals information  about other people’s balances.

A paradox that should intrigue the reader:  “How is it possible to pay securely on a network where the very attempt to pay undermines privacy—and why do quantum computers make this problem even more pressing?”

The hypothesis being tested in this paper is  that the probabilistic balance uncertainty model from the LN preprint is a valid and transferable quantitative risk assessment tool that should be applied to the analysis of Bitcoin/Lightning quantum threats.  A refutation would be a situation where the model fails to reproduce itself in simulation or where quantum threats to LN prove fundamentally inexpressible in the same terms (probability, information, resources).

Research limitations: We do not consider network-level attacks (latency, flooding), model balance dynamics during payment series, or evaluate specific quantum architectures. We focus on  the  quantitative evaluation methodology .

2. Mechanism: from HTLC to probabilistic model

⚙️ Detailed research option

Questions 7–12

A payment in LN is a series of HTLCs (Hashed Time-Locked Contracts) along a path. The recipient generates a secret \(r\), the sender transmits a hash \(H(r)\), and only the disclosure of the preimage \(r\) triggers a balance shift. Atomicity is ensured by the same hash at all hops.

The key abstraction of the preprint is that a channel with capacity \(c\) and balance \(b=b_A\) is modeled by a random variable \(X:\Omega\to[0,c]\). The probability of channel success for a sum \(a\) is:

\(P(X\ge a)=1-P(X<a)\) (1–2)

For a path of \(l\) channels with independent balances:

\(s(a)=\prod_{i=1}^{l}P_i(X_i\ge a)\) (3)

Since each multiplier is strictly less than 1 (the balances are uncertain), the probability of success  decreases exponentially with path length . This is a counterintuitive result: a long path with “good” channels may be better than a short one with “bad” ones, but on average, the exponential doesminate.

For Multi-Part Payments (MPP), the sum \(a\) is divided into \(k\) parts \(a_1,\dots,a_k\); success requires the success of all parts. The model shows that the usefulness of a split depends on three factors: the total sum, the splitting method, and the success probabilities of the paths for each part.

3. History and scientific debate

⚙️ Detailed research option

Questions 13–18

LN has been under development since 2016; MPP is implemented in LND, c-lightning, and Eclair. The problem of balance uncertainty has become a subject of research following work on probing attacks (Herrera-Joancomartí et al., 2019; Tikhomirov et al., 2020). Preprint 2103.08576v1 (March 2021) is the first to propose  a closed-loop probabilistic model linking reliability, optimal partitioning, and information leakage.

A scientific debate: some researchers propose channel rebalancing (BOLT14), others MPP, and still others path selection optimization. The preprint shows that these are not competing, but  complementary  measures: a combination of MPP + path sorting + rebalancing yields the best results.

Quantum context: In August 2024, NIST approved FIPS 203, 204, and 205—post-quantum cryptography standards. This is a historic milestone, but practical migration (NCCoE) is just beginning. The LN preprint is useful as an example of  quantitative  risk assessment, which is missing from the discussion of quantum migration.

4. Infrastructure and scaling

⚙️ Detailed research option

Questions 19–24

The authors use a real-world snapshot of the LN:  an active core  of 137 nodes and 882 channels, obtained by probing 500 random channels (4.3% of those active as of October 2020). A mixed distribution was found: ~30% of channels are bimodal (almost all liquidity is on one side), while ~70% are close to uniform.

137 nodes in the active core

882 channels

500 probed channels

4.3% of active channels

The simulator supports two modes:  static  (balances are fixed, as in a real LN) and  dynamic  (balances are generated anew for each trial, consistent with the theoretical model). This is important for reproducibility: dynamic mode verifies the model, while static mode verifies its applicability.

The bottleneck isn’t throughput, but  uncertainty : it’s uncertainty that causes retries and leaks. Scaling LNs without addressing this problem increases both latency and leaks.

5. Algorithms and mathematical model

⚙️ Detailed research option

Questions 25–30

5.1 Expected number of attempts

⚙️ Detailed research option

Through negative Bernoulli tests, the authors deduce:

\(E[n]=\frac{k}{s}\) (8)

For a single-component payment, \(E[n]=1/s\). For \(s=0.5\) this means 2 attempts, for \(s=0.1\) it means 10. The formula doesn’t mean that splitting is always beneficial: \(k\) grows, but \(s\) also grows due to smaller amounts. The optimum is found by comparing the curves \(E[n]=k/s(a/k)\).

5.2. Service Level Objective

⚙️ Detailed research option

How many attempts are needed for a payment to go through at least once with probability \(\sigma\)?

\(n>\frac{\log(1-\sigma)}{\log(1-s)}\) (10)

For \(s=0{,}1\) and \(\sigma=0{,}99\), 44 attempts are needed; for \(s=0{,}5\) — only 7. Hence the practical conclusion:  increasing \(s\) at each hop is more important than shortening the path at any cost .

5.3. Optimal crushing

⚙️ Detailed research option

Break-even points (Equation 16–17): for \(s(a)<0.3\) it is profitable to split into two parts, for \(s(a)<0.1\) it is profitable to split into three parts. For a path with \(l=2\) and \(k_2=4\), \(k_1=1\), the threshold is \(4c/7\). This is  an analytically closed  result—a rarity for payment networks.

5.4. Information leak

⚙️ Detailed research option

With a uniform prior, the entropy is \(H=\log(c+1)\). After an unsuccessful attempt for the sum \(a\):

\(\delta=\log(c+1)-\log(a)\) (19)

The smaller \(a\), the smaller the leakage. But small payments are more often successful, so the paradox arises:  cheap attempts are more informative per unit of effort . For a successful attempt, \(\delta=\log(c+1)-\log(c-a+1)\).

6. Errors, reliability and correction

⚙️ Detailed research option

Questions 31–36

With a uniform distribution of balances, the probability of success of the path is:

\(s(a)=\left(\frac{c+1-a}{c+1}\right)^{l}\) (uniform case)

The preprint graphs (Figs. 4–5) show that for \(a=10\%\) capacity and \(l=4\) the success is ~65.9%; for \(a=50\%\) and \(l=5\) it is almost zero.  The exponent in \(l\)  is the main enemy of reliability.

“Error correction” here refers not to codes, but  to architectural measures : MPP, rebalancing, and path selection. The preprint shows that MPP improves reliability only up to a certain limit: when \(k\) is too large, the hop-count exponent begins to dominate. This is an important limitation that is often ignored in popular discussions.

Connection to the quantum topic:  in quantum computing, error correction is a central problem. In LN, “correction” is probabilistic routing. In both cases,  one cannot evaluate the system based on the ideal case ; an error model and fair metrics are needed.

7. Quantum advantage and fair comparison

⚙️ Detailed research option

Questions 37–42

Here we move from LN to the quantum threat. Bitcoin uses ECDSA (secp256k1). Shor’s algorithm theoretically solves the discrete logarithm problem in polynomial time. But there’s a huge gap between “theoretical” and “practical.”

AspectLN preprintThe Quantum Threat of ECDSA
What is being compared?Baseline vs Maximum Likelihood path selectionClassical vs. quantum cryptanalysis
MetricsAverage number of attemptsLogical/physical qubits, time
ConditionsSame pairs, same sumsSame error model, same assumptions
What is taken into accountPreparing paths, retries, leakageError correction, overhead, decoherence
HonestyComparison with a realistic baselineYou can’t promise a “hack tomorrow” without a resource assessment

The key thesis is  that quantum advantage must be proven under comparable conditions . This is accomplished in the LN preprint: the optimized path selection is compared with a baseline similar to real-world implementations. In quantum cryptography, the same rigor is required when comparing Shor’s algorithm with classical methods (NFS for factorization, Pollard rho for the discrete logarithm).

Important: The quantum threat to LN is heterogeneous. HTLC preimages are hashes; Grover’s attack provides only a quadratic speedup, and a 256-bit hash remains secure. Onion encryption (ChaCha20) is symmetric and also secure with a sufficient key length. It is  the ECDSA signature  in the Bitcoin blockchain, which underpins LN, that is vulnerable.

8. Experiment and reproducibility

⚙️ Detailed research option

Questions 43–48

Simulation on a real LN snapshot: 100 random sender-recipient pairs, amounts 1–20 mBTC. Results:

StrategyAverage number of attemptsRelative improvement
Baseline (random selection, sorted by length)1.54—
Maximum Likelihood (sorted by \(s(a)\))1.28-20%
Baseline + rebalancing (BOLT14)~1.2intermediate
Maximum Likelihood + rebalancing~1.0-48%

Information leakage (Fig. 10): the median value increases with the amount, peaking at around 80% of the channel’s capacity, then declines. At amounts close to capacity, failure is “expected” and of little informational value. For MPP, the pattern scales: for small amounts, splitting is unnecessary; after ~45% of capacity, splitting two shares is beneficial; after ~74%, splitting three shares is beneficial.

Reproducibility: The authors use open-source Gossip data and their own probing results. The simulator code is not fully disclosed in the preprint—this is a limitation. There is a similar limitation for the quantum domain: resource estimates for Shor’s algorithm are highly dependent on the architecture and error model, and without open-source parameters, they are difficult to compare.

9. Cryptography and cryptanalysis

⚙️ Detailed research option

Questions 49–56

Let’s look at which mechanisms of LN and Bitcoin are affected by quantum attacks:

MechanismTypeQuantum threatStatus
ECDSA (secp256k1)Asymmetric signatureShor’s Algorithm: Polynomial TimeVulnerable  with enough qubits
HTLC preimage (SHA-256)HashGrover: \(\sqrt{2^{256}}=2^{128}\)Stable in practice
Onion encryption (ChaCha20)SymmetricalGrover: quadratic accelerationResistant to 256-bit keys
HMAC in onionMACGroverStable

When is an ECDSA public key available to an attacker? In Bitcoin, it’s when an output is spent (the key is revealed in the script) or in reused addresses. For Lightning, it’s important that channels are opened by on-chain transactions; their signatures are also ECDSA. Thus,  a quantum threat to Lightning is primarily a threat to the parent blockchain , not to the payment protocol itself.

Differences between QKD and post-quantum cryptography (question 53): QKD solves the key distribution problem but requires a dedicated quantum channel and trusted hardware; PQC (FIPS 203/204/205) is a software replacement compatible with existing infrastructure. For the Lightning Network, PQC-based migration of Bitcoin signatures is more practical than QKD.

What cannot be claimed is  that a quantum computer will “hack Lightning tomorrow.” The correct formulation is: “Under certain resource assumptions, Bitcoin’s ECDSA signatures may be compromised; this poses a risk to the on-chain component of Lightning; the specific timeframe is unknown and requires resource estimates.”

10. Communications and related areas

⚙️ Detailed research option

Questions 57–62

LN is a payment network, not a quantum communications network. Nevertheless, the transfer of ideas is useful:

  • Metrics:  in LN—probability of success and number of attempts; in quantum communications—state fidelity, losses, speed. The common denominator is the need for  fair comparison under identical conditions .
  • Intermediate nodes:  in LN, onion routing hides the sender and receiver; in quantum networks, it’s trust in relays. Both topics require a threat model.
  • Sensors:  Quantum sensors and LN are not directly related, but the methodology for assessing sensitivity and stability is similar to assessing the reliability of payments.
  • Quantum simulation:  the LN (static/dynamic) simulator is an example of how a probabilistic model is verified by experiment. Quantum simulation follows the same principle: the model must be reproducible on a real device.

11. Practical value and economics

⚙️ Detailed research option

Questions 63–68

Who benefits from this result?  Lightning node operators, wallet providers (Zap, LND, c-lightning), privacy researchers, and developers of post-quantum standards.

A minimal demonstration:  a 20% reduction in the average number of attempts without changing the protocol—this is a measurable and verifiable result. For a quantum topic, a similar demonstration is a resource assessment with open parameters.

Cost:  Optimized path selection requires computing \(s(a)\) for paths; this is cheap compared to network latency. Rebalancing requires on-chain transactions and fees. Post-quantum Bitcoin migration will require a hard or soft fork and coordination—this is expensive.

Risks:  privacy leakage (probing), vendor dependency, dual use (de-anonymization), risk of “false security” during hasty PQC migration.

Economic conclusion:  privacy and reliability in LN are not free goods. Improving them requires resources. Quantum migration does the same. The researcher’s task is to show  the cost-benefit curve , not to promise “everything at once.”

12. The Future and Open Questions

⚙️ Detailed research option

Questions 69–75

  1. Dynamic simulation:  The preprint acknowledges that it does not model a series of payments that change balances. This is an open problem.
  2. Optimal splitting strategies:  equal shares are not always optimal; strategies that take into account the rebalancing of one’s own channels are needed.
  3. Post-quantum LN:  How will the protocol change when Bitcoin switches to PQC signatures? Will this impact transaction sizes and fees?
  4. Anti-probing:  Is it possible to add noise to HTLC errors to reduce information leakage without breaking compatibility?
  5. Quantitative Quantum Resource Assessment:  An Open Source Model Similar to the LN Simulator is Needed for Architecture Comparison.
  6. Connections to other works:  Boomerang (reserve payments), Flare/Spider (routing) – their metrics can be compared with the preprint model.
  7. New question to test:  “Under what resource assumptions does a quantum attack on ECDSA become cheaper than the economic damage it incurs—and how does this compare to the cost of PQC migration?”

Conclusion

⚙️ Detailed research option

Preprint 2103.08576v1 provides a rare example of  a closed-loop quantitative model  for a system with uncertainty: from channel success probability to optimal partitioning and information leakage. We demonstrated that this framework is transferable to the analysis of quantum threats: both problems require probabilistic estimates, a fair baseline, and explicit constraints.

The key takeaway for the reader:  the development of quantum technologies is not only a race for qubits, but also a race for the quality of risk assessments . The LN preprint shows what such assessment looks like in a mature engineering field. Post-quantum cryptography deserves the same level of rigor.

Reference sources

⚙️ Detailed research option

  1. Pickhardt R., Tikhomirov S., Biryukov A., Nowostawski M.  Security and Privacy of Lightning Network Payments with Uncertain Channel Balances . arXiv:2103.08576v1, 2021.
  2. National Quantum Initiative. Quantum science areas: computing, networks, sensors.
  3. NIST. FIPS 203, 204, 205 (Post-Quantum Standards), August 2024.
  4. NIST NCCoE. Migration to Post-Quantum Cryptography.
  5. Herrera-Joancomartí J. et al. On the Difficulty of Hiding the Balance of Lightning Network Channels. AsiaCCS 2019.
  6. Tikhomirov S. et al. Probing Channel Balances in the Lightning Network. arXiv:2004.00333, 2020.
  7. Pickhardt R. BOLT Pull Request 780: BOLT14 Friend of a Friend Balance Sharing, 2020.
  8. Shor P. Algorithms for Quantum Computation: Discrete Logarithms and Factoring. FOCS 1994.
  9. Grover L. A Fast Quantum Mechanical Algorithm for Database Search. STOC 1996.