Blockstream

Atomic Swap

A trustless peer-to-peer exchange where two parties trade assets across different blockchains or layers, with the guarantee that both sides either complete in full or the transaction fails and funds return to their original owners.

Atomic swaps rely on Hash Time-Locked Contracts (HTLCs), a Bitcoin Script construction that combines cryptographic hash locks with timelocks. One party locks funds behind a secret hash, the counterparty locks matching funds on the other chain using the same hash, and revealing the secret completes both sides simultaneously. If the secret is never revealed, both timelocks expire and each party reclaims their original funds.

In the context of Bitcoin and its layer-2 networks, atomic swaps enable trustless transfers between mainchain BTC and assets like LBTC on the Liquid Network without custodial intermediaries. The cryptographic contract eliminates counterparty risk entirely: either the full exchange happens or nothing does.

More Resources

Explore additional content to help you succeed with our platform.

Group 514034

Blockstream Blog

Learn more about Blockstream’s latest products and technologies.

Vector 8

Developer Docs

Technical documentation for Blockstream’s products and services.

Vector 2026 03 13 074722 lllm

Engineering Blog

Deep-dives into technical topics from our engineering teams.