
Withdrawal Flow
The complete process for withdrawing Bitcoin from Spark back to Layer 1:1
Get Fee Quote
Request a fee quote for your withdrawal with different speed options.
2
Initiate Withdrawal
Start the withdrawal process using the fee quote.
3
Monitor Status
Track the withdrawal status until completion.
Get Withdrawal Fee Quote
Request fee quotes for different withdrawal speeds before initiating a withdrawal.getWithdrawalFeeQuote(params)
Gets a fee quote for a cooperative exit (on-chain withdrawal). The quote includes options for different speeds and an expiry time and must be passed to withdraw before it expires.
Initiate Withdrawal
Start the withdrawal process using a fee quote.withdraw(params)
Initiates a cooperative exit to withdraw Bitcoin from Spark to Layer 1.
Monitor Withdrawal Status
Track the status of your withdrawal request.getCoopExitRequest(id)
Gets a cooperative exit request by ID to check withdrawal status.
Withdrawal Speeds
Spark offers three withdrawal speed options with different fee structures:Fast
Highest priority
Higher fees
~1-2 hours
Best for urgent withdrawals
Higher fees
~1-2 hours
Best for urgent withdrawals
Medium
Balanced option
Moderate fees
~4-6 hours
Good for most use cases
Moderate fees
~4-6 hours
Good for most use cases
Slow
Lowest priority
Lowest fees
~12-24 hours
Best for non-urgent withdrawals
Lowest fees
~12-24 hours
Best for non-urgent withdrawals
Real-time Withdrawal Monitoring
Monitor withdrawal status using event listeners.Error Handling
Implement proper error handling for withdrawal operations.Best Practices
- Get fresh quotes - Fee quotes expire, always get a new one before withdrawing
- Choose appropriate speed - Balance urgency with cost for your use case
- Monitor status - Use polling or events to track withdrawal progress
- Handle errors - Implement proper error handling for failed withdrawals
- Verify addresses - Always validate Bitcoin addresses before withdrawing
- Test first - Use regtest network for testing withdrawal flows
