Update docs/liquid/liquid-part2.md
This commit is contained in:
parent
4f58c6b252
commit
4d64a37818
@ -35,8 +35,8 @@ Issuing assets is pretty straight forward, it can be roughly broken down into 3
|
|||||||
2. Generate a Contract Hash using that PUBKEY
|
2. Generate a Contract Hash using that PUBKEY
|
||||||
3. Issue the Asset
|
3. Issue the Asset
|
||||||
|
|
||||||
* STEP 1: 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 and get its public key
|
||||||
`$ LEG_ADDRESS=$(sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getnewaddress "" legacy`)
|
`$ sudo ./scripts/app compose elements exec node elements-cli -rpcuser=$E_RPCUSER -rpcpassword=$E_RPCPASS getnewaddress "" legacy`
|
||||||
|
|
||||||
lq1qq2s92z0uq78kd4gfepua6qvfwx40g4lqqer9e3tzrr0j04ugyzsed39mnh9wvuhw0hmaqy5mxs9egqrr7j3rx8j2sdyun9m90
|
lq1qq2s92z0uq78kd4gfepua6qvfwx40g4lqqer9e3tzrr0j04ugyzsed39mnh9wvuhw0hmaqy5mxs9egqrr7j3rx8j2sdyun9m90
|
||||||
|
|
||||||
@ -72,23 +72,14 @@ DOMAIN="nulldata.org"
|
|||||||
NAME="StackerNews-Demo1"
|
NAME="StackerNews-Demo1"
|
||||||
PRECISION=8
|
PRECISION=8
|
||||||
TICKER="SND-1"
|
TICKER="SND-1"
|
||||||
CONTRACT='{"entity":{"domain":"'$DOMAIN'"},"issuer_pubkey":"'$PUBKEY'","name":"'$NAME'","precision":'$PRECISION',"ticker":"'$TICKER'","version":'0'}'
|
|
||||||
CONTRACT_HASH=$(echo -n "${CONTRACT}" | sha256sum | sed 's/ .*//g')
|
|
||||||
|
|
||||||
#Generate a byte-aligned reveresed CONTRACT_HASH for use in asset Creation
|
|
||||||
TEMP=$CONTRACT_HASH
|
|
||||||
LEN=${#TEMP}
|
|
||||||
until [ $LEN -eq "0" ]; do
|
|
||||||
END=${TEMP:(-2)}
|
|
||||||
CONTRACT_HASH_REV="$CONTRACT_HASH_REV$END"
|
|
||||||
TEMP=${TEMP::$((${#TEMP} - 2))}
|
|
||||||
LEN=$((LEN-2))
|
|
||||||
done
|
|
||||||
|
|
||||||
### END EDITING HERE ###
|
### END EDITING HERE ###
|
||||||
|
CONTRACT='{"entity":{"domain":"'$DOMAIN'"},"issuer_pubkey":"'$PUBKEY'","name":"'$NAME'","precision":'$PRECISION',"ticker":"'$TICKER'","version":'0'}'
|
||||||
|
|
||||||
|
CONTRACT_HASH=$(python -c 'import json,sys; sys.stdout.write(json.dumps(json.loads(sys.argv[1]), sort_keys=True, separators=(",",":")))' "$CONTRACT" | sha256sum | head -c64 | fold -w2 | tac | tr -d "\\n")
|
||||||
|
|
||||||
echo CONTRACT=$CONTRACT
|
echo CONTRACT=$CONTRACT
|
||||||
echo CONTRACT_HASH=$CONTRACT_HASH
|
echo CONTRACT_HASH=$CONTRACT_HASH
|
||||||
echo CONTRACT_HASH_REV=$CONTRACT_HASH_REV
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* 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:
|
||||||
@ -143,7 +134,7 @@ export CONTRACT_HASH_REV=967f329b873d20253852236bcb4aab8df355356c06a4f0190361dfe
|
|||||||
- It has only been issued once
|
- It has only been issued once
|
||||||
- However both the issued amount and the circulating supply has been hidden from us.
|
- However both the issued amount and the circulating supply has been hidden from us.
|
||||||
|
|
||||||
This Confidential Asset has ultimate privacy, we can't really see anything about it. But sometimes its useful to have assets where people can verify the total amount in circulation, so lets do that:
|
This Confidential Asset has ultimate privacy, we can't really see anything about it. It Is possible to export information to specific clients so that they can see this info, however in most cases its preferred that this information is publicly available. For instance, if we wanted th public to know the total issuance of an asset without needing any special information, so lets do that:
|
||||||
|
|
||||||
### Issuing a Non-Confidential Asset
|
### Issuing a Non-Confidential Asset
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user