Block Forge Campaign

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:

  • Collect events in the network;
  • Verify the event and pack the event into a block;
  • Broadcast the block to other nodes, and add the block to your local blockchain after passing the verification.

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.

Campaign flowchart

In the process, the generation of block forgers mainly consists of three parts:

  • Nodes participate in the election
    • Become a trustee
    • Turn on receiving votes and block forging
  • The address account that holds the equity vote on the trustee
  • Become a forger
    • Enter the candidate area
    • Successful election, become a forger

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.

Become a Trustee

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:

  1. Ordinary trustee: an ordinary address account becomes a trustee through application
  2. Creation trustee: the address trustee bound to the genesis block, currently there are 114 creation trustees

Rules on the chain:

  • Registering as a trustee is an event that requires payment of a certain chain fee, so only accounts holding main chain equity can apply to become a trustee;
  • By default, up to 10 "registered trustee" events are confirmed in each round; if there are more than 10 "registered trustee" events in this round, the events after the 10 confirmed events will be confirmed Enter the queue and wait until the next round of block forging begins; it may not be confirmed;
  • Only when you become a trustee can you enter the candidate area, so that you have the opportunity to be selected and become a forger;
  • Support one node to bind multiple trustees at the same time.

[^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:

  • Create registered trustee events
    • The full name of the interface: [trDelegate](/en/API_reference/PC_full_node/Interface_list/1-3#_6-Create registered delegate event)

For the detailed usage of this interface, please refer to the relevant documentation of the developer community.

Receive/reject vote

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:

  • Create an event to receive voting
    • The full name of the interface: [trAcceptVote](/en/API_reference/PC_full_node/Interface_list/1-3#_7-Create receiving voting event)
  • Create rejection event
    • The full name of the interface: [trRejectVote](/en/API_reference/PC_full_node/Interface_list/1-3#_8-Create a rejection vote event)

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.

Address account to vote for trustee

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:

  • Nodes automatically vote
  • Create manual voting events (transactions)
    • The full name of the interface: [trVote](/en/API_reference/PC_full_node/Interface_list/1-3#_9-Create a voting event)

Please refer to the [Consensus Voting Mechanism] (/knowledge/02) chapter for detailed voting rules, which will not be repeated here.

Enter the candidate area

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). .

How to improve the probability of entering the candidate area

  1. Increase online rate
  2. Increase the number of forged blocks
  3. Increase the number of packaged transactions
  4. Increase the voting rate
  5. Re-register as a new trustee

Become a forger

Campaign consensus

  1. 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;

  2. 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.

  3. The underlying rules mainly depend on the following two parameters:

    1. Number of votes obtained: the number of votes obtained by candidates in this round of voting;
    2. Online rate: online rate = number of forged blocks/(number of forged blocks + number of dropped calls); once a node has been dropped once, the online rate will not return to 100%, but with the forging The number of blocks continues to increase, and its online rate can be infinitely close to 100%.
  4. Judgment method:

    1. Compare the number of votes first: compare the number of votes first: the higher the number of votes, the more you can be selected;
    2. 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
    A 70 30 70% 100
    B 90 10 90% 99
    C 85 15 85% 100
    D 100 0 100% 50

    In the above form, the probability of each candidate being selected in descending order is: C> A> B> D

How to improve online rate

  1. Reduce the number of dropped calls: When the node is in the following states, try to avoid being selected for forging blocks: the synchronization is not completed, the node is during the upgrade period, and the node itself is not yet ready. If it is found that the node is in the above several states, you can trigger the "Rejection of Voting" event to have the trustee close to receive votes. After the "Refusal to vote" event takes effect, the node-bound trustee will no longer be voted, and the probability of being selected will be greatly reduced.
  2. Increase the number of forged blocks: Nodes should participate in block forging as much as possible to obtain more forged blocks. Once the number of blocks forged by the node is much greater than the number of dropped calls, its online rate will remain at a high level, even close to 100% infinitely.

BFChain initial forge

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.