For the complete documentation index, see llms.txt. This page is also available as Markdown.

🔁Swaps

How to swap bitcoin between your on-chain and lightning balances⚡

You can transfer bitcoin between your Alby Hub on-chain balance and your Alby Hub lightning balance through a swap, using its existing channels and receiving capacity. ⚡🔄

Overview:

  1. Swap In: Transfer funds from your on-chain balance to your lightning balance.

  2. Swap Out: Transfer funds from your lightning balance to your on-chain balance.

  3. Set up Auto Swaps

Swap In

Transfer funds from your on-chain balance to your lightning balance.

1. Navigate to "Wallet" and click on "Swap"

2. Enter a Swap Amount and click "Swap In"

3. Scan the QR using an external bitcoin wallet or use your Alby Hub funds

4. Wait for 1 on-chain confirmation

The swap is now initiated, and you'll see a "Waiting for confirmation" loading screen ⏳ Swap In needs 1 on‑chain confirmation (~10 minutes); once that's done, you'll receive an incoming payment notification! 🎉

5. Congrats. You successfully made a Swap In 🎉

If a Swap In fails or doesn't arrive in time, don't worry, your bitcoin are safe. Go to Debug Tools > List Swaps, note the Failed Swap ID, and then Debug Tools > Refund Swap, enter the ID, and click Done.


Swap Out

Transfer funds from your lightning balance to your on-chain balance.

1. Navigate to "Wallet" and click on "Swap"

2. Enter a Swap Amount and click "Swap Out"

You can also select an external on-chain wallet. However, please double check the wallet address before proceeding to avoid loss of funds.

3. Wait for deposit and 2 on-chain confirmations

The swap is now initiated, and you'll see a "Paying lightning invoice" loading screen ⏳ In just a few seconds, the state should change to "Waiting for 2 on-chain confirmations".

This is because Swap Out is a two step process. First our swap provider locks up the funds, and as soon as the lightning invoice is paid, we broadcast another transaction to claim it. Once that's done, you should be receiving bitcoin to your on-chain wallet! 🎉

Swap Out screen step 1: Waiting for deposit
Swap Out screen step 2a: Waiting for 2 on-chain confirmations
Swap Out screen step 2b: Waiting for another on-chain confirmation

4. Congrats. You successfully made a Swap Out 🎉


If a Swap Out fails or doesn't arrive in time, your lightning invoice payment will be canceled and your bitcoin will be returned automatically, no manual refund needed.

Set up Auto-Swaps

If manual swap-outs proof useful to you, you can automate them to maintain receiving capacity without manual intervention.

🔁Auto-Swaps

Also Checkout:

What happens if I lose access to my Hub while a swap is in progress?

Last updated

Was this helpful?