Research
Probabilistic Atomic Swaps for Bitcoin and Friends
Classical atomic swaps are all-or-nothing: either both parties receive the agreed assets or neither transfers anything. That determinism makes them unable to express exchanges whose intended outcome…

- arXiv
- 2605.04975
- Published
- 2026-05-06
- Authors
- Paul Gerhart, Jay Taylor, Sri Aravinda Krishnan Thyagarajan
AI summary
Overview
Research area: Applied cryptography and blockchain protocols — specifically cross-chain atomic exchange, adaptor signatures, and oblivious pseudorandom functions (OPRFs).
Technical level: Advanced. The paper assumes familiarity with adaptor signatures, OPRF constructions (2-Hash-DH), NIZK/NARG proof systems, hard relations, and simulation-based security definitions. The intuition is explained well, but the formal machinery is dense.
Scope: The paper defines, constructs, formally analyzes, and implements a new primitive — the probabilistic atomic swap — which lets one party pay for a fixed, publicly specified chance of receiving a larger asset, using only the on-chain scripting already needed for ordinary atomic swaps.
What This Paper Is About
Classical atomic swaps are all-or-nothing: either both parties receive the agreed assets or neither transfers anything. That determinism makes them unable to express exchanges whose intended outcome is a probability distribution — lotteries, wagers, or trades where a holder of a long-tail asset buys a small chance at a highly liquid asset such as bitcoin. The authors ask whether the atomic swap can be extended into the probabilistic setting while keeping the same minimal on-chain footprint, so that the protocol remains deployable on Bitcoin-like chains (and layer-2 networks) and stays indistinguishable from ordinary transactions.
Key Contributions
-
A new primitive with a formal definition. The authors introduce probabilistic atomic swaps and formalize them via an ideal functionality, ℱ_ProSwap^𝔹, in which the dealer inputs ν coins and the party inputs one coin, a bit b is sampled from Bernoulli(p), one coin always goes to the dealer, and the party receives ν coins only if b = 1. Setting p = 1 = ν recovers the deterministic atomic swap functionality of prior work.
-
A construction from adaptor signatures plus OPRFs. The protocol needs only transaction signature verification and timeouts — no new opcodes, no complex scripts. A concrete instantiation from Schnorr signatures is given, along with the compatibility requirements for other adaptor signature relations (encryption keys, OPRF output spaces, well-formedness proofs).
-
Atomic exchange of OPRF evaluations for payments. As a technical ingredient of independent interest, the authors build a mechanism in which a dealer acts as the OPRF server and the party obtains OPRF evaluations if and only if it makes the required payment. The response is encrypted under an ephemeral key, and the decryption key doubles as the adaptor-signature witness, so payment and evaluation are revealed together.
-
Implementation and evaluation. The protocol is implemented on the Bitcoin and Litecoin testnets, including a cross-chain swap, with a complete on-chain swap using exactly four standard Taproot transactions of about 575 WU each. An HTLC/preimage variant with explicit hash/discrete-log link proofs is included because the deployed Lightning Network is HTLC-based, providing a concrete OP_RAND-style realization for Lightning-like networks.
Main Findings
-
Probabilistic swaps cost the same on-chain as deterministic ones. The on-chain footprint is four standard transactions: two that freeze coins from a party's address to a temporary address, and two from the temporary address to either party (or both to the dealer, if the party lost). No protocol logic, odds, or probability encoding appears on-chain.
-
The naive approach fails for a structural reason. Making the Adapt or Extract step probabilistic does not work, because once the dealer holds the party's pre-signature it can locally evaluate whether the party will succeed and abort selectively. The outcome must be hidden from both parties until they are committed.
-
Oblivious transfer is the wrong tool. In an OT-based design, the party can identify in advance which of the dealer's statements has the valid pre-signature, so it learns the outcome with certainty; letting the dealer pick the witness instead opens a cheating path. OPRFs resolve this asymmetry: the dealer verifiably but obliviously evaluates the party's guess, and the party learns correctness only afterward.
-
Efficiency contrast with prior OP_RAND work. In Kurbatov's note, for winning probability 1/m the dealer must prove m + 1 hash instances (including a hash160 evaluation) and the party proves one hash160 evaluation. Here the dealer computes a single well-formedness proof and the party computes no NIZK at all; the Bulletproof instantiation achieves near-constant proving time regardless of m, remaining efficient for probabilities as small as 2⁻²⁰. This matters because encoding a one-satoshi Lightning payment as a probabilistic payment requires winning probabilities on the order of 2⁻¹⁷ or smaller — a regime where the prior approach becomes prohibitively expensive.
-
Probabilities beyond 1/m are supported. With a single guess the winning probability is 1/m for domain size m; the protocol can be modified to support a concurrent guesses, giving a/m.
-
A formalization gap was found in prior work. The authors report a mismatch in the Universal Swaps functionality: the ideal functionality refunds both parties atomically, but a real-world adversary may refuse to reclaim locked funds, producing executions that cannot be simulated.
-
Comparative positioning (Table 1). Compared against OP_Rand, lottery protocols, Universal Swaps, poker, and MPC approaches, this work is the only listed entry marked as having a probabilistic output distribution, on-chain privacy, off-chain/cross-chain compatibility, as-of-today Bitcoin compatibility, low on-chain cost, no deposits, and a security proof simultaneously.
Methodology in Plain English
The core trick is to turn a probability into a guessing game that neither side can peek at.
The dealer picks a secret target value from a domain of size m and builds a locking statement for the payout that only one specific value — the OPRF evaluation of that target under the dealer's secret key — can unlock. Because the OPRF output looks random, the statement itself leaks nothing about the target. The party then picks its own guess and interacts with the dealer as an OPRF client; the dealer learns nothing about the guess, and the party gets a usable OPRF output. If and only if the guess matched the target — which happens with probability 1/m — the output is a valid witness that unlocks the dealer's pre-signed payment.
The remaining problem is that neither side should be able to walk away mid-way. The dealer cannot simply hand over the OPRF response, and the party cannot simply pay first. The authors solve this by having the dealer encrypt the response under an ephemeral public key Z for which it knows the decryption key z, and prove the ciphertext is well-formed relative to the party's request. The party then pre-signs its payment to the dealer using Z as the adaptor statement. When the dealer claims payment by adapting that pre-signature with z and broadcasting, z becomes visible on-chain; the party extracts z and decrypts the response. Payment and evaluation are thus bound together, and standard timelocks (BIP 65 CLTV with a two-branch locking script) handle the abort paths. Security is argued in a simulation-based framework over a synchronous network with static corruptions and an ideal ledger.
Why This Matters
Research impact. The paper extends the atomic swap abstraction from deterministic relations to probability distributions, and supplies the missing formal functionality, a security proof, and a working artifact. It also contributes a reusable sub-protocol (atomic exchange of OPRF evaluations for payment) that is not specific to swaps.
Real-world applications:
- Wagers / OP_RAND-style lotteries. A participant commits a fixed amount for a chance at a larger reward according to pre-agreed odds, with no trusted house and no on-chain exposure of the lottery logic.
- Probabilistic cross-chain trades. A holder of a long-tail asset buys a small, explicitly priced chance of receiving a highly liquid asset such as bitcoin, instead of accepting an unfavorable guaranteed rate.
- Handling uneconomical Lightning payments. Identified in prior community discussion as a tool for tiny payments, and realized here via the HTLC/preimage variant.
- Payment-based rate limiting. Replacing hard cut-offs after a fixed number of authentication attempts with a small fee per attempt, making large-scale brute force economically infeasible while costing honest users little — the authors flag this as future work.
Industry relevance. Because the protocol uses only signature checks and timelocks, it runs on any chain that already supports atomic swaps, including script-limited environments, and inherits the privacy and fungibility benefits of looking like an ordinary transaction. That makes it compatible with existing exchange frameworks and layer-2 deployments rather than requiring a fork or new opcode.
Future Directions
- Payment-based rate limiting for OPRF-based authentication and encrypted backup systems, replacing hard cut-offs with a small per-attempt fee; the authors explicitly leave this exploration open.
- Probabilistic swaps where both parties receive probabilistic outcomes on minimal blockchains — discussed in Section 6 as genuinely difficult, since the fairness argument relies on one side's outcome being fixed.
- Wider instantiations across adaptor signature relations and chains lacking native timelocks, using verifiable timed signatures instead of CLTV, in the style of Universal Swaps.
- Reducing or re-examining the timelock overhead and extending the a-concurrent-guess mechanism for finer-grained or larger probability values.
Target Audience
Cryptography and blockchain protocol researchers working on cross-chain exchange, payment channels, and scriptless scripts; protocol engineers at exchanges, wallet providers, and Lightning implementations who need trustless randomized settlement; and graduate students with a background in adaptor signatures and simulation-based proofs who want a compact example of turning an all-or-nothing primitive into a probabilistic one without changing its on-chain cost.
Authors’ abstract
Atomic swaps are a fundamental primitive for the trustless exchange of digital assets across blockchains: they guarantee that either both parties receive the agreed assets or neither party transfers. While this all-or-nothing guarantee is powerful, it also imposes an inherent determinism that rules out exchanges whose intended outcome is probabilistic. As a result, existing atomic swaps cannot realize trustless exchanges in which one party pays for a fixed chance of…
The full abstract on arXiv