In the previous article：*A randomized scheme for Validator Election in the PoS Consensus (1)*, we explained the problems of the validator selection and some of the existing solutions, and then this article will focus on the design objectives and implementation of PlatON.

PlatON adopts the PPoS consensus mechanism to produce and sign blocks with a set of validators, providing guaranteed operation that is secure and efficient. The operation of the entire network is highly decentralized, and every stake-owner in the network can become a member of it, participating in the maintenance of the entire network and earn rewards from it. A node can stake a certain amount of LAT to meet the threshold to run for a validator (LAT represents staking). The probability of a node becoming a validator is proportional to the staking it has, and the holders of LAT can delegate their LAT to a node for voting. Thus, if a malicious node commits evil, then a portion of its staked LAT will be forfeited, making the attack more costly and resistant to Sybil Attacks (multiple identities attacks) and Nothing At Stake Problems.

The key is to make sure that the selection of validators is related to the node staking and ensures randomness, making the selection result unpredictable, non-manipulable, fair, and reliable. We divide it into two parts, “random number generation and validator selection”.

# Random number generation

A random number used to implement a random selection of validators needs to possess the following properties:

Unpredictability: unable to infer subsequent results from past sequences

Collision-Resistance: different inputs generate different results

Certainty: the results generated from a given input are identical

Randomness: the data sequence is haphazard

Verifiability: the legitimacy of results can be verified

PlatON generates random numbers based on VRF (Verifiable Random Function) since it is unpredictable, collision-resistant, and verifiable, here’s how:

The VRF_hash and VRF_prove function output a hash value and proof by inputting SK (private key) and alpha (seed). The proof is used to verify the correctness of the Hash value of the random number, and the validators can check the legitimacy of the random number by using the public key, the seed, and the proof.

The random number generated based on VRF has these basic properties:

High efficiency: no network communication and fast local generation

Uniqueness: the output is fixed for fixed secret keys and inputs

Collision-Resistance: it is computationally infeasible to obtain the same output from different inputs

In the operation of PlatON, the producer of each block will generate a random number while producing the block, and the random number is generated with the node private key and the random number of the previous block. Honest nodes will complete the production sequentially, and malicious nodes will not be able to manipulate the output of the results. If they conceal the results and do not publish them, malicious nodes will be severely punished.

# Selection of block producer

With the above steps, a reliable random number is generated, and if it is directly used to select the validator from the nodes, no additional LAT is needed for the nodes to stake, and this will contribute to:

Security: on the one hand, too many LATs in circulation will introduce attack and stability risks, and on the other hand, a node can increase the probability of being selected as a validator by splitting the LAT owned by itself and staking them into multiple nodes.

Fairness: each node will stake the same amount of LAT because staking more LAT will not bring any change to the node.

Therefore, the probability of being selected should be proportional to the amount of LAT, and splitting the LAT cannot give you a higher probability of being selected.

According to the cumulative distribution function properties, the probability distribution of a real random variable X can be completely described.

PlatON uses the binomial distribution cumulative distribution function B(n,p) for random pick, with n representing the total staking of the nodes, and p representing the expected probability.

Each node is randomly selected by this probability mechanism, which is transparent, reversible and, non-manipulable. At this point, the selection of the validator by the probability distribution function is completed.

# Summary

In the mechanism, the random numbers are generated locally and efficiently by VRF without interaction. Then, the selection is conducted securely and fairly with the binomial distribution. Next, each validator completes consensus efficiently within the group through the Giskard algorithm to better balance scalability, security, and decentralization.

PlatON is always designed to enhance the degree of decentralization, security, and scalability, striving to reach optimal status on the impossible triangle.

Publisher：PlatONWorld，Please indicate the source for forwarding：https://platonworld.org/?p=3437