Dynamic Random Election Algorithm (DRE)#

Due to the openness of public blockchains, any organization or individual can participate in the network maintenance of the blockchain from anywhere. This inevitably leads to a large number of nodes and miners participating in the network. However, due to the limitations of the BFT algorithm, it cannot accommodate a large number of nodes to participate in the consensus process, so we need a way to elect a limited number of miners. The dynamic random election algorithm DRE was born to solve this problem.

Basic Concepts#

1. Drop Point#

The drop point is used to select 11 Validators for ordinary block consensus. It is a spatial coordinate (x,y,z) generated by the random factors of the random seed of the Validator list, the random seed of the Staker list and the SNFT nominator address list, such as the red circle shown in the DRE process diagram.

2. Online Weight#

Online weight represents the ratio of a validator’s online time, with a maximum value of 70 and a minimum value of 1. Each time a miner participates in the consensus for ordinary or black hole blocks and fails to produce a block, the online weight will be reduced by 20. If a miner successfully produces a block, their online weight will be restored to 70.

DRE Process#

When a new block is generated, the node first obtains the hash of the current height and then uses the perimeter chain algorithm to calculate a drop point, which is isomorphic to the account address. Then, all miner lists for the current height are obtained and sorted by address, and the 11 addresses closest to the drop point are selected as the Validators for the next block consensus. The distance between a miner and the drop point is affected by the pledging amount and online weight, which can greatly reduce the probability of selecting offline nodes.

In the spatial coordinate diagram below, the blue box contains the selected 11 Validators, and the size of each circle represents their weight, which is calculated as PledgedBalance (miner’s pledged amount) * OnlineWeight.