Please note this is not a technical document, but mainly describes quota and quota-related topics. Technical details will be introduced in the yellow paper.
The Definitions of Terms:
- Quota： In Vite system, transactions consume quota for exchanging computing and storage resources.
： Proof of Work, used to prove a certain amount of computation has been performed.
- Stake： A quantity of
in the account is frozen and cannot be spent, usually for quota in return.
- Staking address：The account who starts the staking transaction.
- Quota recipient address：The account who receives quota.
What is quota
In Ethereum, transactions have to compete with each other by specifying attractive gas price as transaction fee. The higher gas price the bigger chance the transaction has to be processed by the miner. This is a typical bidding model. In principle, the gap between supply and demand can be effectively balanced by price. However, because it is difficult for users to determine the current supply and demand before bidding, in addition to the impossibility of predicting other competitors, market failure could be caused often. Moreover, since all the competing bids are simply applied to transactions, no effective solution is implemented to allocate TPS resources among accounts. In Vite, a certain amount of quota is consumed when the user initiates a transaction, such as transfer, deploying smart contract, invoking smart contract method, issuing new token, registering SBP, retrieving mining rewards, voting or staking. Vite has designed a quota model to balance between resource supply and demand.
Users are able to acquire quota in two ways:
- Compute a
when doing a transaction, or
- Stake a amount of
in the account.
If the user only needs to send a transaction, he may calculate a
We recommend users to obtain quota by staking.
Quota usage rules
Different transactions consume different amount of quota. In Vite TestNet, the quota required for various transaction types are as follows:
|Transaction type||Quota consumed|
|Send a transaction without comment||21000|
|Receive a transaction||21000|
|Update SBP registration||62200|
|Revoke SBP registration||83200|
|Retrieve mining rewards||238800|
|Stake for quota||21000|
|Issue new token||104525|
|Mint additional token||69325|
|Transfer token ownership||58981|
|Change token type||63125|
In addition, comment consumes additional quota - 4 quota for zero character and 68 quota for each non-zero character.
For example, given hex encoding is used, to send a transfer transaction with the comment of 0x0001 (having two characters in total while the first is zero and the second is non-zero). The consumed quota is:
Quotas are calculated by the following formula:
: The current available quota of the account; : The quota cap of a single account, related to total system throughput and total number of accounts; : The difficulty computed by the account when sending a transaction; : The weight of the quota obtained by computing ; : The amount of staked by the account; : The waiting time before sending a transaction, equivalent to height different between the snapshot block that current transaction refers to and an older snapshot block that previous transaction refers to. : The weight of the quota obtained by staking.
In TestNet some are constants,
= 1000000 = 6.259419649e-10 = 4.200627522e-24
For the convenience in actual calculation, only
|The maximum number of uncommented transactions can be sent in a snapshot||Approximately equivalent to how much ||Approximately equivalent to how much |
For example, without calculating
Two ways of obtaining quota
Users can obtain quota by sending a stake transaction to built-in contract. When the transaction is received and confirmed, the specified quota recipient account will be granted with the corresponding quota.
- Staking amount: The minimum staking amount is 1000
- Quota recipient address: The account who receives quota, could be the staking account itself or any other account since staking for other accounts is permitted.
The user can obtain an one-time quota by computing a
In the TestNet, we have built a
to in following formula: : difficulty, 256-bit number, padding zeros at front when less than 256 bits; : target, 256-bit number, usually the first bit is 1.
For example, if