Update docs/liquid/liquid-part3.md

This commit is contained in:
b0xxer 2024-02-02 10:46:52 -06:00
parent fde426c14d
commit 53dbbc2ec0

View File

@ -19,15 +19,15 @@ Liquid would make a great solution for this case. They could simple direct their
## Atomic Swaps ## Atomic Swaps
So our client has 1 `StackerNewsDemo-1` token in their wallet (which for our purposes is our pretend airline mile token) and he wants to exchange that for L-BTC. How do we do that? Atomic Swaps allow two parties to exchange different tokens without the need for a 3rd party, eliminating most of the risk of fraud or ounterparty default.
Obviously, we could build some type of webservice that had SQL databases and nodejs files that accept Asset A and then issued Asset B once received...however as we said our StackerNews crew is smart and therefore prefers to do *less hardwork* In this case, our Customer has earned 1 SND token (which for our purposes is our pretend airline mile token) via previous purchases and he wants to exchange that for L-BTC. How do we do that?
Luckily, due to the additional OPCODEs in Liquid, it supports atomic swaps between assets. In fact, Blockstream has a tool to simplify using it (obviously the steps we do here manually with the tool would be automated within the server / client in production). We could build some type of webservice that had SQL databases and nodejs files that accept Asset A and then issued Asset B once received...however as we said our StackerNews crew is smart and therefore prefers to do *less hardwork*. Moreover all of the above lends itself to risk of fraud and counterparty default.
Obviously to do a swap, we will need another wallet, as you can't swap between the same wallet (you can refer to individual wallets in the swap-tool URL connect string by using the `http://user:password@localhost:7041/wallet/walletname` path) Luckily, due to the additional OPCODEs in Liquid, atomic swaps between assets are possible. In fact, Blockstream has a tool to simplify using it.
In my case, I have 2 nodes each running `elementsd` server (Umbrel and another). So I will use that, but point is this can be done one a single node by setting up mutliple wallets and using distinct URL connect strings. Obviously to do a swap, we will need another wallet, as you can't swap between the same wallet (you can use the *same node* but use *different wallets*. You can refer to individual wallets in the swap-tool URL connect string by using the `http://user:password@localhost:7041/wallet/walletname` path). In my case, I have 2 nodes each running their own `elementsd` server (Umbrel and my desktop). So I will use those, but point is this can be done one a single node by setting up mutliple wallets and using distinct URL connect strings.
Before we start, let's look at state of our 2 wallets: Before we start, let's look at state of our 2 wallets:
@ -45,7 +45,7 @@ Before we start, let's look at state of our 2 wallets:
}, },
``` ```
For our example, we can assume that StackerNews Airline (Node 1) is willing to accept a SND-1 token and return to the client 23,000 sats (approx $1 USD currently). So Node1 makes the following proposal For our example, we can assume that StackerNews Airline (Node 1) is willing to accept a SND token and return to the client 23,000 sats (approx $1 USD currently). So Node1 makes the following proposal
``` ```
# StackerNews Airline, Inc. # StackerNews Airline, Inc.
@ -100,12 +100,14 @@ Now lets review the state our wallets post swap:
## Securities / Transfer Restricted / etc ## Securities / Transfer Restricted / etc
# Pegging Out
# Discussion
## Lightning Integration ## Lightning Integration
What if you have no desire to create tokens, securities, etc...can you still make use of Liquid?
Yes, probably one of the best ways to do that is to use it as a *staging area* for opening Lightning channels. In fact, both Blockstream Green and the newly announced (more user friendly) AQUA both do that under-the-hood.
One of the main
## Using Liquid with BTC / LN ## Using Liquid with BTC / LN
### Comparing eCash / Lightning / Liquid / BTC ### Comparing eCash / Lightning / Liquid / BTC
@ -124,7 +126,11 @@ Now lets review the state our wallets post swap:
|Likely Threat:| Debasement or Mint rug | Theft of funds while offline | Federation censorship | Losing keys / unspendable UTXO for fees |Likely Threat:| Debasement or Mint rug | Theft of funds while offline | Federation censorship | Losing keys / unspendable UTXO for fees
|Maturity: | 2023-2024 | 2018 | 2018 | 2009 |Maturity: | 2023-2024 | 2018 | 2018 | 2009
## Building Your Own Federation ## Building Your Own Federation
## Pegging Out
# Final Discussion and Ideas