> ## Documentation Index
> Fetch the complete documentation index at: https://second.tech/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage your wallet

> Send leftover sats, keep leftover sats from expiring, restore or wipe the wallet in this browser, export its data for an emergency exit, and switch networks.

The **Wallet** button in the header opens the wallet drawer. A normal swap never needs it.

<Frame caption="The wallet drawer holds the backup, restore, wipe, export, and network controls">
  <img src="https://mintcdn.com/second-0659a37d/Ys6dqcbJ8GNgbFCj/images/swaptopia/wallet-drawer.png?fit=max&auto=format&n=Ys6dqcbJ8GNgbFCj&q=85&s=b818116694dd11c12d00ecf1ea717e9a" alt="Screenshot of the Swaptopia wallet drawer, with the Back up, Restore, and Wipe buttons, the Export wallet data button, and the Mainnet and Signet network buttons" width="1056" height="1282" data-path="images/swaptopia/wallet-drawer.png" />
</Frame>

## Send leftover sats

Swaptopia shows sats left in the wallet in a banner on the swap screen: "N sats from an earlier swap are in this wallet. They join your next swap." Leftover sats come from a failed payout you put off with **Later**, bitcoin that arrives after you cancel, a deposit over the maximum per swap, or a restore.

Leftover sats join your next swap on their own. The quote then shows "Includes N sats already in this wallet from an earlier swap." To send them out now instead:

<Steps>
  <Step title="Set where the sats go">
    Select the **Swap direction** button until **Lightning** or **Bitcoin**, whichever you want, sits under **You receive**. The direction locks once you select **Send now**.
  </Step>

  <Step title="Select Send now in the banner">
    **You send** switches to **This wallet**, and a **Lightning invoice or address** or **Bitcoin address** field appears.
  </Step>

  <Step title="Paste the destination">
    A fixed-amount Lightning invoice must be for exactly the **You receive** figure. Swaptopia refuses any other amount and names the figure to use.
  </Step>

  <Step title="Select Swap">
    Swaptopia sends the sats and shows the receipt. To leave this mode without sending, select **Back** next to **You send**.
  </Step>
</Steps>

**Send now** appears only when the leftover sats exceed the Ark server's minimum Lightning fee. Below that, the banner says they "cannot go on their own". They then join your next swap.

## Keep leftover sats from expiring

Leftover sats have a limited [lifetime](/docs/learn/lifetime) on Ark. Each time you open Swaptopia while it holds sats, it makes sure a refresh is booked with the Ark server for about two days before they expire. The server runs the refresh whether or not this page is open. Swaptopia collects the refreshed sats the next time you open it.

You need to act in three cases:

* **The drawer says it could not check when the sats expire:** Open Swaptopia again later, so it can book the refresh.
* **The drawer says no refresh could be booked:** Open Swaptopia again before the expiry the drawer shows.
* **A banner on the swap screen asks you to swap the sats out:** The sats expire within about a week. [Send them on their own](/docs/swaptopia/wallet#send-leftover-sats), or let them join a swap before then. The banner appears even when Swaptopia has booked a refresh.

<Warning>
  Once sats reach their expiry, the Ark server can sweep them. Swept sats are lost. If the drawer says "The N sats here have reached their expiry. Swap them out now.", [send them on their own](/docs/swaptopia/wallet#send-leftover-sats) right away.
</Warning>

## Restore your wallet from the seed phrase

Restoring pulls the wallet's sats on Ark back from the Ark server's records. You need the 12 words you wrote down when you [backed up the wallet](/docs/swaptopia/backup).

<Warning>
  Restoring replaces the wallet in this browser, on mainnet and on signet. It also ends any swap in progress. Before you restore, finish or cancel any swap on either network. If the current wallet holds sats, make sure you have its seed phrase first, or the sats are lost.
</Warning>

<Steps>
  <Step title="Open the restore screen">
    Select **Wallet** > **Restore**.
  </Step>

  <Step title="Enter the 12 words">
    Type or paste the words in order, separated by spaces. Capitals and extra spaces do not matter. If Swaptopia shows "That is not a valid BIP-39 mnemonic.", check the words and their order against what you wrote down.
  </Step>

  <Step title="Select Restore">
    Swaptopia shows "Restoring…", replaces the wallet, and returns to the swap screen with a recovery banner.
  </Step>
</Steps>

<Frame caption="The banner on the swap screen reports what the scan recovered">
  <video autoPlay src="https://mintcdn.com/second-0659a37d/Ys6dqcbJ8GNgbFCj/videos/swaptopia/restore-wallet.mp4?fit=max&auto=format&n=Ys6dqcbJ8GNgbFCj&q=85&s=9f68badae2b56727bfee902af89e3401" aria-label="Screen recording of Swaptopia on signet: Wallet then Restore opens the Restore wallet screen, 12 words are pasted, and Restore returns to the swap screen with the banner Restored. 14,987 sats were recovered." data-path="videos/swaptopia/restore-wallet.mp4" />
</Frame>

The banner tells you what the scan found:

| Banner | What to do |
| - | - |
| "Restored. N sats were recovered." | Nothing. The sats join your next swap, or you can [send them on their own](/docs/swaptopia/wallet#send-leftover-sats). |
| "Restored. No swap sats were found for this seed…" | If your sats were on the other network, select it under **Network** in the wallet drawer. Swaptopia scans that network as the page reloads. Recovered sats then show as [leftover sats](/docs/swaptopia/wallet#send-leftover-sats). For bitcoin sent to a funding address, see the note below. |
| "…could not be checked and may still be missing. Try again to check them." | Select **Try again** in the banner. |
| "…are keyed beyond this wallet's scan range, so retrying will not help." | Ask in the [community chat](https://chat.second.tech). |
| "The recovery scan produced no report…" | If you expected sats and none show, restore the seed phrase again. |
| "No recovery scan ran…" or "The recovery scan failed before it could report…" | [Restore the seed phrase again](/docs/swaptopia/wallet#restore-your-wallet-from-the-seed-phrase) to rerun the scan. |

<Note>
  The scan recovers sats on Ark only. Bitcoin still waiting at a funding address stays on-chain. If it does not show up under **Wallet**, restore the seed phrase in an on-chain wallet app that supports taproot (BIP86) addresses to recover it.
</Note>

## Wipe the wallet from this browser

Wiping deletes the wallet from this browser, on mainnet and on signet, and creates a new one with a new seed phrase.

<Warning>
  Wiping ends any swap in progress for good. Restoring the seed phrase later brings back the sats the wallet holds on Ark, not the swap. Before you wipe, finish or cancel any swap on either network, then swap the sats out or make sure you have the seed phrase.
</Warning>

<Steps>
  <Step title="Select Wipe">
    Select **Wallet** > **Wipe**.
  </Step>

  <Step title="Confirm the deletion">
    Your browser asks you to confirm. Select **OK**.
  </Step>

  <Step title="Back up the new wallet">
    Swaptopia shows "Wiping…", then opens the swap screen with a fresh wallet. [Back it up](/docs/swaptopia/backup) before you swap.
  </Step>
</Steps>

## Export the wallet data for an emergency exit (optional)

If the Ark server stops cooperating, Swaptopia cannot move your sats out on its own. If you run the [Bark CLI](/docs/getting-started/bark-cli), this export and your seed phrase let you run an [emergency exit](/docs/learn/exit) instead.

Select **Wallet** > **Export wallet data**. Swaptopia saves a file named `swaptopia-bitcoin-wallet-<YYYY-MM-DD>.json` on mainnet (`swaptopia-signet-wallet-<YYYY-MM-DD>.json` on signet), in the format of the Bark CLI's `wallet.json`. The file holds none of your wallet's keys, so it cannot spend without your seed phrase. It does record your addresses and payment history, so keep it private.

<Note>
  Export again after every swap, and again just before you run an exit, with Swaptopia open for a moment first. Swaps and refreshes replace the VTXOs in the wallet. An older file lists VTXOs you no longer hold and misses the ones you hold now.
</Note>

<Accordion title="Run the emergency exit with the Bark CLI">
  You need:

  * Your 12-word seed phrase.
  * The exported file.
  * The Bark CLI installed on your computer.

  <Warning>
    `bark create` writes your seed phrase in plain text to a file named `mnemonic` inside the data directory. Your shell also keeps the command in its history. Run this on a computer you trust, and delete the `./exit` folder once the claim transaction has confirmed.
  </Warning>

  <Steps>
    <Step title="Install the Bark CLI">
      Follow [Install Bark CLI](/docs/getting-started/bark-cli) and check that `bark --version` answers.
    </Step>

    <Step title="Create a wallet from your seed phrase">
      This creates a data directory named `exit` that uses Bark's file storage, pointed at Second's Ark server and Esplora. Replace the 12 words with your own.

      <CodeGroup>
        ```bash Mainnet theme={"theme":{"light":"github-light","dark":"github-dark"}}
        bark create --datadir ./exit --mainnet --use-filestore --mnemonic "<your 12 words>" --ark https://ark.second.tech --esplora https://mempool.second.tech/api
        ```

        ```bash Signet theme={"theme":{"light":"github-light","dark":"github-dark"}}
        bark create --datadir ./exit --signet --use-filestore --mnemonic "<your 12 words>" --ark https://ark.signet.2nd.dev --esplora https://esplora.signet.2nd.dev
        ```
      </CodeGroup>

      <Note>
        `bark create` contacts the Ark server. If the server does not answer, add `--force` to create the wallet without it. `--force` also deletes everything already in `./exit` except `config.toml` and log files.
      </Note>
    </Step>

    <Step title="Replace wallet.json with your export">
      Copy the exported file over `./exit/wallet.json`, keeping that name. Bark opens `wallet.json` whenever it exists in the data directory.
    </Step>

    <Step title="Check that the Bark CLI sees your sats">
      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bark --datadir ./exit vtxos --no-sync
      ```

      The output lists the unspent VTXOs from your export, each with its `amount_sat`. An empty list means the file did not copy, or the wallet held no VTXOs when you exported it.
    </Step>

    <Step title="Fund the on-chain wallet for the exit fees">
      Exit transactions pay their miner fees from Bark's own on-chain wallet, with confirmed sats only. Check what the exit needs, then get an address:

      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bark --datadir ./exit exit estimate-fee --all
      bark --datadir ./exit onchain address
      ```

      Send at least the `exit_broadcast_fee_sat` figure to that address, with a margin on top. The [emergency exit walkthrough](/docs/getting-started/bark-cli/advanced#emergency-exit) suggests at least 15,000 sats per VTXO. Wait for one confirmation before you start the exit.
    </Step>

    <Step title="Start the exit for every VTXO">
      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bark --datadir ./exit exit start --all
      ```
    </Step>

    <Step title="Progress the exit until it completes">
      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bark --datadir ./exit exit progress --wait
      ```

      `--wait` keeps the command running and rechecking every minute. Each VTXO needs several on-chain transactions to confirm, then a timelock to pass, so this can take hours or days. Without `--wait`, run the command again until its output reports `"done": true`.
    </Step>

    <Step title="Claim the exited bitcoin">
      Send the exited bitcoin to an on-chain address you control:

      ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
      bark --datadir ./exit exit claim --all <address>
      ```

      Bark broadcasts one transaction to that address. Once it confirms, the bitcoin is yours on-chain.
    </Step>
  </Steps>
</Accordion>

## Test a swap on signet

Signet bitcoin has no value, so a mistake costs nothing.

<Warning>
  Swaptopia keeps separate wallet data and a separate swap for each network, under the same seed phrase. A wipe or a restore on signet also applies to your mainnet wallet.
</Warning>

<Steps>
  <Step title="Switch to signet">
    Select **Wallet**, then **Signet** under **Network**. You can also open [labs.second.tech/swaptopia/?net=signet](https://labs.second.tech/swaptopia/?net=signet). The page reloads with a **signet** pill in the header. Swaptopia stays on signet in this browser until you select **Mainnet** the same way. If a swap is in progress, Swaptopia asks you to confirm the switch. That swap pauses until you come back to mainnet.
  </Step>

  <Step title="Get signet sats from the faucet">
    Second's faucet at [signet.2nd.dev](https://signet.2nd.dev) pays signet on-chain addresses and Lightning invoices once you sign in with GitHub.

    * **Bitcoin to Lightning:** At the **Send bitcoin** stage, ask the faucet to send the amount shown to the funding address. Have a signet Lightning wallet app ready to create the invoice.
    * **Lightning to bitcoin:** At the **Pay this invoice** stage, paste the invoice into the faucet. Have a signet `tb1…` address ready to receive.
  </Step>

  <Step title="Run the swap">
    Follow [Swap bitcoin to Lightning](/docs/swaptopia/bitcoin-to-lightning) or [Swap Lightning to bitcoin](/docs/swaptopia/lightning-to-bitcoin).
  </Step>
</Steps>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.