Understanding Bitcoin Swaps
Medusa Wallet integrates with Boltz to enable trustless swaps between on-chain Bitcoin and Lightning Network. This allows you to:- Fund your Lightning wallet from on-chain Bitcoin
- Withdraw to on-chain from your Lightning balance
- Rebalance between networks as needed
Swaps are powered by Boltz, a non-custodial exchange that enables trustless atomic swaps between Bitcoin networks.
Swap Directions
On-chain to Lightning (Submarine Swap)
Move Bitcoin from a regular on-chain address into your Lightning wallet. Use cases:- Adding funds to start using Lightning
- Converting long-term storage to spending money
- Funding Lightning from a hardware wallet
Lightning to On-chain (Reverse Swap)
Move Bitcoin from your Lightning wallet to an on-chain address. Use cases:- Long-term storage (cold wallet)
- Withdrawing to an exchange
- Converting Lightning back to on-chain
- Emptying Lightning channels
Creating a Swap
Choose Direction
Select the swap direction:
- On-chain to Lightning: You’ll send on-chain BTC to receive Lightning sats
- Lightning to On-chain: You’ll send Lightning sats to receive on-chain BTC
Specify Amount
Enter the swap amount in satoshis.Amount limits are displayed on the screen:
- Minimum: Typically a few thousand sats
- Maximum: Varies based on Boltz liquidity
Choose Amount Option
Select whether the amount you entered is:
- Send specified amount: You send exactly this amount (you receive less due to fees)
- Receive specified amount: You receive exactly this amount (you send more to cover fees)
This determines whether the fees are deducted from what you send or added to what you need to send.
Enter On-chain Address
Enter the Bitcoin on-chain address:
- For On-chain → Lightning: Your refund address (in case swap fails)
- For Lightning → On-chain: Destination address where you’ll receive funds
Completing a Swap
On-chain to Lightning
Send On-chain Bitcoin
After creating the swap, you’ll see:
- A Bitcoin address
- QR code
- Expected amount to receive
Wait for Confirmations
The swap requires on-chain confirmations:
- Usually 1-3 confirmations needed
- Monitor progress in swap history
- Current block height is displayed
On-chain confirmations take approximately 10 minutes per block.
Lightning to On-chain
Swap Created and Paid
When you create a Lightning → On-chain swap:
- Lightning payment is automatically sent from your wallet
- Your Lightning balance decreases immediately
- Swap status shows as “pending”
Wait for On-chain Transaction
Boltz creates the on-chain transaction:
- Monitor in swap history
- Current block height is displayed
- Timeout is shown
Swap Fees and Limits
Fee Structure
Boltz charges fees for swaps:- Service Fee: Small percentage of swap amount
- Mining Fees: On-chain network fees
- Total Cost: Displayed before confirming
Amount Limits
Swaps have minimum and maximum limits:- Minimum: Usually around 50,000 sats (0.0005 BTC)
- Maximum: Varies based on available liquidity
- Check Screen: Current limits displayed when creating swap
Swap History
View and manage your swaps:View Swap Details
Tap any swap to see:
- Swap direction
- Amount sent and received
- On-chain address
- Current status
- Timeout block height
- Boltz fee
Current Block Height
The swap history displays:- Current Bitcoin block height
- Timeout for each swap
- Time remaining (estimated)
If current block height exceeds timeout and swap is still pending, the swap has timed out and will be refunded.
Auto Swaps
Medusa Wallet supports automatic reverse swaps (Lightning → On-chain) that trigger when your wallet reaches a certain balance.Creating Auto Swap
Configure Auto Swap
Set up your automatic swap:
- Wallet: Which Lightning wallet to monitor
- Threshold Amount: Balance that triggers the swap
- Destination Address: Where to send on-chain Bitcoin
Managing Auto Swaps
In auto swap history:- View all configured auto swaps
- See how many times each has triggered
- Delete auto swaps when no longer needed
- Monitor total amount swapped
Best Practices
Troubleshooting
Swap Failed
Common reasons swaps fail:-
Insufficient Amount
- Below minimum limit
- Not enough for fees
- Solution: Increase swap amount
-
Timeout Reached
- On-chain transaction not confirmed in time
- Block height exceeded timeout
- Solution: Funds will be refunded automatically
-
Invalid Address
- Incorrect address format
- Unsupported address type
- Solution: Use a standard Bitcoin address (P2PKH, P2SH, or Bech32)
-
Insufficient Lightning Balance
- Not enough sats for Lightning → On-chain
- Solution: Reduce swap amount or add funds
Swap Stuck
If a swap appears stuck:-
Check Block Height
- Compare current height to timeout
- Refresh the swap history
-
Verify On-chain Transaction
- Use a block explorer to check the address
- Confirm transaction was sent (for submarine swaps)
-
Wait for Confirmations
- On-chain requires time
- Each block is ~10 minutes
-
Contact Support
- If timeout exceeded and no refund
- Provide swap ID from history
Refund Not Received
Technical Details
Submarine Swaps (On-chain → Lightning)
- You create swap and receive an address
- You send on-chain BTC to that address
- Boltz waits for confirmations
- Boltz pays your Lightning invoice
- Boltz claims your on-chain payment
Reverse Swaps (Lightning → On-chain)
- You create swap with destination address
- Boltz creates on-chain transaction
- You pay Boltz Lightning invoice
- Boltz broadcasts on-chain transaction
- You receive on-chain BTC after confirmations
Trustless Nature
Swaps use Hash Time-Locked Contracts (HTLCs):
- No party can steal funds
- Either swap completes or refunds
- Timeout protection for both sides
- No custody of your funds
Next Steps
- Learn about sending and receiving Lightning payments
- Manage multiple wallets for different purposes
- Use your Lightning address for easy receiving