Creating User Issued Assets
A guide to create UIAs, also known as Fan Tokens or Community Asset Tokens (CATs).
1. Creating User Issued Assets (UIAs)
There are many reasons to create assets. Peerplays allows individuals and companies to create and issue their own tokens for anything they can imagine. The potential use cases for these User Issued Assets (UIAs) are innumerable. On the one hand, UIAs can be used as simple event tickets deposited on the customers mobile phone to enter a concert or movie. On the other hand, they can be used for crowd funding, ownership tracking, or even to sell equity of a company in form of stock. UIAs are incredibly versatile and can help solve a plethora of use cases like...
event tickets
reputation points
loyalty reward points
flight miles
company shares
fan credits
crowd funding
digital property
All you need to do is to define your preferred parameters for your coin, such as supply, precision, symbol, and description to see your coin’s birth after only a few seconds. From that point on, you can issue some of your coins to whomever you want, sell them, and see them instantly traded against any other existing coin on Peerplays.
Unless you want some restrictions, as the issuer, you have certain privileges over your coin. For instance, you can allow trading only in certain market pairs and define who actually is allowed to hold your coin by using whitelists and blacklists. An issuer can opt-out of their privileges indefinitely for the sake of trust and reputation.
As the owner of your new coin, you don’t need to take care of all the technical details of blockchain technology, such as distributed consensus algorithms, blockchain development, or integration. You don’t even need to run any mining equipment or servers, at all.
The regulations that apply to each kind of token vary widely and are often different in every jurisdiction. Hence, Peerplays comes with tools that allow issuers to remain compliant with all applicable regulations when issuing assets assuming regulators allow such assets in the first place.
1.1. User Issued Assets vs. Market Issued Assets
A User Issued Asset allows the issuer to control the supply of the asset. A Market Issued Asset (MIA, and also known as a Market Pegged Asset, MPA, or Smart Coin) puts the control of the asset's supply in the hands of the market.
Market issued assets are used for pegging the value of an asset to another underlying asset. This type of asset requires collateral to back its value and a fair market price feed so the market can automatically trigger margin calls to balance the market asset value. Market issued assets will be the subject of another guide.
User issued assets are controlled and distributed by the issuing user. This guide will focus on the creation of UIAs.
1.2. Creating Assets
create_asset
This function creates a new user issued or market issued asset. Many of the asset's options can be changed later using update_asset
. You must provide raw JSON data structures for the options
object.
The basic structure of the create_asset
function looks like this:
Parameters
Example Call
In this example call we used the following settings for the common
parameter:
Please see section 1.4. Asset Options for an explanation of the common
parameter!
Important Note:
The null
for the second to last parameter is essential for making a user issued asset.
A set of curly braces, {}
for the parameter could be used to construct a market issued asset, but that is the subject of another guide.
1.3. Updating Assets
A UIA can be modified by the issuer after its creation. A separate call, update_asset
, has been created for this purpose.
What can and cannot be changed? Except for the symbol and precision, every parameter, option, or setting can be updated.
Note that once a permission is removed, it can never be re-enabled again!
update_asset
This function updates the core options on an asset. There are a number of options which all assets in the network use. These options are enumerated in the asset_object::asset_options
struct. This command is used to update these options for an existing asset.
The basic structure of the update_asset
function looks like this:
Parameters
Example Call
In this example call we used the following settings for the common
parameter:
Please see section 1.4. Asset Options for an explanation of the common
parameter!
Using update_asset
will overwrite all the perviously set options with the new options you enter here. So make sure all the options you need are present in the new options object!
1.4. Asset Options
The asset_options
object contains the options that are common to all assets. This is why it's necessary to supply for both UIAs and MIAs. The options need to be passed as a raw JSON object that contains these settings:
Let's break these down one-by-one. Pay special attention to the permissions and flags as they are the most complicated part of the options object.
permissions & flags
Permissions and flags go together. Permissions settings determine if the issuer has the ability to update the corresponding flags. The flags are the actual on-off switches for the various asset options. Here are the available flags and their effects:
charge_market_fee
: an issuer-specified percentage of all market trades in this asset is paid to the issuer.white_list
: accounts must be white-listed in order to hold this asset.override_authority
: issuer may transfer asset back to their own account from another account.transfer_restricted
: require the issuer to be one party to every transfer.disable_force_settle
: disable force settling.global_settle
: (only for MIAs) allows market asset issuer to force a global settling - this may be set in permissions, but should not be set as a flag. Unless, for instance, a prediction market has to be resolved. If this flag has been enabled, no further shares can be borrowed!disable_confidential
: allow the asset to be used with confidential transactions.witness_fed_asset
: allow the asset to be fed by witnesses.committee_fed_asset
: allow the asset to be fed by the committee.
The permissions/flags in the asset_details
are integers and are a sum of the following mapping:
So in our case, we set flags
to 0, which means all of these are disabled initially. The permissions
is set to 79, which means that "charge_market_fee", "white_list", "override_authority", and "disable_confidential" are able to be modified later. The other properties are immutable since they were set to false initially.
exchange rate
The core_exchange_rate
option consists of a base
section and a quote
section:
The idea is to create a ratio of an amount of PPY and an amount of the new asset.
In this example, we have 21 PPY and 76,399 of the new asset (BTFUN). This would make the exchange rate 3,638.05 BTFUN per 1 PPY. (76399 / 21 = 3,638.05)
The asset_id
in the base
section will always be "1.3.0"
, the ID of PPY.
The asset_id
in the quote
section will be unknown at the time the asset is being created. That's ok. Putting "1.3.1"
here will be detected and overwritten by the blockchain with the new ID. Then you can get the new ID with the get_asset
function.
1.5. Issuing Assets
So far creating assets with create_asset
doesn't actually produce the new tokens into anyone's account. For that we use the issue_asset
function.
issue_asset
Issues new shares of an asset that exists via create_asset
.
2. Reserved Tokens
Some token names (symbols) are reserved by the blockchain because they are assets that already exist, on or off-chain. This is to avoid confusion and prevent scams. The most popular assets have been reserved and are listed below. The symbols listed here are controlled by the Peerplays SONs son-account
. If a genuine user wants to create an asset with the symbol, the SONs will raise a proposal and the Witnesses will vote to transfer the ownership to the user.
2.1. List of Reserved Tokens
3. Related Documents
The functions listed in this guide will cost transaction fees. To calculate how much PPY you'll need to make these transactions and meet your development goals, please see the Calculating Costs guide.
Last updated