Block forgers refer to nodes (ie miners) in the BFChain network that are responsible for collecting event information and packaging it into blocks. In addition to the characteristics of ordinary nodes, block forgers are also responsible for the following affairs:
In the BFChain network, there are 57 block forgers in each round. BFChain block forgers are selected based on comprehensive calculations based on the number of votes obtained by the trustee and the online rate and other parameters.
In the process, the generation of block forgers mainly consists of three parts:
This chapter mainly introduces the first and third parts. The voting for the second part will be described in the Consensus Voting Mechanism chapter, which will not be described in detail in this chapter.
In order to improve the efficiency of consensus, in the BFChain blockchain ecology, as long as the address account holds the main chain equity, it can apply to become a trustee. All address accounts can vote for trustees who have opened to receive votes, and the system will elect 57 trustees from them according to certain algorithm rules. These 57 trustees, the block forgers, will be responsible for forging the 57 blocks for the next round.
In the BFChain ecosystem, there are mainly the following two types of trustees:
Rules on the chain:
[^Note]: The PC side currently supports one node that can bind multiple trustees at the same time. The BFChain mobile APP only supports one node and can only apply for one trustee.
BFChain biological chain forest provides the following event interfaces to register the address account bound by the node as a trustee:
For the detailed usage of this interface, please refer to the relevant documentation of the developer community.
After the address account has successfully applied to become a trustee, it is also necessary to configure whether to participate in the forger election (that is, to receive votes), and the default is to refuse to vote. Participating in the forger election means that other nodes on the chain may vote for this trustee, and then they may be selected as a block forger.
It should be noted that if the trustee is lucky enough to be selected as the block forger, the node is not ready when the block is forged (such as the block height is not synchronized, the node network is unstable, the node is being upgraded, etc.), and As a result, the block cannot be forged, which will affect the trustee's subsequent elections and greatly reduce the probability of subsequent selection. In order to reduce the drop rate of trustees, it is recommended that when the node is not ready, first refuse to participate in the forger election (that is, refuse to vote) until the node is ready, and then start receiving votes.
BFChain biological chain forest provides the following event interfaces for node configuration whether to participate in the forger election:
The default is to refuse to vote
For the detailed usage of the above two interfaces, please refer to the relevant documentation of the developer community.
Voting means that all address accounts on the chain that hold the equity of the main chain can vote for trustees in various supported Dapps (such as BFChain APP) or node programs. The more node votes the trustee gets, the greater the probability of becoming a forger.
BFChain biological chain forest provides the following event interfaces for nodes to vote:
Please refer to the [Consensus Voting Mechanism] (/knowledge/02) chapter for detailed voting rules, which will not be repeated here.
By participating in voting (automatic voting and manual voting), the nodes on the chain cast their votes to the trustees participating in the election. The bottom layer will count all the trustees who have been voted in this round at the end of this round. These trustees who have been voted and recommended will enter the candidate area, and the system will finally select 57 block forgers from the candidate area according to the underlying election rules (see "Becoming a Forger" section below). .
Only the trustee who enters the candidate area (hereinafter referred to as the candidate) may be selected as the forger of the next round of blocks;
The system will select 57 candidates from the candidates based on the established consensus at the bottom layer as the next round of block forgers.
The underlying rules mainly depend on the following two parameters:
If two candidates have the same number of votes, then compare the online rate: the one with the highest online rate will be selected first
|Candidates||Number of forged blocks||Number of dropped calls||Online rate||Number of votes|
In the above form, the probability of each candidate being selected in descending order is: C> A> B> D
The initial forgers of BFChain (that is, the block forgers in the first round) are elected from 114 creation trustees in accordance with the consensus of the underlying campaign (as above). Each subsequent round of block forgers will be elected through the election process described above.