Nexty Yellowpaper

Thursday, July 12, 2018
Download document
Save for later
Add to list is a project of OpenBook

NEXTY: A CONSENSUS TO GET ZERO TRANSFER FEE AND INSTANT TRANSFER BLOCKCHAIN THANH DAO & HA DANG CO-FOUNDER/CTO @ NEXTY PLATFORM [email protected] / [email protected] Abstract. This is the detail technical paper of Nexty Platform, focusing on describing the operation of a consensus protocol called Proof of Foundation. Proof of Foundation was inspired by the Proof of Authority introduced by Szilágyi [2017] with improvement from Nexty Platform by introducing a new confirmation system named DCCS - Dual Cryptocurrency Confirmation System to achieve a absolutely decentralized system and bring a highly incentive system for blockchain maintainers. 1. Introduction 2. How to authorize an account to become a block sealer In addition to NTY coin-base, DCCS has the secondary token named NTF. NTF is The system will set up a configuration pa- used for authorizing an account to be- rameter to determine the minimum value, come the maintainer/sealer of the con- min − ntf , that an account need to have firmation system described detail in sec- to become block sealer. Nexty will build tion 2, as well as to calculate reward for and develop a smart contract, which allow block sealer. NTF token has total sup- NTF token holder, having enough token, ply of 10, 000, 000 and will be distributed to grant another account called “executing- for the first 100, 000, 000, 000 NTY holders account” to become the block sealer by set- that joined in “Smart Staking” program de- ting “authorized-sealer” state in the smart scribed detail in the white paper of Nexty contract with the value equal to address of [2017]. In the other words, NTF will be NTF holder. If an address already has an rewarded to the pioneers having a clear vi- “authorized-sealer” value, it can not receive sion and a strong believe in Nexty Platform authorization from another NTF holder un- in the future. That’s the reason why we til the NTF holder has made the with- call the new consensus protocol as “Proof drawal it from “authorized-sealer”. The of Foundation”. The power of Nexty Plat- “authorized-sealer” list will be determined form, however, is not belong to NTF hold- at the check point block of each sealing ers because they could be voted down by round by reading state from the smart con- Nexty community if community found that tract at that point of time. If in the current NTF holders did any bad behavior of cheat- sealing round, any “authorized-sealer” does ing, malicious or hand-shaking to make the not perform at least one sealing activity, the network become centralize chain as well as “authorized-sealer” value will be withdrawn using out-of-date source code. As a result, to its NTF holder by updating the state of NTF holders have the only role as block the smart contract at the checkpoint block sealer for Nexty blockchain and governed by number of the next sealing round and of NTY community via decentralize voting sys- course that “authorized-sealer” will not be tem on a smart contract. involved in the next sealing rounds until it will be authorized to become “authorized- sealer” again. 1

NEXTY: A CONSENSUS TO GET ZERO TRANSFER FEE AND INSTANT TRANSFER BLOCKCHAIN 2 3. Block sealing mechanism block: is the first block number, a.k.a checkpoint block number, of the cur- The DCCS block sealing mechanism will rent sealing round. be implemented as in following steps. Π: total number of authorized sealer Firstly, the sealers will be numbered from reading from smart contract state at 1 to n (called “sealing-id”) randomly at the the checkpoint block of the current beginning of each sealing round; in which, sealing round. n is the number of registered “authorized- sealer” and is determined by the state of the If the remainder σk equal to “sealing-id” smart contract at the checkpoint block num- of the node, then that node has the right to ber of the corresponding sealing round. To seal block immediately. Otherwise, at each ensure the randomness of “sealing-id”, the of the next block, sealing nodes have to wait numbering is calculated by a hash, ξk , as a course of time, ψk , which is calculated by following formula when starting a new seal- the formula: ing round. (1) ξk ≡ KEC(block, Λk ) (3) α = 001.387978000 (4) β = 000.002313279 block: is the first block number, a.k.a (5) γ = 000.004626590 checkpoint block number of the seal- ing round. (6) δ = 199.999400000 Λk : is the address that the NTF holder has set as “authorized-sealer” in the smart contract. KEC: is the SHA-3 Keccak-512 hash ∑ ζk α function of any input. (7) ψk ≡ floor( + δ) i=1 β∗i+γ After that, the “sealing-id” of each authorized-sealer will be taken by the po- sition of sealing hash, ξk , in the array 3.2. Scenario 2. If sealing node is in recent (ξ1 , ξ2 , ..., ξn ), ascending ordered by the seal- sealers ing hash. In this scenario, sealers still can continue To ensure performance of the system, the to seal block, but they have to wait a period “sealing-id” of the all authorized sealers will of time longer than all other sealers, not in be snapshot only once from the smart con- recent sealers. This is procedure to ensure tract state at the checkpoint block number that the system can still generate blocks, of each sealing round and stored in the lo- even when there is only one sealer, but the cal database as well as in lru cache of each chain be suspended for a very long time. The node. waiting time ranges from 3 - 30 minutes, if there are 1, 000 - 10, 000 authorized sealers 3.1. Scenario 1. If sealing node is not in and only one or few active sealers. recent sealers. The node will determine Waiting time, ψk , is caculated by the fol- whether it’s the in-turn sealer for the next lowing formula: block or not, according to the following for- mula: (8) α = 001.387978000 (2) σk ≡ (ν − block) mod Π (9) β = 000.002313279 ν: is the current block number that is (10) γ = 000.004626590 being sealed. (11) δ = 199.999400000

NEXTY: A CONSENSUS TO GET ZERO TRANSFER FEE AND INSTANT TRANSFER BLOCKCHAIN 3 out if the generating time of “authorized- sealer”’s block is smaller than it’s waiting ∑ n α time. (12) ψk ≡ floor( + δ) i=1 β∗i+γ 4. Block sealer reward calculation ∑ ζk α + floor( + δ) After each sealing round, reward value ℜ β∗i+γ i=1 of each sealer will be calculated as the min- imum value of the total reward divided by The coefficients of the above formula are the active sealers according to the propor- assumed as following. The sealing node tion of NTF they have on the total NTF of having “sealing-id” equal to σk , calculated the sealers who participated in the seal. by formula (2), will have the priority to seal block before 400ms, the next sealing Ω node will have the priority to seal block (13) θ= before 350ms, then 320ms,... till the final N sealing node with approximately to 200ms. ΥN T F (14) φ= Its graph corresponds to the function y = ΞN T F a (b∗x+c) +d To estimate values for the parameters, we (15) ℜ ≡ min(θ, φ) use curve fitting method to find relatives coefficient in the website My Curve Fit with Ω: total reward the variance 1 ≈ 1. N: total number of active sealer of the current sealing round ΥN T F : amount of NTF token that the owner of active sealer is holding ΞN T F : total amount of NTF token that all active sealer are holding According to formula (15), people who own NTF in a natural way will divide his/her NTF into many wallets in order to equip multiple sealers, instead of building only A sealing round of all authorized sealer is one sealer and spend too much NTF on it. called an epoch. Epoch will have various This ensures the Nexty chain will have suffi- length, depends on the number of sealers in ciently large number of nodes to make Nexty a chain of each sealing round. chain become highly decentralization, stabil- A sealer who is worried about being ity and robust. withdrawn authorized sealer to NTF holder Total reward Ω is the amount of NTF was might not participate in sealing activity in a produced after each sealing round, calcu- sealing round, but still occupies the right to lated as [reward generated in one block] * seal block at some point earlier than his/her [number of blocks generated in that sealing sealing turn; causes welter and racing for round]. sealing block. By calculating the fixed wait- The number of rewards generated for a ing time for each sealer, using formula (7) block is equal to the number of rewards per or (12), consensus are able to keep track of year divided by 15, 768, 000, the expected sealer. Nexty blockchain will verify a block, number of block within one year (initial con- sealed by an “authorized-sealer”, by figuring figuration of block time is 2 seconds). 1R² is 1 minus the ratio of sum of the squares of the residuals divided by the sum of the squares of the differences between Y fit and the mean Y value

NEXTY: A CONSENSUS TO GET ZERO TRANSFER FEE AND INSTANT TRANSFER BLOCKCHAIN 4 The amount of rewards in a year is calcu- ability to save transactions of the it’s own lated in the following proportions: account and contiguous accounts in Merkle Year % of circulating supply Tree and block headers. The responsibility 1 10 of a light client is to verify all transactional 2 5 information related to it, as well as vali- 3 2 date the blocks generated afterward. There 4 1 should be a comparison if the blockchain is 5 1 interfered with more than 15 blocks back- ... ... wards, then notify to the owner of the wal- ... ... let that the system might be manipulated. ... ... In some case, community must be accessed n 1 to see if any errors occurred, and vote down on the “authorized-sealers” that caused the 5. Anti-SPAM malicious data. Under this rule, a spam ac- Since Nexty’s transaction fee is zero, if tion that spends more than 56.7 times the there is no proper anti-spam protection, it amount of resources on the chain to confirm can easily be attacked by sending multiple such a transaction. This results in a loss in transactions simultaneously, causing system resources for spammers and therefore, ruins blockage. their intention of spamming. We have the following anti-spam methods: Users still have the option of creating a The general rule is that the system will charged transaction in case they do not want charge the first transaction with a fee of 0.2 to maintain block verifier. per account, which will be added to the re- For dApp, it can provide its own system ward value of the sealing round. From sub- of nodes to withstand the user’s gas and sequent transactions, the system will not then there may or may not be a charge on charge transaction fees, but requires those the user’s gas depending on the development accounts to run a continuous wallet appli- needs of the dApp. cation with the number of blocks equal to References [0.0015 * gas-used], after that, they will be able to send next transactions. Nexty. Nexty platform white paper, Dec. Mobile wallet app is a light client ver- 2017. sion, as known as a block verifier (based on Péter Szilágyi. Clique poa protocol and light client protocol standard) which has the rinkeby poa testnet, Mar. 2017.