Skip to main content
Deposit Bitcoin from L1 using reusable static addresses.
Deposit from L1

Deposit Flow

The complete process for depositing Bitcoin from Layer 1 into your Spark wallet:
1

Generate Deposit Address

Create a static deposit address that can be reused for multiple deposits.
const staticAddress = await wallet.getStaticDepositAddress();
console.log("Static Deposit Address:", staticAddress);
2

Send Bitcoin

Send Bitcoin from any wallet to your deposit address.
// For mainnet: Send real Bitcoin to the address
// For regtest: Use the faucet
console.log("Send Bitcoin to:", staticAddress);
3

Monitor Transaction

Wait for the transaction to be confirmed on the blockchain.
// Monitor using a block explorer or your infrastructure
// You need to monitor the address for new transactions
4

Claim Deposit

Claim the deposit once it has 3 confirmations.
const quote = await wallet.getClaimStaticDepositQuote(txId);
const claimResult = await wallet.claimStaticDeposit({
  transactionId: txId,
  creditAmountSats: quote.creditAmountSats,
  sspSignature: quote.signature
});

Generate Static Deposit Address

For Bitcoin deposits on L1, Spark generates P2TR addresses. These addresses start with bc1p for mainnet and can be used to receive Bitcoin from any wallet. Static deposit addresses are reusable, allowing the same address to receive multiple deposits. This approach is user-friendly, minimizes operational overhead, and is ideal for production applications. Currently, Spark supports one static deposit address per wallet. Creating a second static address will return your existing address instead of generating a new one.
const staticDepositAddress = await wallet.getStaticDepositAddress();
console.log("Static Deposit Address:", staticDepositAddress);
// This address can be reused for multiple deposits
Mainnet Address Example bc1p5d7rjq7g6rdk2yhzks9smtbqtedr4dekq08ge8ztwac72sfr9rusxg3297

Deposit Bitcoin

Mainnet Deposits

To deposit Bitcoin on the mainnet, send funds to your static deposit address.

Regtest Deposits

For testing purposes on the Regtest network, use the faucet to fund your Spark wallet without using real Bitcoin.

Monitor for Deposit Transactions

After sending Bitcoin to your deposit address, you’ll need to monitor for incoming transactions using a blockchain explorer or your own infrastructure.
const staticAddress = await wallet.getStaticDepositAddress();

// Example: Monitor for new transactions using a block explorer API
// const newTransactions = await yourBlockchainMonitor.checkAddress(staticAddress);
Since static addresses can receive multiple deposits, you need to actively monitor the address for new transactions.

Claiming Deposits

Once a deposit is found on the blockchain, you can claim it by providing the transaction ID.
// Step 1: Get a quote for your deposit (can be called anytime after transaction)
const quote = await wallet.getClaimStaticDepositQuote(txId);
console.log("Quote:", quote);

// Step 2: Claim the deposit using the quote details
const claimResult = await wallet.claimStaticDeposit({
  transactionId: txId,
  creditAmountSats: quote.creditAmountSats,
  sspSignature: quote.signature
});
console.log("Claim successful:", claimResult);
You can call getClaimStaticDepositQuote anytime after the deposit transaction is made, but claimStaticDeposit will only succeed after the deposit transaction has 3 confirmations.

Refunding Static Deposits

If you need to recover funds from a static deposit address without bringing them into Spark, you can refund the deposit back to a Bitcoin address:
// Refund a static deposit
const refundTxHex = await wallet.refundStaticDeposit({
  depositTransactionId: txId,
  destinationAddress: "bc1p...",
  satsPerVbyteFee: 10
});

// You'll need to broadcast this transaction yourself
console.log("Refund transaction hex:", refundTxHex);

// Or use refundAndBroadcastStaticDeposit to broadcast automatically
const txid = await wallet.refundAndBroadcastStaticDeposit({
  depositTransactionId: txId,
  destinationAddress: "bc1p...",
  satsPerVbyteFee: 10
});
Use cases for refunding:
  • You don’t like the quote from getClaimStaticDepositQuote
  • You prefer to avoid the double-fee scenario (claim fee + cooperative exit fee)
  • You want to send funds to a different address without using Spark

Confirmation Requirements

  • Deposits require 3 confirmations on L1
  • Funds will be available in your Spark wallet after claiming
  • Static deposits require manual claiming after confirmation

Minimum Deposit Amount

The minimum deposit must exceed the dust limit plus fees:
  • Dust limit: ~400 sats
  • Claim fee: ~99 sats (varies with network conditions)
Deposits below ~500 sats may fail with “utxo amount minus fees is less than the dust amount”.
Important: Static deposits do NOT auto-claim when your wallet is offline. If a deposit confirms while your wallet instance is not running, you must manually claim it using claimStaticDeposit() with the transaction ID when you next initialize the wallet.