Introduction
Traditional cross-chain swaps are "all-or-nothing" affairs. In the current decentralized finance (DeFi) landscape, if a single participant fails or deviates from the protocol, the entire trade collapses. This leaves honest parties with locked assets and wasted time. This paper introduces two novel protocols—ProtocolA and ProtocolB—that shift the paradigm from simple atomicity to robust, fault-tolerant commerce. By allowing participants to propose multiple alternative trades in parallel using logical predicates, these protocols ensure that as long as at least one viable path exists, the trade succeeds.
The Fragility of Atomic Swaps
Atomic swaps allow users to exchange assets across different blockchains (e.g., Bitcoin for Ethereum) without a central intermediary. However, these protocols are notoriously fragile. Consider a scenario where Alice wants to swap her "Xcoin" for Bob’s "Ycoin." If Bob disappears halfway through the process, Alice’s tokens remain stuck in escrow until a lengthy timeout expires. To attempt the trade again with a different partner, Carol, Alice must wait for her refund and restart the entire process sequentially.
This sequential approach is slow and risky in volatile markets. The authors identify a critical gap: the lack of a mechanism to execute redundant or alternative swaps in parallel without the risk of overpaying or ending up with nothing.
Proposed Framework: Logical Predicates and Graph Modeling
The authors move beyond simple "if-then" transfers to a framework based on logical predicates. Each participant defines their requirements using boolean logic. For instance, Alice’s predicate might state: "I will pay 1 Xcoin if and only if I receive 1 Ycoin, and I will pay at most one person."
The system models all potential transfers as a directed graph and utilizes an all-SAT solver to identify all possible combinations of transfers (solutions) that satisfy every participant's predicates simultaneously.
Protocol Mechanics: ProtocolA vs. ProtocolB
The paper details two distinct approaches to managing the trade-off between capital efficiency and execution speed:
- ProtocolA (High Collateral, Low Latency): This protocol executes all valid solutions in parallel. To prevent overpaying, it employs distinct "hashlocks" for different solutions. If Alice provides redundancy (offering multiple paths), she only releases the secret key for the specific solution she chooses to settle. While fast, this requires Alice to escrow enough collateral for every potential trade she is involved in.
- ProtocolB (Low Collateral, High Latency): This protocol allows participants to reuse the same escrowed asset for multiple potential trades. It uses a priority ranking and "negated" hashlock circuits (e.g., "Complete Trade 2 only if Trade 1 has timed out and failed"). This saves on collateral but requires waiting for "hard timeouts" to ensure higher-priority trades have failed before proceeding.
Key Insights and Theoretical Results
- From Atomicity to Robustness: The paper argues that "atomicity" is insufficient for a positive user experience. True robustness requires the ability to succeed despite individual failures.
- Safety and Liveness: The authors formally prove that a conforming party will never be worse off—they will never pay without receiving assets or overpay. Furthermore, they prove "Universal Liveness": if parties follow the protocol, a maximal set of compatible exchanges will always complete.
- Efficiency Gains: Theoretically, ProtocolA allows a trade to finish in roughly the same time as a single successful atomic swap ($O(\Delta)$), whereas traditional sequential approaches scale poorly ($O(n \cdot \Delta)$) as the number of failed attempts increases.
- Nash Equilibrium: ProtocolA is demonstrated to be a "strong Nash equilibrium," meaning no group of participants has an incentive to deviate from the protocol to improve their payoff.
Limitations and Future Directions
While the protocols offer significant improvements, challenges remain. ProtocolA requires "redundancy providers" to reach an agreement on which set of swaps to finalize, necessitating further research into efficient agreement protocols. Additionally, finding all solutions to complex predicates via an all-SAT solver can become computationally expensive as the network graph grows. Future work may also focus on automating the negotiation phase required for ProtocolB's solution ranking.
Summary updated