When the Discrete Logarithm Disappears: JugglingSwap as a Test Case for the Quantum Resilience of Atomic Cross-Chain Swaps

07.11.2026

A research paper based on arXiv:2007.14423v1 (O. Shlomovits, O. Leiba, KZen Research) The main lesson: interoperability and quantum security are orthogonal axes. JugglingSwap maximized the former while minimizing the latter. The next generation of protocols must optimize both simultaneously—and this is where the most interesting research niche lies: the hypothesis being tested, the criterion for its refutation, and the consistent analysis of the original proofs. The numbers, lemmas, and architectural details are taken from JugglingSwap; the quantum estimates are from open NIST standards and classic works on Shor’s algorithm.

Content

⚙️ Detailed research option

  1. Intrigue: An improvement that is also a vulnerability
  2. What JugglingSwap Built: A Deep Dive
  3. The Cryptographic Foundation and Its Quantum Price
  4. Lineage: From HTLC to Scriptless Swaps
  5. Selected test questions
  6. Hypothesis and refutation criterion
  7. Evidence, metrics, and fair comparison
  8. Post-quantum port: what can be replaced and what can’t
  9. Limitations and weaknesses of the analysis
  10. Next experiments
  11. Conclusions
  12. Sources

1. Intrigue: An improvement that is also a vulnerability

⚙️ Detailed research option

In 2020, Omer Shlomovitz and Oded Leyba proposed  JugglingSwap  , an atomic cross-chain swap (ACCS) protocol that relaxes the requirements for participating blockchains to a minimum: only a threshold variant of the underlying signature scheme and the Elliptic Curve Discrete Logarithm Problem (ECDLP) are required. This dramatically expands interoperability: Bitcoin ↔ Ethereum and EdDSA chain ↔ ECDSA chain pairs become permissible where previous scriptless protocols required a common curve and a single generator.

But it’s precisely this weakening that’s the quantum time bomb. ECDLP is exactly the problem that Shor’s algorithm solves in polynomial time on a sufficiently large quantum computer. JugglingSwap’s architectural trick (gradually releasing secret segments through verifiable encryption) is elegant, but its cryptographic substrate—homomorphic ElGamal, Bulletproofs, and threshold ECDSA—is completely breakable by a quantum adversary.

The central question of the article is:  Does  the architectural idea of  ​​JugglingSwap—segmented verifiable encryption and gradual secret disclosure—preserve if a quantum adversary nullifies ECDLP, and can this idea be transferred to post-quantum assumptions?

This question is important not only for cryptography. Cross-chain swaps are the infrastructure layer of blockchain interoperability; if their foundation collapses, so do the economics of bridges, DEXs, and settlement systems. The answer to “yes, the idea is portable” or “no, it’s tied to curve algebra” determines where to focus engineering efforts in the next 5-10 years.

2. What JugglingSwap Built: A Deep Dive

⚙️ Detailed research option

2.1 Two models of value transfer

⚙️ Detailed research option

The authors make a subtle observation: value on a blockchain can be transferred in two ways:  through a transaction signed by a key or  by transmitting the private key itself . All known ACCSs as of 2020 use the first approach: it either relies on the blockchain’s scripting capabilities (HTLC) or on the mechanics of a specific signature scheme (Schnorr/ECDSA scriptless scripts). The second approach is purely cryptographic, with little variance between blockchains, and is therefore more portable.

2.2 Three Key-Passing Problems and JugglingSwap’s Response

⚙️ Detailed research option

  1. Copying instead of alienating.  Sharing a key does not deprive the sender of knowledge of the key—unlike a transaction, which “cuts off” access.
  2. Dishonesty.  The first party to send the ciphertext risks the other party not completing the protocol.
  3. The fragility of trust.  Without additional mechanisms, parties must trust each other in the moment.

The answer is built from two blocks:

  • Threshold cryptography layer.  Each owner shares a {2,2} address with the provider. For the swap, two {3,3} addresses are created—one on each chain. No one has the full key.
  • Juggling Primitive.  A new verifiable encryption (VE) for transmitting  discrete logarithm segments  . The prover encrypts the secret piecemeal and proves that each ciphertext is indeed an encryption of a segment of the secret of a known public key under a known encryption key.

2.3 Formal construction

⚙️ Detailed research option

Let G be an elliptic curve group of prime order q with generator G. The secret x is partitioned into m segments of length l bits: x = Σ f_k [x]_k, where f_k = 2^{(k-1)l}. For each segment, the homomorphic ElGamal “in exponent” is calculated:

{D_k, E_k} = { [x]_k·G + r_k·Y, r_k·G }

D_k and m bulletproof range proofs (that the value is less than 2^l) are published, then the aggregates D = Σ f_k D_k, E = Σ f_k E_k and a proof of correct encryption DLog with witness (x, Σ f_k r_k). Decryption of the segment: D_k − y E_k = [x]_k G, after which [x]_k can be extracted by brute force in O(2^l).

Swap protocol:

  1. The parties and provider S generate two {3,3} addresses (one per chain).
  2. Each owner deposits funds to their source address.
  3. Two  alternating  Juggling protocols are launched: the parties exchange segments of their key shares.
  4. Each owner, together with S, signs the withdrawal of funds from someone else’s {3,3} address to their wallet.

The key guarantee of partial honesty.  If step 3 fails, the honest party’s maximum advantage is  one segment . For small l, this is acceptable. The provider can be replaced with a TEE (but the authors themselves cite attacks on SGX—Foreshadow).

2.4 What does the protocol provide in practice?

⚙️ Detailed research option

  • Scriptless.  Blockchain footprint: 1–2 regular transactions per chain; gains in throughput, fungibility, and privacy.
  • Interoperability.  A significantly larger set of chain pairs is supported than Poelstra and Malavolta: only threshold signature + ECDLP are required.
  • Implementation.  Bitcoin↔Ethereum on secp256k1; {2,2}-ECDSA according to Lindell; m = 32, l = 8; DLog brute-force (in production — algorithms in 2^{l/2}).

3. Cryptographic foundation and its quantum price

⚙️ Detailed research option

JugglingSwap’s security rests on four pillars. It’s helpful to explicitly list them and test each for quantum resistance.

SupportWhere in the articleAssumptionQuantum status
ElGamal’s CPA strength “in terms of performance”Lemma 1DDH in the curve groupBreaks by Shor’s algorithm (DDH ⊂ ECDLP complexity)
Correctness of the segmental proofLemma 2, Claims 1–2Binding Pedersen + soundness BulletproofsBinding = DLog; breaks
Unforgeability of the threshold signatureDefinition 1EUF-CMA for ECDSA/SchnorrBreaks with Shor
Extracting a segment from [x]_k·G§3.3, step 3ECDLPBreaks with Shor

Direct consequence.  A quantum adversary with a sufficient number of logical qubits recovers each share x_i^j from its local public key Q_i^j (which is public by the construction of the {3,3} generation). After this, the {3,3} threshold degenerates into “1 in 3” from the attacker’s perspective, and juggling the segment exchange becomes meaningless: the secret is already known. The protocol is vulnerable  in its entirety , not just partially.

It’s important to emphasize: this isn’t an implementation flaw or the authors’ negligence. It’s a legitimate consequence of the chosen threat model, which didn’t consider a quantum adversary. JugglingSwap of 2020 is  classical cryptography  taken to the elegant limit of interoperability.

4. Line of Succession: From HTLC to Scriptless Swaps

⚙️ Detailed research option

To understand JugglingSwap’s place, it’s helpful to build a chain of works cited by the original source. This is what it means to “link multiple works into a coherent study.”

JobContributionRequirements for chainsPrimitive of concealment
TierNolan (2013), HTLCThe first atomic construction: hash-lock + timelockScriptsHash preimage
Herlihy (2018)Formal theory of ACCSAny with timelocks—
Poelstra (2017), scriptless scriptsScriptless swap via SchnorrSchnorr, general curveThe signature reveals the secret
Malavolta et al. (2019)Extension to ECDSAECDSA, general curve and generatorECDSA signature
JugglingSwap (2020)Threshold signatures + segment VEThreshold-only option + ECDLPElGamal + Bulletproofs

Narrative: each generation has relaxed the assumptions about blockchains and strengthened interoperability. JugglingSwap is the pinnacle of this line in terms of interoperability. And simultaneously, it is the pinnacle in terms of ECDLP dependence: while HTLC relies at least on a hash function, JugglingSwap relies on ECDLP  across all four pillars .

A side note.  The paper makes a neat observation: the same mechanism can be used twice for the path b₁ → b₂ → b₁, resulting in mixing. This is another argument in favor of the architectural value of Juggling—and another asset that a quantum adversary nullifies.

5. Selected test questions

⚙️ Detailed research option

Sixteen general and seven crypto-specific questions were selected from the constructor—a focused set tailored to the hypothesis. Each question is answered specifically for JugglingSwap.

No.QuestionReply to JugglingSwap
1What problem does the technology solve and for whom?Blockchain interoperability without a custodial intermediary; for crypto asset owners, DEXs, and bridges.
4The hypothesis being tested and what will disprove it?See §6: portability of the architecture to PQC primitives; refutation: lack of an efficient PQ analogue of the segmented VE.
7Physical/mathematical mechanism?Progressive issuance of DLog segments via homomorphic ElGamal + range proofs + proof of encryption correctness.
9Which effects are necessary and which are decorative?Required: additive homomorphism, binding obligations, soundness range proof. Decorative: specifically ElGamal—it can be replaced while preserving its properties.
14Turning points?Scriptless scripts (Poelstra), ECDSA extension (Malavolta), threshold swap (JugglingSwap).
15Competing approaches?HTLC, scriptless Schnorr/ECDSA, TEE (Tesseract), Lightning-like escrow (Arwen).
18Connection with previous works?JugglingSwap  extends  Poelstra/Malavolta in interoperability and  replaces  the scripting layer with threshold cryptography.
25How is a task translated into a formal object?Secret → m-segmentation → m ciphertexts + m+2 proofs → gradual publication E_k.
29Depth, number of operations, connectivity?2m+1 proofs; 1–2 transactions per chain; communication is linear in m.
37Classic baseline?HTLC and scriptless Schnorr/ECDSA; JugglingSwap is cheaper than scripted alternatives.
39What is claimed: theory, experiment, benefit?Theorem 1 (in ROM), Bitcoin↔Ethereum implementation, practical benefit – interoperability.
43Basis for conclusion?Lemmas 1–2, Claims 1–2, Theorem 1; empirical proof — PoC implementation.
46Reproducibility?The code is open source (github KZen-networks/JugglingSwap), Rust + Node.js; parameters m=32, l=8.
69Open issues?Quantum hardness; optimal l; {3,3} on new threshold-ECDSA; PQ-port.
70Next experiments?PQ instantiation of VE and range proofs; proof size and round count measurements.
75New question from the comparison?Is there a lattice analogue of “VE in exponent” with acceptable proof size?
49What crypto problem?ECDLP (segment extraction), DDH (ElGamal), EUF-CMA (threshold signature).
50What quantum algorithm?Shor’s algorithm for ECDLP and DDH; Grover’s algorithm is only a quadratic speedup of the search, not critical.
51Resource assessments?Evaluating logical/physical qubits for 256-bit curves is the subject of a separate work; for JugglingSwap, it’s more important that  the entire  stack breaks at once.
52Threat model?A quantum adversary with access to the public keys of Q_i^j; in JugglingSwap, they are public by construction.
54Bitcoin: Mechanism and Key Availability?ECDSA/secp256k1 signatures; the public key is revealed when the UTXO is spent—a classic attack point.
55Migration measures, standards, costs?NIST FIPS 203/204/205; NCCoE migration; cost – replacement of threshold scheme, VE, and range proofs.
56What is confirmed by experiment and what is an estimate?Classical swap experimentally confirmed; quantum vulnerability – theoretical assessment based on Shor.

6. Hypothesis and refutation criterion

⚙️ Detailed research option

H1.  JugglingSwap’s security fully inherits the security of ECDLP and is therefore nullifiable by a quantum adversary.

H2.  The “segmented verifiable encryption + gradual issuance” architectural pattern is not tied to the discrete logarithm at the conceptual level and allows for reinstantiation on post-quantum primitives.

H3.  Due to H2, a JugglingSwap-like architecture is more promising for migration than an HTLC approach, where secret hiding is strictly tied to the hash preimage and timelocks.

Refutation Criterion H2/H3:  If it turns out that a segment VE with publicly verifiable segment correctness proofs has no effective post-quantum analogue—or requires an algebraic structure (additive exponent homomorphism) inaccessible on lattices—then the conjecture is refuted. Then JugglingSwap remains a beautiful solution, but a dead end for PQ migration.

Confirmation criterion:  the existence of a lattice VE scheme that allows segmentation of a secret with a segment correctness proof and a range proof, with proof sizes comparable in order to Bulletproofs (units of kilobytes), and while maintaining partial honesty with an advantage of one segment.

7. Evidence, metrics, and fair comparison

⚙️ Detailed research option

7.1 What exactly does the original source prove?

⚙️ Detailed research option

  • Lemma 1.  ElGamal is CPA-resistant “in exponent” while being DDH-resistant. Proof: independent r_k make the ciphertexts unrelated.
  • Lemma 2.  A system of 2m+1 proofs forms a proof of correct encryption of the k-th segment of DLog.
  • Claim 1.  The ciphertext of a segment not of the form [x]_k + b_k passes verification with probability negl(λ).
  • Claim 2.  For b_k ≠ 0, verification passes with negl(λ); the key argument is that Bulletproofs prune misaligned segments.
  • Theorem 1.  In the random oracle model, the construction is a Juggling protocol by Definition 6.

7.2 Metrics for fair comparison

⚙️ Detailed research option

MetricsHTLCScriptless Schnorr/ECDSAJugglingSwapPQ port (target)
Transactions per chain2–31–21–21–2
Chain requirementsScripts + timelocksSchnorr/ECDSA + overall curveThreshold + ECDLPThreshold PQ + PQ-VE
Amount of evidence—~64 B (signature)Tens of KB (m=32 Bulletproofs)Open question
Partial honestyFull (timelock)FullOne segmentOne segment
Quantum resistancePartially (hash)NoNoTarget

Be careful with interpretation.  “Tens of KB” for Bulletproofs with m=32 is an order-of-magnitude estimate, not a measurement in the paper. For an accurate comparison, you need data from the PoC repository and an independent benchmark. This is one of the following experiments (§10).

8. Post-quantum port: what can be replaced and what can’t

⚙️ Detailed research option

Let’s break down JugglingSwap into its components and look at post-quantum candidates.

ComponentCurrent primitivePQ candidateMaturity
Threshold signatureECDSA/Schnorr (Lindell {2,2})Lattice threshold circuits (Dilithium/Falcon variants)Low-medium
Verifiable encryptionElGamal “in the indicator”Lattice VE (Lyubashevsky–Neven and followers)Low
Range proofBulletproofsLattice range proofsLow
Extracting a segmentEnumeration of 2^l by [x]_k·GDecoding of small normConceptually different
Additive homomorphyElGamal (multiplication → addition in exponent)LWE/BGV/BFV — severeProblem point

The main obstacle.  The entire elegance of Juggling rests on the fact that ElGamal is homomorphic with respect to addition  in the exponent : D = Σ f_k D_k aggregates segments for free. On lattices, additive homomorphism exists, but it is either leveled (BGV/BFV) or requires noise that increases with depth. There is no direct analog of “free” segment aggregation with a compact proof yet. This is the point where H2 can be refuted.

However, the architectural idea—  publicly verifiable correctness of each segment + gradual issuance  —is independent of algebra. It only requires: (a) an encryption scheme with a verifiable public key, (b) a segment correctness proof, (c) a range proof to cut off biases. All three components exist in the lattice world; the question is one of efficiency and size.

9. Limitations and weaknesses of the analysis

⚙️ Detailed research option

  • Shor’s estimates are not converted to qubits.  We assert qualitative vulnerability, but do not provide specific resource estimates for 256-bit curves—that would be a separate, larger work.
  • The PQ port is not implemented.  Table §8 is a candidate map, not a measured prototype.
  • Trust in the provider.  JugglingSwap honestly lists what S trusts: availability and fair submission of deposit transactions. The provider cannot steal funds, but they can freeze them. In the quantum scenario, this trust is preserved and even strengthened.
  • TEE option.  Provider substitution with SGX is vulnerable to Foreshadow and similar attacks—the authors acknowledge this.
  • No timelocks by default.  In the general case of “both completed or both failed to complete”: there is no rollback, the funds remain locked. Timelocks can be enabled, but this is an additional assumption about the chain.

10. Next experiments

⚙️ Detailed research option

  1. Lattice VE prototype.  Implement segmented VE on LWE and measure the proof size and number of rounds for m=32, l=8.
  2. Range proof replacement.  Compare lattice range proofs with bulletproofs in terms of size and verification time.
  3. Threshold signature.  Evaluate {3,3}-variants of lattice schemes; check whether the provider collision analysis from §5.3 of the paper holds.
  4. Shor’s resource assessment.  Recalculate the cost of an attack on secp256k1 in logical qubits and time to provide a quantitative, rather than qualitative, formulation of the threat.
  5. An independent benchmark of classic JugglingSwap.  Reproducing the PoC and measuring real proof sizes will fill the gap in table §7.2.

11. Conclusions

⚙️ Detailed research option

Regarding H1,  it’s confirmed: JugglingSwap is vulnerable to a quantum adversary in its entirety, as all four of its security pillars (DDH, binding, EUF-CMA, ECDLP) are broken by Shor’s algorithm. This isn’t a flaw, but rather a fair consequence of the classic 2020 threat model.

Regarding H2,  it remains open. The architectural pattern is algebra-independent, but the “free” segment aggregation via homomorphic ElGamal has no direct lattice analogue. This is the main risk for the hypothesis.

Regarding H3,  preliminary confirmation is that a JugglingSwap-like architecture is indeed more promising for migration than HTLC, because its obfuscation layer is  verifiable encryption , not a hash preimage; and VE primitives in the PQ world are developing more actively than “quantum-resistant timelocks.”

The key lesson: interoperability and quantum resistance are orthogonal axes. JugglingSwap maximized the former while minimizing the latter. The next generation of protocols must optimize both simultaneously—and this is where the most exciting research opportunities lie.

12. Sources

⚙️ Detailed research option

J. Van Bulck et al.  Foreshadow: Extracting the keys to the Intel SGX kingdom . USENIX Security 2018.

O. Shlomovits, O. Leiba.  JugglingSwap: Scriptless Atomic Cross-Chain Swaps . arXiv:2007.14423v1, KZen Research, 2020. (Primary source of analysis: §1–§6, Appendix A.)

T. Nolan.  Alt chains and atomic transfers . Bitcointalk, 2013.

M. Herlihy.  Atomic cross-chain swaps . PODC 2018.

A. Poelstra.  Scriptless scripts . MIT Bitcoin Expo, 2017.

G. Malavolta, P. Moreno-Sanchez, C. Schneidewind, A. Kate, M. Maffei.  Anonymous multi-hop locks for blockchain scalability and interoperability . NDSS 2019.

J. Camenisch, V. Shoup.  Practical verifiable encryption and decryption of discrete logarithms . CRYPTO 2003.

B. Bünz, J. Bootle, D. Boneh, A. Poelstra, P. Wuille, G. Maxwell.  Bulletproofs . IEEE S&P 2018.

Y. Lindell.  Fast secure two-party ECDSA signing . CRYPTO 2017.

PW Shor.  Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer . SIAM J. Comput., 1997.

NIST.  FIPS 203, 204, 205  (ML-KEM, ML-DSA, SLH-DSA), August 13, 2024.

NIST NCCoE.  Migration to Post-Quantum Cryptography .

V. Lyubashevsky, G. Neven.  One-shot verifiable encryption from lattices . EUROCRYPT 2017.