Here’s how you can build a lightning based stablecoin wallet to take on volatility
Without custodians
Without KYC
Without shitcoins
Without derivatives
Introducing Fiat Swaps
1/9 🧵👇
What does Strike do? They take your incoming lightning payment, convert it to fiat and credit your account.
What keeps you from doing this on Bitcoin?
Luckily we have a way to exchange Bitcoin for other assets in a trustless and noncustodial way:
Atomic Swaps
Why not do an atomic swap to exchange a lightning payment to a stablecoin immediately?
Probably because then you still carry the risk that your swap provider is unresponsive or the exchange rate changes quickly.
3/
What if we can make these atomic swaps dependent on the state of the lightning payment?
This is how it works:
Wallet user C creates a payment secret and sends its hash to the Fiat Swap node B, who creates an invoice with it as the preimage.
B sends this invoice back to A.
User C now has an invoice that he can give to anyone.
Once the payment starts, B creates a UTXO that can only be spent by revealing the payment secret. C sends the UTXO to his own wallet by revealing this payment secret.
B learns the payment secret and can settle the invoice.
Node B has received the lightning payment and user C has received the stablecoin UTXO.
Atomically. Noncustodially.
This works both for a user being sender and receiver!
„But sending 2 onchain transactions takes long and is expensive“ I hear you say.
The transaction does not have to be confirmed and can be claimed by using CPFP on the following transaction.
The stablecoin settlement can also happen after the lightning settlement.
Using Liquid (or any other low fee chain) for the stablecoin transaction makes it cheap. Fees could be as low as 100sat per Fiat-Swap.
And the best part:
The user does not even need a lightning channel! Easy onboarding for people without paying upfront fees.
„Why not just send a stablecoin directly?"
Interoperability. What if the sender wants USDT on Liquid and the sender only has #Bitcoin or USDC on ETH L2?
Sender and receiver can independently chose which asset they want to use for the transaction.