Recover your swap from zero.
A Monzero atomic swap is non-custodial: no one — not Monzero, not the trader on the other side — can move your coins. That also means recovery is in your hands. This guide shows how to get your funds back if a swap stalls, your app crashes, or your device is lost, from the easiest case to the most technical.
A swap is short-lived — it completes or refunds within its timelock window (hours; see section 6). The entire risk is losing your swap data while a trade is in flight. Back it up (section 1) and nothing else here is ever needed.
1Back up your swap data
Everything needed to recover a swap — your keys, the pre-signed refund transactions, and your XMZ key share — lives in one folder on your device: the swap data directory. Copy it somewhere safe (an encrypted USB stick, for example) whenever you have a trade running.
| System | Default location |
|---|---|
| Linux | ~/.local/share/xmr-btc-swap/ |
| macOS | ~/Library/Application Support/xmr-btc-swap/ |
The exact folder name depends on your build — the Monzero app shows its data directory in Settings, and the swap CLI prints it on start-up (or you set it with --data-base-dir). Inside are the swap database (SQLite) and the Bitcoin and XMZ wallet files. Treat this folder like a seed backup: it can spend your in-flight swap, so keep it private and encrypted.
2The quick fix: resume
If the app closed, crashed, or lost power mid-swap, you almost never need anything fancy — just reopen it. Monzero resumes unfinished swaps automatically, watches both chains, and takes the correct timelock path (including an automatic refund) without you doing anything.
On the command line that is:
swap history # find your swap id
swap resume --swap-id <id>
Leave it running until the swap reaches a final state — completed, refunded, or cancelled. As long as you resume before the refund window closes (section 6), your Bitcoin is safe.
3Lost the device, kept the data
The data directory is portable. If your computer died but you kept the backup from section 1:
- Install the Monzero app (or the open-source swap CLI) on any machine.
- Restore your backed-up folder to the data-directory path for that system (section 1), or point to it with
--data-base-dir /path/to/backup. - Run
swap resume(or simply open the app). It picks up exactly where the swap left off.
Nothing secret ever left your device, so a fresh install plus your folder is a complete recovery.
4Force a refund (expert)
If the other side vanished and you would rather actively reclaim your Bitcoin than wait for the automatic path, the CLI exposes the two refund-path transactions directly:
swap cancel --swap-id <id> # publish the cancel tx (after the cancel timelock)
swap refund --swap-id <id> # reclaim your BTC (after cancel confirms)
These simply broadcast transactions that were already signed before your coins were ever locked, so they cannot be blocked or redirected. Order and timing matter — see the timelock reference below. (They are marked "expert users only" because running them out of order just wastes fees; they cannot lose funds.)
5No Monzero app at all (advanced)
Even with no Monzero software, your funds are recoverable, because the protocol and transaction formats are fully open source — the engine is a port of eigenwallet/core (the maintained successor to COMIT's xmr-btc-swap). The recovery data is standard:
- Bitcoin side: your pre-signed cancel and refund transactions are stored in the swap database. Once a refund transaction's timelock matures, any Bitcoin node or block-explorer broadcast tool will relay it — no special software required.
- XMZ side: the XMZ sits in a 2-of-2 shared key; your key share is in the same swap data and can be imported to reconstruct the wallet.
This last-resort path is real but not yet a one-click, non-technical procedure — extracting the raw transactions from the database and broadcasting them by hand takes some technical comfort. We are writing a step-by-step extractor guide; until it lands, if you are ever in this situation, email security@monzero.org and we will walk you through it. We can help you recover your funds; we cannot take them — there is no key on our side that can.
6Timelock reference
Timelocks are measured in Bitcoin blocks, relative to when the reference transaction confirms (BIP68). On mainnet:
| Window | Opens | Who | Action |
|---|---|---|---|
| Redeem (happy path) | immediately, before cancel | maker | settles the swap; you receive your coins |
| Cancel | 24 blocks (~4 h) after the lock confirms | either party | moves the lock to the cancel output |
| Refund | after cancel confirms | the Bitcoin funder | reclaims the locked BTC |
| Punish | 144 blocks (~24 h) after cancel | maker | only if the funder never refunded |
The 24-hour gap between cancel and punish is your safety margin: you have a full day after a cancellation to refund, far more than any normal confirmation delay. Refund within that window and your Bitcoin is never at risk. (Testnet uses shorter values; your app shows the exact numbers for your swap.)
7What can and can't happen to your funds
- Your keys never leave your device. Monzero holds no copy and has no admin key. We cannot freeze, move, or seize a swap — in flight or settled.
- The blockchains enforce the outcome. Either both sides get paid, or both get refunded. There is no third outcome where one side keeps everything.
- The app's job is timing, not custody. You need it (or a resume) online within the refund window to act — but it cannot be made to lose your funds, and the servers it talks to can stall your view at worst, never steal.
- The only way to lose access is to lose your swap data with a trade in flight. That is exactly what section 1 prevents.
Questions, or stuck mid-swap? security@monzero.org, or the Monzero Telegram. The source for everything above is open: eigenwallet/core.