Update docs/liquid/liquid-part2.md

This commit is contained in:
b0xxer 2024-01-26 10:19:27 -06:00
parent f9a5783a04
commit c34068ed29

View File

@ -25,7 +25,7 @@ Looking up this value on [https://blockstream.info/liquid/assets](https://blocks
![](1-part2-assets.png) ![](1-part2-assets.png)
This shows us the total amount of L-BTC in circulation, additionally we can see how much was Pegged-In, Out, and Burned. Most notably, this confirms that everything is in balance. The Circulating Supply = (PEG_IN - PEG_OUT - BURNED). No inflation happening. This shows us the total amount of L-BTC in circulation, additionally we can see how much was Pegged-In, Out, and Burned. Most notably, this confirms that everything is in balance. The Circulating Supply = (PEG_IN - PEG_OUT - BURNED), so no debasement has happened.
### Issuing our own Asset ### Issuing our own Asset
@ -35,12 +35,11 @@ Issuing assets is pretty straight forward, it can be roughly broken down into 3
2. Generate a Contract Hash 2. Generate a Contract Hash
3. Issue the Asset 3. Issue the Asset
* STEP 1a: Let's generate our legacy address and set the output to a variable * STEP 1: Let's generate our legacy address and set the output to a variable
`$ LEG_ADDRESS=$(sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getnewaddress "" legacy`) `$ LEG_ADDRESS=$(sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getnewaddress "" legacy`)
lq1qq2s92z0uq78kd4gfepua6qvfwx40g4lqqer9e3tzrr0j04ugyzsed39mnh9wvuhw0hmaqy5mxs9egqrr7j3rx8j2sdyun9m90 lq1qq2s92z0uq78kd4gfepua6qvfwx40g4lqqer9e3tzrr0j04ugyzsed39mnh9wvuhw0hmaqy5mxs9egqrr7j3rx8j2sdyun9m90
* STEP 1b: Set this address to a variable for use later and generate the public key.
- `$ export LEG_ADDRESS="lq1qq2s92....."` - `$ export LEG_ADDRESS="lq1qq2s92....."`
- `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getaddressinfo $LEG_ADDRESS | jq '.pubkey'` - `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getaddressinfo $LEG_ADDRESS | jq '.pubkey'`
@ -92,7 +91,7 @@ echo CONTRACT_HASH=$CONTRACT_HASH
echo CONTRACT_HASH_REV=$CONTRACT_HASH_REVT_HASH_REV=$CONTRACT_HASH_REV echo CONTRACT_HASH_REV=$CONTRACT_HASH_REVT_HASH_REV=$CONTRACT_HASH_REV
``` ```
* STEP 2: Now we can use the script we saved before to generate the contract: * Now we can use the script we saved before to generate the contract:
- `$ ./gen_asset_contract.sh $PUBKEY` - `$ ./gen_asset_contract.sh $PUBKEY`
@ -103,7 +102,7 @@ echo CONTRACT_HASH_REV=$CONTRACT_HASH_REVT_HASH_REV=$CONTRACT_HASH_REV
CONTRACT_HASH_REV=a1e4772b20e406a4ba665f266802a29f0183c7aacb52b7788f801fc7aed54bdf CONTRACT_HASH_REV=a1e4772b20e406a4ba665f266802a29f0183c7aacb52b7788f801fc7aed54bdf
* STEP 2: Finally export those variables via bash to use later: * Finally export those variables via bash to use later:
``` ```
export CONTRACT={"entity":{"domain":"nulldata.org"},"issuer_pubkey":"025aa49d444a150c99c904c8e779e5317aff4aee15ee9171f450e14af9dd8b8780","name":"StackerNews-Demo1","precision":8,"ticker":"SND-1","version":1} export CONTRACT={"entity":{"domain":"nulldata.org"},"issuer_pubkey":"025aa49d444a150c99c904c8e779e5317aff4aee15ee9171f450e14af9dd8b8780","name":"StackerNews-Demo1","precision":8,"ticker":"SND-1","version":1}
@ -117,19 +116,22 @@ export CONTRACT_HASH_REV=947a135a03e5e4f2fcfd295de987a388d06311bdc6c491950ed08f2
- `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS issueasset 10 0 true $CONTRACT_HASH_REV` - `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS issueasset 10 0 true $CONTRACT_HASH_REV`
{ {
"txid": dd3983619f67e7a743ccfd32e48bbdb591c1d44b86a71d442be95a2453c0479a, "txid": "6ef6b04b34e27d79c0b66d817bc23a81bc6a56b289b6a45a28b71489adca0825",
"vin": 0, "vin": 0,
"entropy": cd3d7319525b28b6500d0a0b4688d91392ba8192be9bc264ec9637a001907322, "entropy": "570671c45afd4b9bfd085e5e965333e32f3988d3b68d4baf276ff3f833f8f531",
"asset": 1e69f87952c26b8dfc80dda0427041a0279a0723ea12086b88b75752545e0d22, "asset": "b142fb9ec2c7821f025f3ae806cfbec6e9faccbf876a531e8a207b45bc6a285a",
"token": 2dc5fb795fd42e08adb9dd29b5ff14f4326ecd8443e1cdc31dc6666d7576ff89 "token": "f13a9858f5acec84f8195d95c764c839812deeee297ca654ba1f25d650e1b8ea"
} }
## Exploring our Confidential Asset
* Checking out our wallet we see: * Checking out our wallet we see:
- `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getwalletinfo` - `$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getwalletinfo`
"balance": {"1e69f87952c26b8dfc80dda0427041a0279a0723ea12086b88b75752545e0d22": 10.00000000,"bitcoin": 0.00148701} "balance": {"b142fb9ec2c7821f025f3ae806cfbec6e9faccbf876a531e8a207b45bc6a285a": 10.00000000,
"bitcoin": 0.00140447,}
* We can see our wallet has 10 of our assets[^2], lets checkout what the [Liquid network knows about it](https://blockstream.info/liquid/asset/1e69f87952c26b8dfc80dda0427041a0279a0723ea12086b88b75752545e0d22): * We can see our wallet has 10 of our assets[^2], lets checkout what the [Liquid network knows about it](https://blockstream.info/liquid/asset/b142fb9ec2c7821f025f3ae806cfbec6e9faccbf876a531e8a207b45bc6a285a):
![](2-part2-firstasset.png) ![](2-part2-firstasset.png)