Phoenix Chain (PEC) 2.0 - A More Decentralized and Robust PoS System
######################################
#
# No matter who you are, thank you Satoshi Nakamoto!
#
# We will try to update the thread from time to time.
#
# The documentation is lagging behind years of work.
#
######################################
Editor: Keith Alice
https://twitter.com/TheKeithAliceDiscussion:1. This thread
2. Telegram live chat group:
https://t.me/PhoenixChainPEC1. BackgroundPhase 0 of the Ethereum 2.0 update entails the shift from Proof of Work (PoW) to Proof of Stake (PoS), which will be a major factor in boosting Ethereum’s transaction throughput. However, No one knows if Ethereum 2.0 PoS will come as planned. On the other hand, the popularity of the smart contract is incredible, which makes us want to work out a more decentralized and fair public chain based on ETH with PoS consensus. By the previous work experience of PoS based on BTC code, we start the Phoenix Chain (PEC) 2.0 project.
2. Advantages of Phoenix Chain (PEC) 2.0 project2.1 We think the PEC team belongs to the top team in the area of public chain development. There are many projects on the market, most of which are PPT products. It is hard to complete the road maps developed by these projects. However, the PEC project has close to the perfect development team, and team members understand the essence of matters. We have already implemented some features of the PEC project on the test network.
2.2 PEC is based on the ETH technology architecture, which is fully compatible with the eco-system of ETH, including but not limited to wallet, EVM and smart contracts.
2.3 PEC has a completely decentralized PoS architecture without presetting the "honest" or "higher privilege" node. PEC is more environmentally friendly and energy-saving than the POW project;
2.4 PEC further optimizes the VRF, block proposal (lottery) of Algorand, thereby improving the security, fairness and block performance of PEC.
3. Problems that Algorand Doesn't Solve3.1 Assumptions about network synchronizationAlgorand uses strong synchronization network assumptions which require the upper limit of the network message propagation time to be known in advance. That is to complete the network message propagation to a fixed proportion of users within a fixed time. Under these assumptions, the implementation of consensus algorithms will be much easier. However, this is not true in a real fully decentralized network environment.
3.2 Assumptions about honest nodes//TODO
3.3 Convergence through the Byzantine agreement - low block efficiency//TODO
4. Algorand Cryptographic SortitionIn simple terms, the cryptographic sortition uses cryptographic methods to generate a random number generator, which is used to determine the proposer or verification committee member of the next block. Algorand uses "Verifiable Random Function (VRF)" to generate random numbers, which is an admirable innovation. PEC completely inherits this advantage of Algorand. As a function based on cryptography, VRF brings the advantages of fast consensus, anti-attack, and extremely low hash rates requirements.
4.1 PEC VRF VariantThe randomness in VRF is defined here as:
For an ideal hash function, its value range should be discrete and uniformly distributed. Given different input values, its output should be irregular, and randomly scattered and distributed in the range of the value range.
Each round of election will use a seed as the input of VRF, and then VRF will output a random hash and π. The random hash is the input value of the next VRF process and π is the proof of the user selected by cryptographic sortitiony. The seed here is the hash value, and the seed of the genesis block will be obtained through a distributed random number generator.
Before running cryptographic sortition, PEC will set the number of nodes participating in cryptographic sortition (τ) in advance. The seed of round r will be determined by the VRF of round r-1, and the seed and π of each round will be recorded in the block in round r. The seeds of each round are related and bound to the seeds of the previous round. VRF makes it impossible for malicious people to predict the output of VRF, making them unable to predict who will be the winner of the next round, thus improving the security of PEC.
At the same time, once the PEC reaches an agreement on the block in round r-1, the entire network will know the seed at the beginning of round r. If a malicious person participates in the block proposal process of the round r and packs some invalid transaction information, then most honest users will regard this block as an empty (invalid) block; the seed for the r round r(seedr= H(seedr-1 ||r )) will be determined by the encrypted hash function H (which can be assumed to be a random oracle).
PEC's cryptographic sortition makes the winners of each round have unpredictable randomness and has a cryptographic hash function H as an alternative random function scheme to ensure the security and fairness of the PEC system. Because there is only one block in each round that will be accepted by everyone, if it is found that this block is likely to be attacked or a malicious person makes a block proposal, the block will be rejected instead of verified. And the system will re-propose the block. This also reduces the possibility of PEC forking, and at the same time shortens the block confirmation time, making payment and other applications on the blockchain no longer out of reach.
5. PEC Block
5.1 PEC nodes can become validators through registration. Validators are nodes that have the right to block proposals;
5.2 Users can use the wallet to select the validator and stake their tokens. When the online validator’s staked tokens are greater than the threshold, the validator becomes the proposer, and the proposer has the qualification for cryptographic sortition;
5.3 In each round, all proposers form a committee, and all members of the committee generate VRF random numbers based on the consensus of the entire network;
5.4 All members of the committee use VRF random numbers to conduct cryptographic sortition based on the effective commission amount of the entire network and their own commission amount, and finally three lucky winners will be selected. The probability of a lucky winner's hit is always positively correlated with his staked amount (the weight of his own assets in the total assets);
5.5 The lucky winner has the qualification to produce the block. He uses his private key to sign the block and writes the VRF consensus data in the block. Each block has its own "difficulty". The difficulty is composed of the number of rounds hit by the cryptographic sortition, the last block generation interval of the validator node (under the same conditions, the longer the block generation interval has a higher lucky value), and a random number;
5.6 All nodes verify the VRF data of the block and check the cryptographic sortition and signatures to prevent dishonest nodes;
5.7 All nodes choose the best block according to the cumulative difficulty;
5.8 Repeat steps 5.1 - 5.8.
Because of network transmission, validator's own software and hardware failures, and assumptions about the existence of many dishonest validator nodes in the entire network, at a certain height, there may not be any new blocks generated.
PEC uses a multi-round cryptographic sortition mechanism to avoid this situation. Assuming that when there is no new block generated (for example, the proposer deliberately does not broadcast its own block), other proposer nodes will continue to repeat the cryptographic sortition process until a new block appears. The number of cryptographic sortition rounds will be used as part of the VRF random number to become the consensus data on the chain, and it is also an important component of the block difficulty.
Nodes with a smaller number of rounds have greater difficulty, that is, the priority of candidate blocks decreases as the number of rounds increases.