Beam has released the highly anticipated Eager Electron set of products, and with v5.0 at block height 777,777 came the capability to create Confidential Assets directly on the Beam Privacy blockchain. This guide will assist you to use the functions and create your own first confidential asset with Beam.
To note, the following guide shows how to create a Confidential Asset connected to a local node on your own computer, although it is also possible to create a CA by connecting to any remote node.
My personal Beam nodes can be found at https://www.raskul.com/beam-nodes/ and to use a remote node, simply replace 127.0.0.1:10127 in the configurations below to point at the closest remote node to you.
You will need – 3000 Beams, which will be locked, to enable the creation of the Confidential Asset.
IMPORTANT NOTE: To retrieve these 3000 Beam, you will need to burn the entire number of the asset.
When you intend to distribute your own CA, you will not be able to retrieve these locked Beams without personally owning every single CA amount that you have issued.
Please be aware that the creation of a Confidential Asset is an important decision and it is recommended to try on Testnet first, as assets are immutable – TESTNET GUIDE HERE
What is a Confidential Asset?
A CA on the Beam blockchain is fully private asset, issued by you.
What can a Confidential Asset be used for?
CA’s can act as many things like loyalty points for your customers, individual tradable company shares and even confidential synthetics / digital assets like bonds or collateral-backed stable currencies. Use cases for CA’s are truly endless.
So let’s begin creating your first confidential asset on the Beam blockchain…
NOTE: This guide utilises the MAINNET of Beam, and any CA’s you create using this guide will LOCK the 3000 Beams you used to create it. That’s clear? then let’s continue…
Local CLI (Command-Line-Instruction) Node for your computer to allow your Beam Wallet to read the Blockchain and stay synchronised.
Local CLI (Command-Line-Instruction) Wallet for your computer to allow you to store your own immutable currency.
After NODE and WALLET are unzipped and on your computer, follow the steps below to get started.
Step 1 – beam-node.cfg
Using a simple text editor, add three lines into beam-node.cfg file and save it;
Step 2 – Synchronise the NODE
Open a terminal window (CMD on windows) and use the command:
Allow the node process to reach 100% synchronisation, as shown below (leave this window open and the process running):
Step 3 – Initiate the WALLET
Whilst leaving the node window open and running the node process, open a second terminal window and enter the command:
This will give you a new wallet, complete with 12 word seed phrase and an initial wallet address. Copy the seed phrase and store it somewhere safe. In that same window, now run the listener command to keep your wallet hearing the blockchain height from the node (leave the listening window open and the process running):
./beam-wallet listen -n 127.0.0.1:10127
Step 4 – Register your CA
To create a confidential asset on the Beam blockchain, you will require to have 3000 Beams (+tx fee) in your wallet.
./beam-wallet asset_reg --pass yourwalletpassword -n 127.0.0.1:10127 --asset_meta "SCH_VER=1;STD:N=CANameCoin;SN=CATicker;UN=CAFullName;NTHUN=CASingleUnitName" --fee 100 --enable_assets
Let’s break this command down a bit to understand it easier…
asset_reg = register the asset on the Beam blockchain
–pass = the wallet password your wallet was created with in step 2
-n = specify the node to listen on (can be 127.0.0.1:yournodeport or a remote node like pool.raskul.com:10127)
SCH_VER = metadata schema version, currently must be
STD:N = Give your Confidential Asset a unique name (eg Bitcoin).
SN = The shortened (or TICKER) name for your Confidential Asset (eg BTC)
UN = Full user-determined name for your Confidential Asset (eg Bitcoin)
NTHUN = Smallest denominational value of the Confidential Asset (eg Satoshi)
–fee = the fee to pay (in Beam) to register the Confidential Asset
–-enable_assets = The flag to command the wallet to enable Confidential Assets (reused in every CA command line)
There are also extra metadata options which provide a variety of functions including a way to add a favicon and a logo to your CA. Please see https://github.com/BeamMW/beam/wiki/Asset-Descriptor-v1.0 for more information.
The Beam wallet will then administer an ASSET ID, make a note of this. An example of the Wallet output is shown below. You can see in this example an Asset was created with Asset ID 1.
Your wallet will then perform interact with the Beam blockchain to create the asset you have specified.
See below the only public info which is shown, is the Asset ID and it’s unique ASSET CREATION HASH.
Step 5 – Issue amount of CA
After registering the asset, now it’s time to determine how many you want to issue in the first instance (you can add more to the amount at any time).
./beam-wallet issue --pass yourwalletpassword --asset_id 1 -n 127.0.0.1:10127 --amount AmountOfCAToCreate --fee 100 --enable_assets
Your wallet will then perform the processes and conversations with the Beam blockchain to issue the number of assets you have specified. In this case I have created 10127400000 ‘TICO COIN’.
See below the only public info which is shown, is the Asset ID and it’s numerical issuance. If in the future you were to issue further amounts of the same asset, this would also be shown in the blockchain – and the value of extra issued assets. This ensures that no infinite number of any one asset can be created without it being publicly known, and thus mitigating hidden inflation.
Extra – Burning the CA to receive your 3000 back
It is possible to obtain refund of your locked 3000 Beams, by burning the entire asset emission and unregistering the CA. The steps below show how this is done and will take at least a 48hr period to complete this process and have your locked Beams refund.
NOTE: To enable refund of the locked 3000 Beam – you MUST BURN EVERY SINGLE CA TOKEN (which means if you have sent even 0.00000001 of a CA to anyone, your 3000 Beams are not returnable until such time that your ASSET EMISSION is 0)
First you need to burn every token you have created – to do this we use the command CONSUME. Make sure you enter the EXACT amount of asset to burn int he command line by using the –amount (n) flag
./beam-wallet consume --amount 1--pass yourwalletpassword -n 127.0.0.1:10127 --asset_id 1 --fee 100 --enable_assets
After burning the CA, there is again a 24hr “Max Rollback” period to wait until you can unregister the CA and have your Beams refunded. Why the need to wait? The Beam node assigns an asset ID during the asset registration process and uses the first ID available.
Technically there can be a situation when one asset is unregistered, asset ID becomes available and the next registered asset takes the id that has been previously used. The 24hr lock period is introduced to ensure that asset receiver would never receive an unexpected (forged) asset and making sure that every CA is totally unique to it’s owner.
So after the 24hr period since burning the asset, you may now unregister the asset and receive your 3000 Beams back to the wallet which created the asset. Use the following command;
./beam-wallet asset_unreg--pass yourwalletpassword -n 127.0.0.1:10127 --asset_id 1 --fee 100 --enable_assets
Your locked 3000 Beams will then show up in your wallet.