---
title: "Cross-Chain Atomic Swap — definition | Nuri Glossary"
description: "An exchange across two chains where both legs settle or neither does, via hash time-locked contracts."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/cross-chain-atomic-swap"
---

# Cross-Chain Atomic Swap

An exchange across two chains where both legs settle or neither does, via hash time-locked contracts.

## Basically

A cross-chain atomic swap lets you trade cryptocurrency with someone on another blockchain without trusting a middleman. The whole trade completes, or you both keep your original funds.

## Key Takeaways

- Cross-chain atomic swaps let two parties exchange cryptocurrencies on different blockchains without trusting an intermediary. Hash time-locked contracts (HTLCs) ensure that the swap either completes fully or not at all.
- The protocol uses a shared cryptographic secret, called a preimage, and different timelocks. The initiator gets a longer refund window so the responder always has time to claim after the preimage is revealed.
- Practical challenges include slow settlement, limited liquidity and the free option problem. Settlement depends on the slowest chain, while the initiator can exploit price movements during the swap window. Submarine swaps adapt this mechanism for exchanges between on-chain Bitcoin and Lightning.

## What Is a Cross-Chain Atomic Swap?

A cross-chain atomic swap is a peer-to-peer way to exchange cryptocurrencies across different blockchains without a centralised exchange, custodian or bridge. Atomic means the trade cannot be divided: both sides complete or neither does. You never end up sending funds while the other party sends nothing.
Tier Nolan first described the concept on the Bitcointalk forum in May 2013. He outlined the full HTLC-based protocol that later implementations follow. It remained theoretical for several years because most altcoins lacked the necessary scripting features. In September 2017, the Decred team executed the first widely recognised on-chain atomic swap between production blockchains, BTC and DCR. The team open-sourced a reference implementation that also supported Litecoin and Vertcoin.
Cross-chain bridges pool funds in intermediary smart contracts, which can create large honeypots. Atomic swaps need no pooled capital and no trusted third party. Each participant keeps self-custody of their assets until the swap executes.

## How It Works

Cross-chain atomic swaps use HTLCs on both blockchains, linked by a shared hash. The protocol has five steps. Suppose Alice holds BTC and Bob holds LTC, and they want to trade:
Timelocks protect both parties if either abandons the swap. Each party can reclaim their original funds after the expiry period.

## Timelock Ordering

The initiator, Alice, must have a longer timelock than the responder, Bob: typically 48 hours versus 24 hours. This ordering prevents a specific attack. If Alice's timelock were shorter or equal, she could wait for her refund, reclaim her BTC and then use the preimage to claim Bob's LTC. She would effectively steal from both sides.
Bob always has enough time to observe Alice's claim, extract the preimage and submit his own claim before Alice's refund window opens. For a deeper look at timelocks in Bitcoin, see the research on Bitcoin timelocks (CLTV and CSV).

## On-Chain Script Example

Alice creates a simplified Bitcoin Script for the HTLC. The script sits on the Bitcoin side.
The OP_IF branch lets Bob claim by providing the preimage and his signature. The OP_ELSE branch lets Alice reclaim after the timelock expires. Bob creates a mirror script on Litecoin with the same hash but a shorter timelock of 24 hours and swapped public keys.

## Why It Matters

Cross-chain atomic swaps allow value to move without trusted intermediaries. They have practical uses in several areas:
Spark and the Lightning Network build on the same HTLC primitives that power atomic swaps. They enable fast off-chain transfers that settle atomically without the on-chain wait times.

## Submarine Swaps: The Lightning Variant

A submarine swap is an atomic swap between on-chain Bitcoin and the Lightning Network. It uses the same HTLC mechanism but connects two different layers rather than two different blockchains.
In a normal submarine swap from on-chain to Lightning, a user sends BTC to an on-chain HTLC. The swap provider pays the user's Lightning invoice, which reveals the preimage needed to unlock the on-chain funds. The cryptographic link makes the exchange atomic. Reverse submarine swaps work in the opposite direction, from Lightning to on-chain.
Lightning Loop and Boltz Exchange use submarine swaps to let node operators manage channel liquidity without trusting a third party. For a detailed walkthrough, see the submarine swaps explainer.

## Cross-Chain Atomic Swaps vs. Alternatives

Atomic swaps differ from other exchange mechanisms. Comparing them shows when each approach makes sense:

## Decentralized Trading

Atomic swaps enable decentralised exchanges (DEXs) that operate across blockchains without wrapping assets or bridging tokens. Protocols like THORChain implement cross-chain atomic swaps supporting native asset swaps across Bitcoin, Ethereum, Solana and other chains. Users trade real BTC for real ETH rather than synthetic or wrapped representations.

## Privacy-Preserving Exchanges

Atomic swaps let users who value financial privacy exchange assets without creating accounts or submitting identity documents. The Bitcoin-Monero atomic swap protocol uses adaptor signatures rather than HTLCs because Monero lacks native HTLC support. Privacy-focused communities have used it actively every day since 2024.

## Liquidity Management

Lightning Network node operators use atomic swap variants to manage channel balances. Loop In and Loop Out are submarine swaps that move funds between on-chain and Lightning without closing channels. This allows routing nodes to keep operating continuously.

## Free Option Problem

The initiator effectively holds a free American Call Option during the swap window. After both parties lock their funds, the initiator can watch price movements and complete the swap only if the price has moved in their favour. If the price moves against them, they can let the timelock expire and reclaim their funds.
Research estimates the implicit value of this free option at 2 to 3 percent of the asset value for volatile cryptocurrency pairs. Proposed mitigations include requiring the initiator to post a premium or bond. Newer protocols like 4-Swap (2025) are designed to be both grief-free and bribery-safe.

## Griefing Attacks

Either party can abandon the swap after locking funds. This forces the counterparty to wait the full timelock duration before reclaiming their assets. It locks capital and imposes an opportunity cost, while the attacker pays only their own transaction fees.

## Block Time Mismatch

Different chains have different block times and confirmation requirements. A swap between Bitcoin, with 10-minute blocks, and a chain with 12-second blocks needs conservative timelocks that account for the slower chain. Network congestion can extend these windows further and leave funds locked for extended periods.

## Chain Compatibility

Both blockchains must support compatible HTLC scripting: hash locks and time locks using the same hash function. Not all chains meet this requirement. Monero, for example, lacks native HTLC support and needs specialised adaptor signature protocols for atomic swaps.

## Privacy and Linkability

On-chain atomic swaps create visible transactions on both blockchains. An observer can correlate the two sides by matching hash values, timelock patterns and timing. This could link a user's identities across chains. Research into scriptless scripts and adaptor signatures aims to reduce this risk by removing the shared hash from on-chain data.
Cross-chain security models involve different trade-offs. For a broader comparison, see the research on cross-chain bridging risks.
This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
