Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETP1: How Do Enecuum Tokens Work #2

Open
svanurin opened this issue May 18, 2020 · 0 comments
Open

ETP1: How Do Enecuum Tokens Work #2

svanurin opened this issue May 18, 2020 · 0 comments

Comments

@svanurin
Copy link
Member

svanurin commented May 18, 2020

How Do Enecuum Tokens Work

Trinity protocol allows Enecuum users to issue own tokens. Management of tokens (emission, transfer) is embedded into the protocol (no smart contracts deployment needed).

There are two types of tokens: mineable and non-mineable. Mineable and non-mineable tokens have various, partially crossed set of parameters and possible actions.

Token issue

To create (issue) a token user sends a transaction with following fields: from, to, amount, data, where field from contains users wallet address, togenesis wallet address (publisher of the zero block), amount — system parameter of token creation cost plus general transaction fee, data — encoded token parameters.

Token creation transaction can be combined from user interface forms like web or mobile app interfaces.

Token maximum supply

Token total supply, referred as MAX_SUPPLY_LIMIT, is limited to 2^64.

Token common parameters

Common parameters (all parameters are obligatory) for both token types:

  • ticker,
  • name,
  • initial emission — token supply,
  • fee type — flat or percent,
  • fee value — token transfer transaction fees,
  • minimal fee — only if fee type is percent,
  • decimals — number of decimals token uses,
  • reissuable — possibility of additional emission.

Common actions for both token types:

  • issue,
  • transfer.

Ticker

Ticker is a 1-6 ASCII characters string. Ticker is unique among all tokens tickers. Ticker appears in the blockchain only in a token creation transaction and used only as human readable id of a token. Ticker cannot be changed and stays constant during the blockchain system lifetime.

Name

Name is a string of up to 40 Unicode characters. Name is used as a token name or as a source of additional information: URL of a logo or a web site. Name can be changed by the token creator by specific transactions. Name is used only as a human readable token information and is stored in the blockchain only in token creation and name change transactions.

Fee type, fee value, minimal fee

Sender pays a fee (commission) to the token creator (issuer) for token transfer transactions. Creator defines fee’s properties within defined limits.

There are two types of fees: fixed (flat) and percentage (percent). With flat fee type every single transaction is charged a fixed amount for token transfer. With percent fee type every transaction is charged a fixed percent of the transferring tokens, but not less than amount defined in minimal fee parameter.

Additional information about fees is given below.

Supply

Supply is a number of tokens to be added to the token creators wallet with the token creation. Minimum value is 0, maximum value is MAX_SUPPLY_LIMIT.

Decimals

Decimals is a position of decimal point when displaying token amount. Minimum value is 0, maximum is 10.

Token transfers and fees

User that owns tokens may send any part of the available tokens to any other wallet. Capability of token transfers is a part of blockchain protocol supported by transaction format design — a transaction has a token field that contains id of a token. The main system coin has a reserved predefined id.

During transaction {from, to, amount, token} handling the following steps are performed:

  1. The value of owner is read from the blockchain history — the amount of coins the token owner has. At the current state ownership transfer is impossible so the owner is the creator of a token.
  2. Transfer commission token_fee is calculated based on amount and token's parameters. Note: zero fee is also possible.
  3. Correctness of amount >= token_fee is checked. Note: inequality is non-strict. Transaction is rejected if the check fails.
  4. Correctness of owner >= native_fee is checked. Transaction is rejected if the check fails.
  5. Balance of account from is decreased by amount tokens.
  6. Balance of account to is increased by (amount - token_fee) tokens.
  7. Balance of account owner is increased by token_fee tokens.
  8. Balance of account owner is decreased by native_fee — system's main coin fee.
  9. native_fee coins are added to the current block txs_fee, which is distributed among miners according to ETP4.

Non-mineable tokens

Non-mineable tokens specific parameters:

  • reissuable — possibility of additional emission.

Non-mineable tokens specific actions:

  • mint — create certain amount of tokens (only if token is reissuable),
  • burn — dispose certain amount of tokens (only if token is reissuable),
  • finalize — make token non-reissuable.

Reissuable

Reissuable is a binary value that shows if the token creator is capable of emitting additional tokens after the token is created.

Mint

Mint is an operation of creating additional tokens. Parameters are:

  • amount

Specified amount is added to token issuer's account. Operation will fail if token total supply exceeds MAX_SUPPLY.

Burn

Burn is an operation of disposing tokens. Parameters are:

  • amount

Specified amount is substracted from token issuer's account. Operation will fail if token issuer account value is less than specified amount.

Finalize

Finalize makes token non-reissuable. This action has no parameters.

Mineable tokens

Mineable tokens have specific parameters:

  • max_supply — initial emission plus total amount of tokens to be emitted during mining,
  • block_reward — reward for mining a block,
  • stake — minimal amount of tokens required to perform mining.

Max supply

max_supply is the initial token emission plus total amount of tokens to be emitted during mining. It is an integer >= supply and <= MAX_SUPPLY_LIMIT.

Block reward

block_reward is a token amount, which is distributed among PoA-miners per each macroblock. It is a non-negative integer less than MAX_SUPPLY_LIMIT.

Stake

Stake is a minimal amount of tokens required for PoA-mining. It is a positive integer.

Mineable token affects PoA-mining process. In the header of a microblock PoA miner states what token (or a native coin) will be given as a reward for that microblock. It is possible to get a list of all mineable tokens in the system at a time. Reward distribution rules are the same as for the native coin.

According to ETP-4, token supply will grow with each macroblock containing valid microblocks with a specified token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant