AMP Reissuance, Distribute, Burn Process

The reissuance, distribution and burn of AMP assets requires the use of the blockstream-amp-confirm.py script. This will be sent to you when an AMP account is created for you by Blockstream.

πŸ“˜

wallet.dat

Please note that if you have password locked your node's wallet you will need to manually unlock if before running the blockstream-amp-confirm.py script referenced below. You will also need L-BTC in your wallet to fund the transaction.

A note on wallet loading

If you need to load a specific wallet that the blockstream-amp-confirm.py script should target, you can provide the wallet path in the node url parameter like this:

-n "http://your_rpc_username:[email protected]:your_rpc_port/wallet/wallet_name"

The wallet you are targeting will need to be loaded before you can use it. You can either do this before the script is called or use the RPC loadwallet and set load_on_startup to true so that wallet will always be loaded on node startup. So do it once for each wallet and then you are good to use the .py script just by specifying the wallet name as a node parameter as shown above.

Reissuance

To increase the amount of an asset in circulation you need to reissue it. Creating more of the asset allows more assignments to be made, then distributed.

The reissuance can only be done by the Elements wallet that the asset was initially issued to and requires that the initial issuance was created as reissuable. It is therefore very important that the associated wallet is backed up and ongoing access ensured.

To reissue more of the asset you first need to get the reissuance data from AMP that will then be used to perform the actual issuance.

Use the /assets/{asset_uuid}/reissue-request endpoint to get the reissuance data from AMP. The endpoint returns JSON data which you need to save to a file. E.g. reissue.json. The reissuance data returned contains the data your Elements node will later use to do the actual reissuance.

When calling reissue-request you need to take the precision of the asset into account. If, for example, the asset was issued with a precision of 2 decimal places a value of 1234 would actually issue 12.34 new asset. This will show as 1234 sats in your Elements node as Elements doesn't use the Blockstream Asset Registry. Any excess asset you reissue and do not allocate can always be burned later if needed.

To perform the actual reissuance use the blockstream-amp-confirm.py script.

The β€œRPC” arguments below (name, password, port) for the Elements node and can be found in your elements.conf. The AMP API username and password are the ones provided to you by Blockstream.

Example script run (passing in the name of the reissuance data file as reissue.json).

python3 blockstream-amp-confirm.py -u "amp_api_username" -p "amp_api_password" -n http://your_rpc_username:[email protected]:your_rpc_port reissue -f reissue.json

The script takes 2-3 minutes to run as after making the call to the Elements node the script will wait for 2 confirmations and then send the transaction data back to AMP so it can track the asset balance correctly. Make sure you let the script complete before shutting down the process that called it and the Elements node itself.

Distribution

Before the asset can be distributed to the wallet’s of the investors you must have assigned it using the AMP API.

You can see the assignments that are waiting to be distributed using the /assets/{assetUuid}/assignments endpoint. The assignments that have not been distributed yet will not have a distribution_uuid and the is_distributed flag will be False. Distributions will only show in the distributions\* endpoints after the distribution process is complete. Until complete, the distribution is considered an assignment.

To get the data from AMP that is needed for the Elements node to carry out the actual distribution you need to use the /assets/{assetUuid}/distributions/create/ endpoint. The will return the distribution data from AMP. The endpoint returns JSON data which you need to save to a file. E.g. distribution.json. The distribution data returned contains the data your Elements node will later use to do the actual distribution.

The file contains address:amount pairs that the Elements node will use to create and broadcast the distribution transaction in the next step.

To perform the actual distribution use the blockstream-amp-confirm.py script.

The β€œRPC” arguments below (name, password, port) for the Elements node and can be found in your elements.conf. The AMP API username and password are the ones provided to you by Blockstream.

Example script run (passing in the name of the distribution data file as distribution.json):

python3 blockstream-amp-confirm.py -u "amp_api_username" -p "amp_api_password" -n http://your_rpc_username:[email protected]:your_rpc_port distribute -f distribution.json

The script takes 2-3 minutes to run as after making the call to the Elements node the script will wait for 2 confirmations and then send the transaction data back to AMP so it can track the asset balance correctly. Make sure you let the script complete before shutting down the process that called it and the Elements node itself.

Burn

To carry out a burn you need to get the data burn data from AMP that will then be used to perform the actual burn.

Use the /assets/{asset_uuid}/burn-request endpoint to get the burn data from AMP. The endpoint returns JSON data which you need to save to a file. E.g. burn.json. The burn data returned contains the data your Elements node will later use to do the actual burn.

When calling burn-request you need to take the precision of the asset into account. If the asset was issued with a precision of 2 decimal places a value of 1234 would actually burn 12.34.

To perform the actual burn use the existing blockstream-amp-confirm.py script.

The β€œRPC” arguments below (name, password, port) for the Elements node and can be found in your elements.conf. The AMP API username and password are the ones provided to you by Blockstream.

Example script run (passing in the name of the distribution data file as burn.json):

python3 blockstream-amp-confirm.py -u "amp_api_username" -p "amp_api_password" -n http://your_rpc_username:[email protected]:your_rpc_port burn -f burn.json

The script takes 2-3 minutes to run as after making the call to the Elements node the script will wait for 2 confirmations and then send the transaction data back to AMP so it can track the asset balance correctly. Make sure you let the script complete before shutting down the process that called it and the Elements node itself.


The Liquid Network is a Bitcoin layer-2 enabling the issuance of security tokens and other digital assets.

Β© 2023 Liquid Network
All rights reserved.

Feedback and Content Requests

We'd be happy to hear your suggestions on how we can improve this site.

BuildOnL2 Community

The official BuildOnL2 community lives
at community.liquid.net. Join us and build the future of Bitcoin on Liquid.

Telegram

Community-driven telegram group where
most of the Liquid developers hang out.
Go to t.me/liquid_devel to join.