Overview

A Cooperative Bitcoin Exit allows you to transfer funds from Spark to Bitcoin L1 through an atomic swap. This cooperative approach is both faster and more cost-effective than exiting unilaterally.

Prerequisites

  • Spark Wallet Initialized: Ensure you have initialized your Spark wallet.
  • Sufficient Balance: Verify that your wallet has enough BTC to perform the exit.
  • Recipient Address: Have the Bitcoin address ready where the funds will be sent.

Performing a Cooperative Exit

To perform a cooperative exit, execute the following code:

const amount = 10_000;
await sparkWallet.cooperativeExit(amount, "bcrt1qjp3q5v3qv94qvu6ww8c4paw6g6lhat5mk8m92x");

Best Practices

  • Verify Recipient Address: Always double-check the recipient Bitcoin address to prevent loss of funds.
  • Monitor Exit Status: Regularly check the status of your exit to ensure it completes successfully.
  • Backup Wallet: Before performing exits, ensure you have backed up your wallet to avoid any accidental loss.
  • Small Exits First: Consider performing a small test exit to verify the process before transferring larger amounts.

Next Steps

With your Quick Start guides complete, explore more advanced features in the Wallet Documentation.