Swap-in-Potentiam: Moving Onchain Funds "Instantly" To Lightning



Summary:

In an email exchange, Laolu explained to ZmnSCPxj that the address generated by the `loop in --external` command is not safe for reuse since it contains a swap hash in the script, making it similar to a vanilla invoice on LN today. The potentiam swap is a deferred two-stage swap that can only be completed after three transactions, making it less efficient from an on-chain perspective compared to the Loop In swap. However, it gives Alice more optionality and enables the final step of sweeping on the chain to be batched with other related or distinct swaps. Laolu suggests that the Loop In swap addr can be made pseudo-reusable by adding a "cancel" leaf in the rooted tapscript, but it would slow down the process as another level of relative timeout would be needed for Alice to get the funds back. ZmnSCPxj asks if the address given by the `loop in --external` command is safe for reuse. He also notes that Swap-in-potentiam is safe for address reuse because each UTXO for the same address backs a new, separate swap if Alice wanted it. This creates stable addresses that are safe for reuse and can still be spent from quickly on the Lightning Network as soon as they are reasonably confirmed.


Updated on: 2023-06-03T11:23:14.579589+00:00