Skip to content

Commit

Permalink
Merge pull request #1 from binance-chain/token_proposal
Browse files Browse the repository at this point in the history
Add BEP1&2 proposals
  • Loading branch information
darren-liu authored Apr 12, 2019
2 parents 011fce1 + 223ecf3 commit 5468ef3
Show file tree
Hide file tree
Showing 3 changed files with 271 additions and 1 deletion.
58 changes: 58 additions & 0 deletions BEP1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# BEP 1: Purpose and Guidelines


- [BEP 1: Purpose and Guidelines](#bep-1--purpose-and-guidelines)
* [1. What is BEP?](#1--what-is-bep-)
* [2. BEP Rationale](#2--bep-rationale)
* [3. BEP Types](#3--bep-types)
* [4. BEP Workflow](#4--bep-workflow)
* [5. Reference](#5--reference)
* [6. License](#6--license)


## 1. What is BEP?

BEP stands for Binance Chain Evolution Proposal. Each BEP will be a proposal document providing information to the Binance Chain/DEX community. The BEP should provide a concise technical specification of the feature or improvement and the rationale behind it. Each BEP proposer is responsible for building consensus within the community and documenting dissenting opinions. Each BEP has a unique index number.

## 2. BEP Rationale

BEP is the primary mechanism for proposing new features, for collecting community technical input on an issue, and for documenting the design decisions that go into Binance Chain. Because the BEP are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.

For Binance Chain contributors, BEPs are a convenient way to track the progress of their implementation. This will give end users a convenient way to know the current status of a given feature, function or improvement.

## 3. BEP Types

There are three types of BEP:

- Feature Request: A Feature Request BEP describes functional changes on Binance Chain or/and Binance DEX, such as a change to the network protocol, proposer selection mechanism in consensus algorithm, change in block size or fee mechanism in application level.
- Improvement: Improvements are advice gathered from the community.
- Standard: This kind of proposal will change the workflow of Binance Chain working process, like this BEP itself.

## 4. BEP Workflow

![img](https://lh3.googleusercontent.com/auaU1Ur5SZZKVcwQrFrHN-3T1vUP8C1wCjFWqJzzJpcdVCHR4JXe1Mzm7hCFuoEqVjkUOZIF5WrwK47jGw8r3wp9RLEPvAWY6DOsncNz0yCeVc84qew1Xf7ouk1qrcNdXpjGSNQG)

*Figure 1: BEP workflow*

Each status change is requested by the BEP author and reviewed by the BEP editors. Use a pull request to update the status.

- Work in progress (WIP) -- A community member will write a draft BEP as a pull request.
- Draft -- An editor will add notes and some requests, then if all changes are made, it will go to the next stage. If it’s not approved, it will be dropped.
- Final -- This BEP is ready to be implemented
- Implementation -- the development team could start work on this BEP

Other exceptional statuses include:

- Deferred -- This is for some BEPs that depend on changes of a future BEP implementation. The current BEP will stay in the *Deferred* state and wait for the hardfork.
- Dropped -- A BEP that is dropped and will not be implemented. Usually, it is due to some prerequisite conditions that are not true anymore.
- Superseded -- A BEP which was previously final but is no longer considered applicable. This happens when an on-going implementation conflicts with a newly created BEP in *Final* state. The latter needs to refer to the incompatibility BEP and elaborate backward incompatibilities issue.

## 5. Reference

Ethereum Improvement Proposals: [https://github.com/ethereum/EIPs](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1.md)

Bitcoin Improvement Proposals: <https://github.com/bitcoin/bips>

## 6. License

All the content are licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
212 changes: 212 additions & 0 deletions BEP2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# BEP-2: Tokens on Binance Chain


- [BEP-2: Tokens on Binance Chain](#bep-2--tokens-on-binance-chain)
* [1. Summary](#1--summary)
* [2. Abstract](#2--abstract)
* [3. Motivation](#3--motivation)
* [4. Specification](#4--specification)
+ [4.1 Native Token on Binance Chain: BNB](#41--native-token-on-binance-chain--bnb)
+ [4.2 Token Properties](#42-token-properties)
+ [4.3 Token Management Operation](#43-token-management-operation)
- [4.3.1 Issue token](#431--issue-token)
- [4.3.2 Transfer Tokens](#432--transfer-tokens)
- [4.3.3 Freeze Tokens](#433--freeze-tokens)
- [4.3.4 Unfreeze Tokens](#434--unfreeze-tokens)
- [4.3.5 Mint Tokens](#435-mint-tokens)
- [4.3.6 Burn Tokens](#436-burn-tokens)
* [5. License](#5-license)




## 1. Summary

This BEP describes a proposal for token management on the Binance Chain.

## 2. Abstract

BEP-2 Proposal describes a common set of rules for token management within the Binance Chain ecosystem. It introduces the following details of a token on Binance Chain:

- What information makes a token on Binance Chain
- What actions can be performed on a token on Binance Chain

## 3. Status

This BEP is under implementation.

## 4. Motivation

Design and issue asset on the Binance Chain, as the basic economic foundations of the blockchain.

## 5. Specification

### 5.1 Native Token on Binance Chain: BNB

The Binance Token, BNB, is the native asset on Binance Chain and created within Genesis Block. As the native asset, BNB would be used for fees (gas) and staking on Binance Chain. BNB was an ERC20 token, but after Binance Chain is live, all BNB ERC20 tokens are swapped for BNB token on Binance Chain. All users who hold BNB ERC20 tokens can deposit them to Binance.com, and upon withdrawal, the new Binance Chain native tokens will be sent to their new addresses.

### 5.2 Token Properties

- Source Address: Source Address is the owner of the issued token.

- Token Name: Token Name represents the long name of the token - e.g. "MyToken".

- Symbol: Symbol is the identifier of the newly issued token.

- Total Supply: Total supply will be the total number of issued tokens.

- Mintable: Mintable means whether this token can be minted in the future, which would increase the total supply of the token

### 5.3 Token Management Operation

#### 5.3.1 Issue token

Issuing token is to create a new token on Binance Chain. The new token represents ownership of something new, and can also peg to existing tokens from any other blockchains.

**Data Structure for Issue Operation**: A data structure is needed to represent the new token:

| **Field** | **Type** | **Description** |
| :------------ | :-------- | :------------------------------------------------------------ |
| Name | string | Name of the newly issued asset, limited to 32 unicode characters, e.g. "ABCcoin" |
| Symbol | string | The length of the string for representing this asset is between 3 and 8 alphanumeric characters and is case insensitive. ".B" suffixed symbol is also allowed for pegging to those tokens already exist on other chains. The symbol is suffixed with the first 3 bytes of the issue transaction hash to remove a constraint of requiring unique token names. The native token, BNB, does not require this suffix. |
| Total Supply | int64 | The total supply for this token can have a maximum of 8 digits of decimal and is boosted by 1e8 in order to store as int64. The amount before boosting should not exceed 90 billion. |
| Owner | Address | The initial issuer of this token, the BNB balance of issuer should be more than the fee for issuing tokens |
| Mintable | Boolean | Whether this token could be minted(increased) after the initial issuing |



The data in all the above fields are not changeable after the Issue Transaction, except “Total Supply” can be changed via “Mint” or “Burn” operations.

**Symbol Convention:**

[Symbol][.B]-[Suffix]

Explanations: Suffix is the first 3 bytes of the issue transaction’s hash. It helps to remove the constraint of requiring unique token names. If this token pegs to an existing blockchain, there should be an additional suffix of “.B”.

**Issue Process:**

- Issuer signed an issue transaction and make it broadcasted to one of Binance Chain nodes
- This Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Issue transaction is committed on the blockchain by block proposer
- Validators will verify the constraints on total supply and symbol and deduct the fee from issuer’s account
- New token’s symbol is generated based on the transaction hash. It is added to the issuer’s address and token info is saved on the Binance Chain

#### 5.3.2 Transfer Tokens

Transfer transaction is to send tokens from input addresses to output addresses.

**Message Structure for Transfer Operation**: A data structure is needed to represent the transfer operation between addresses.

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :---------------------------- |
| Input | []Input | A set of transaction inputs |
| Output | []Output | A set of transaction outputs |

**Input Data Structure:**

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Address | Address | Address for token holders |
| Coins | []Coin | A set of sorted coins, one per currency. The symbols of coins are in descending order. |

**Output Data Structure:**

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Address | Address | Address for token holders |
| Coins | []Coin | A set of sorted coins, one per currency. The denominations of coins are in descending order. |

**Coin Structure**

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Denom | string | The symbol of a token |
| Amount | int64 | The amount is positive and can have a maximum of 8 digits of decimal and is boosted by 1e8 in order to store as int64. |

**Transfer Process:**

- Transferer initiators sign a transfer transaction and make it broadcasted to one of Binance Chain nodes
- The Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Transfer transaction is committed on the blockchain by block proposer
- Validators will verify the constraints on balance. The transfer tokens and fee will be deducted from the address of the transaction initiators.
- Add the tokens to the destination addresses

#### 5.3.3 Freeze Tokens

A Binance Chain user could freeze some amount of tokens in his own address. The freeze transaction will lock his fund, thus this portion of tokens could not be used for the transactions, such as: creating orders, transferring to another account, paying fees and etc.

**Data Structure** **for Freeze Operation**: A data structure is needed to represent the freeze operation

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Symbol | string | The symbol should belong to an existing token,e.g. NNB-B90 |
| Amount | int64 | Frozen amount for this token can have a maximum of 8 digits of decimal, and the value is boosted by 1e8 to store in an int64. This amount should be less than its balance |

**Freeze Process:**

- Address-holder signed a freeze transaction and make it broadcasted to one of Binance Chain nodes
- The Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Freeze transaction is committed on the blockchain by block proposer
- Validators will verify the transaction initiator’s balance is no less than the frozen amount. The fee will be deducted from the transaction initiator’s address.
- This amount of tokens in the address of the transaction initiator will be moved from balance to frozen.

#### 5.3.4 Unfreeze Tokens

Unfreezing is to unlock some of the frozen tokens in the user's account and make them liquid again.

**Data Structure** **for Unfreeze Operation**: A data structure is needed to represent the freeze/unfreeze operation

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Symbol | string | The symbol should belong to an existing token,e.g. NNB-B90 |
| Amount | int64 | The unfreeze amount can have a maximum of 8 digits of decimal, and the value is boosted by 1e8 to store in an int64. This amount should be no less than the frozen amount |

**Unfreeze Process:**

- Address-holder signed an unfreeze transaction and make it broadcasted to one of Binance Chain nodes
- The Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Unfreeze transaction is committed on the blockchain by block proposer
- Validators will verify the transaction initiator’s frozen balance is no less than the required amount. The fee will be deducted from the address of the transaction source.
- This amount of token will be moved from frozen to balance in the transaction initiator’s address.

#### 5.3.5 Mint Tokens

Mint transaction is to increase the total supply of a mintable token. The transaction initiator must be the token owner.

**Data Structure** **for Mint Operation**: A data structure is needed to represent the mint operation

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Symbol | string | The symbol should belong to an existing mintable token, e.g. NNB-B90 |
| Amount | int64 | Added supply for this token can have a maximum of 8 digits of decimal, and the value is boosted by 1e8 to store in an int64. The amount before boosting operation should be less than 90 billion after mint. |

**Mint Process:**

- Token owner signs a mint transaction and makes it broadcasted to one of Binance Chain nodes
- The Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Mint transaction is committed on the blockchain by block proposer
- Validators will verify the constraints on whether the token is mintable and whether the bumped total supply will pass the limit. Then increase its total supply and deduct the fee from the address of the token owner
- Newly minted tokens are added to the address of the token owner and token info is updated on the Binance Chain

#### 5.3.6 Burn Tokens

Burn transaction is to reduce the total supply of a token. The transaction initiator must be the token owner.

**Data Structure** **for Burn Operation**: A data structure is needed to represent the burn operation

| **Field** | **Type** | **Description** |
| :--------- | :-------- | :------------------------------------------------------------ |
| Symbol | string | The symbol should belong to an existing token,e.g. NNB-B90 |
| Amount | int64 | Burnt supply for this token can have a maximum of 8 digits of decimal, and the value is boosted by 1e8 to store in an int64. The amount should be no less than its total supply |

**Burn Process:**

- Token owner signs a burn transaction and makes it broadcasted to one of Binance Chain nodes
- The Binance Chain node will check this transaction. If there is no error, then this transaction will be broadcasted to other Binance Chain nodes
- Burn transaction is committed on the blockchain by block proposer
- Validators will verify the constraints if the token’s supply is no less than the required amount, and then it decreases the total supply and deducts the fee from the address of the token owner
- Burned tokens are deducted from the address of the token owner and token info is updated on the Binance Chain

## 6. License

The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BEPs

BEP stands for Binance Chain Evolution Proposal. Each BEP will be a proposal document providing information to the Binance Chain/DEX community, or describing a new feature for Binance/DEX or its improvements.
BEP stands for Binance Chain Evolution Proposal. Each BEP will be a proposal document providing information to the Binance Chain/DEX community.

0 comments on commit 5468ef3

Please sign in to comment.