Monzero DEX · self-custody

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.

Read first

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.

SystemDefault 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:

  1. Install the Monzero app (or the open-source swap CLI) on any machine.
  2. 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.
  3. 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:

Honest limitation

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:

WindowOpensWhoAction
Redeem (happy path)immediately, before cancelmakersettles the swap; you receive your coins
Cancel24 blocks (~4 h) after the lock confirmseither partymoves the lock to the cancel output
Refundafter cancel confirmsthe Bitcoin funderreclaims the locked BTC
Punish144 blocks (~24 h) after cancelmakeronly 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

Questions, or stuck mid-swap? security@monzero.org, or the Monzero Telegram. The source for everything above is open: eigenwallet/core.