Update docs/liquid/liquid-part3.md

This commit is contained in:
b0xxer 2024-02-06 07:18:54 -06:00
parent 91b3bf217e
commit d7ebfd19c1

View File

@ -20,15 +20,13 @@ If we start thinking like a developer for second, this implies many things to bu
Sure, Stacker News could just do all this themselves using SQL, but lets assume that since they were clever boys & girls, they wanted to do as little of the hard work as possible. Sure, Stacker News could just do all this themselves using SQL, but lets assume that since they were clever boys & girls, they wanted to do as little of the hard work as possible.
Liquid would make a great solution for this case. They could simple direct their users to download one of the existing Liquid wallets[^1] and use the Liquid sidechain as the "accounting system" for their asset.
## Atomic Swaps ## Atomic Swaps
In this case, let's suppose our Customer has earned 1 SND token (which for our purposes is our pretend airline mile token) and now he wants to exchange that for L-BTC. How do we do that? Liquid would make a great solution for this case. They could direct their users to download one of the existing Liquid wallets[^1] and use the Liquid sidechain as the "accounting system" for their asset.
We could build some type of typical web-stack of NodeJS / SQL that would accept Asset A and then issue Asset B once received...however as we said our StackerNews crew is smart and therefore prefers to do *less hard work*. Moreover all of the above lends itself to risk of fraud and counterparty default. Suppose our Customer has earned 1 SND token (which for our purposes is our pretend airline mile token) and now he wants to exchange that for L-BTC. How do we do that?
Luckily, due to the additional OPCODEs in Liquid, Atomic Swaps are supported[^2]. In fact, [Blockstream has a tool](https://github.com/Blockstream/liquid-swap) to simplify using it[^3]. Luckily, in Liquid, Atomic Swaps are supported[^2]. In fact, [Blockstream has a tool](https://github.com/Blockstream/liquid-swap) to simplify using it[^3].
To do a swap we will need another wallet, as you can't swap between the same wallet (technically you can use the *same node* and use 2 different wallets on that node[^4]). In my case, I have 2 nodes each running their own `elementsd` server (Umbrel and my desktop). So I will use those, but you can use a single node by setting up multiple wallets and using distinct URL connect strings for each. To do a swap we will need another wallet, as you can't swap between the same wallet (technically you can use the *same node* and use 2 different wallets on that node[^4]). In my case, I have 2 nodes each running their own `elementsd` server (Umbrel and my desktop). So I will use those, but you can use a single node by setting up multiple wallets and using distinct URL connect strings for each.