[Paper Review] Atomic Cross-Chain Swaps
This paper presents a provably correct atomic cross-chain swap protocol using hashed timelock contracts and a feedback vertex set of leaders to ensure safety and liveness across multiple blockchains. It proves that such swaps are possible and atomic if and only if the swap dependency graph is strongly connected and the leaders form a feedback vertex set, with time complexity O(diam(D)) and space complexity O(|A|²).
An atomic cross-chain swap is a distributed coordination task where multiple parties exchange assets across multiple blockchains, for example, trading bitcoin for ether. An atomic swap protocol guarantees (1) if all parties conform to the protocol, then all swaps take place, (2) if some coalition deviates from the protocol, then no conforming party ends up worse off, and (3) no coalition has an incentive to deviate from the protocol. A cross-chain swap is modeled as a directed graph ${\cal D}$, whose vertexes are parties and whose arcs are proposed asset transfers. For any pair $({\cal D},L)$, where ${\cal D} = (V,A)$ is a strongly-connected directed graph and $L \subset V$ a feedback vertex set for ${\cal D}$, we give an atomic cross-chain swap protocol for ${\cal D}$, using a form of hashed timelock contracts, where the vertexes in $L$ generate the hashlocked secrets. We show that no such protocol is possible if ${\cal D}$ is not strongly connected, or if ${\cal D}$ is strongly connected but $L$ is not a feedback vertex set. The protocol has time complexity $O(diam({\cal D}))$ and space complexity (bits stored on all blockchains) $O(|A|^2)$.
Motivation & Objective
- To design a secure, trustless protocol for atomic cross-chain swaps across multiple blockchains where all parties exchange assets only if all cooperate.
- To ensure that no conforming party is worse off if any coalition deviates, preserving individual rationality and incentive compatibility.
- To formally characterize the necessary and sufficient conditions—strong connectivity and feedback vertex set structure—under which such swaps are possible.
- To analyze the time and space complexity of the protocol in terms of blockchain operations and storage requirements.
Proposed method
- Models cross-chain swaps as a directed graph D = (V, A), where vertices represent parties and arcs represent proposed asset transfers.
- Identifies a feedback vertex set L ⊆ V as the set of 'leaders' who generate the hashlocked secrets used in the protocol.
- Uses hashed timelock contracts (HTLCs) with decreasing timelocks to coordinate the sequential triggering of transactions across chains.
- Deploys contracts in a reverse order of dependency: from the last transfer back to the first, ensuring that no party can claim assets prematurely.
- Employs a phase-based protocol: (1) contract deployment with decreasing timeouts, (2) secret revelation in reverse order, (3) final settlement only after all secrets are revealed.
- Relies on cryptographic primitives (hash functions) and blockchain immutability to enforce atomicity without trusted third parties.
Experimental results
Research questions
- RQ1Under what graph-theoretic conditions is an atomic cross-chain swap possible on multiple blockchains?
- RQ2Can a protocol be constructed that ensures no rational party is worse off if others deviate, even in the presence of collusion?
- RQ3What is the minimal set of parties (leaders) required to coordinate a secure and atomic swap across a complex dependency graph?
- RQ4How do time and space complexity scale with the size and structure of the swap graph?
- RQ5Can the protocol be extended to support multi-edge transfers, recurrent swaps, or off-chain execution?
Key findings
- An atomic cross-chain swap is possible if and only if the dependency graph D is strongly connected and the set of leaders L forms a feedback vertex set for D.
- If D is not strongly connected, or if L is not a feedback vertex set, no such protocol can guarantee atomicity and fairness.
- The protocol achieves time complexity O(diam(D))), where diam(D) is the diameter of the dependency graph, ensuring efficient execution.
- The total space complexity across all blockchains is O(|A|²), which scales quadratically with the number of asset transfer arcs.
- The protocol is resilient to rational and irrational deviations: no conforming party is worse off than if the protocol were not executed.
- The protocol can be extended to multi-graphs (multiple transfers between same parties) and supports recurrent swaps by pre-distributing hashlocks in advance.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.