Blockstream Swaps uses atomic swaps secured by hash-locked contracts. The contracts enforce a simple rule: either both sides of the swap complete, or the original depositor can reclaim the funds. There is no in-between state where one side gets paid and the other does not.
What Atomic Means
An atomic swap is a single operation with two outcomes: success or full refund. The cryptographic contract guarantees this. Blockstream Swaps, as a coordinator, cannot unilaterally take your funds, and cannot finalize a half-complete swap.
How the Contract Works
Each swap involves a hash-locked contract with two paths:
- Success path: Reveal a secret (the preimage of a hash) to claim the funds. Revealing the secret on one side lets the counterparty claim the other side.
- Refund path: If the secret is never revealed within a fixed time window, the original depositor can reclaim their funds after the timelock expires.
The swap either completes atomically (both transfers finalize) or it times out (the depositor gets their funds back). There is no middle outcome.
Where Blockstream Fits In
Blockstream Swaps runs the coordination service that constructs the contracts and relays payments between bitcoin and Lightning. The service never takes custody. If the service goes offline mid-swap, the refund path still works because it is enforced by the bitcoin network itself, not by Blockstream.
What This Means for You
- You always control the private keys to your deposit and refund paths.
- A failed or stalled swap does not put your deposit at risk: once the timelock expires, the refund path returns it to your refund address, minus the network fee.
- You do not need to trust Blockstream with your balance. You rely on the bitcoin network to enforce the hash-locked contract, not on Blockstream.
To start a swap, see Perform a swap. For fee details, see How are swap fees calculated?