Update docs/liquid/liquid-part2.md

This commit is contained in:
b0xxer 2024-01-28 08:11:37 -06:00
parent f37f53d128
commit d6f3543460

View File

@ -115,16 +115,18 @@ We can see that we've received 200,000,000 'sats' of our custom asset. However,
# Registering our Asset
The publication of asset metadata info on Liquid works on a `.well-known` system where specific files are published on a webserver that you control. There are a few different steps to accomplish this, so lets begin
The publication of asset metadata info on Liquid works on a `.well-known` system where specific files are published on a webserver that you control. There are a few different steps to accomplish this:
* Lets set a few environmental variables to make things easier:
1. Create a new legacy address[^4], get public key for that address.
2. Generate a Contract and Contract Hash using the information we want to appear in the public registry.
3. Create our asset with Contract Hash embedded in it
4. If we ever want to delete the asset from the registry, generate a delete script
5. Generate a `liquid-asset-proof` json file and place in `.well-known` location on domain that matches contract
6. Register (or unregister) the asset via Blockstream web API
```
$ export ASSET_REGISTRY_URL="https://assets.blockstream.info/"
$ export DOMAIN="coins.b0xxy.net" #NOTE: Needs to match what was in Contract Hash
$ export ASSET="41c19a473c71298a28342ccbf6fcbd3042cae8607b3b79d336b4c02e89ba2c66" #NOTE: Needs to match the asset you are registering
$ echo "Authorize linking the domain name $DOMAIN to the Liquid asset $ASSET" > liquid-asset-proof-$ASSET
```
Thats a lot of steps, and many are prone to error. Luckily for us there exist a bash script to basically do all of it. [Download script from Blockstream](https://docs.liquid.net/docs/blockstream-liquid-asset-registry#issuing-with-a-contract-hash)
Save that file as `issue_and_prepare_register.sh` and open with text editor to customize the following values.
Running the above will result in a file named `liquid-asset-proof-41c19a...` being created, and inside that file it will say `Authorize linking the domain name coins.b0xxy.net to the Liquid asset 41c19a...`