Submarine Swap

Swapping on-chain coins for a Lightning balance, or back, without a custodian.

Basically

A swap between normal on-chain bitcoin and a Lightning balance where neither side has to trust the other — either both legs happen or neither does.

Key Takeaways

  • Uses the same hash time-locked contract (HTLC) secret on-chain and on Lightning to bind the two payments atomically.
  • Loop Out moves funds from Lightning back to an on-chain address; Loop In refills a channel from on-chain coins.
  • The standard way nodes and wallets rebalance liquidity without closing channels.

How the atomicity works

One side creates a secret preimage and pays a Lightning invoice locked to its hash; the other locks on-chain coins to a script that pays out if the same preimage is revealed before a block height, or refunds after. The moment the on-chain output is claimed with the secret, that secret is visible on-chain and settles the Lightning HTLC along the route.

Why users care

A wallet with only Lightning channels can still pay any regular Bitcoin address, and a node whose channels are all pushed to one side can refill without closing and reopening on-chain.

0

← All 1876 glossary terms