$18991,29
-0,71%
$1321,3
+0,07%
$0,0604
-0,39%
$0,0286
-1,52%
$0,0195
+2,85%
Published by: 23:49, 27 May 2019

DPOS: Consensus in Aergo MainNet

Detailed description of the consensus DPOS - delegated prove of share (Delegated Proof of Stake) implemented in the blockchain core Aergo.

Consensus DPOS Aergo

Translation of Articles - DPOS: Consensus on the Aergo Mainnet, which Sun written Wu - Developer AT Blocko and Aergo

Introduction

Each blockchain protocol uses a consistent algorithm to support one and only one list of cryptographically related blocks - blockchas. The most famous in the world of blockchas is a consensus dynamo implemented in Bitcoin based on Proof of Work (POW). It allows you to achieve complete decentralization, allowing finality only by the probabilistic method. In this case, several branches can compete with each other and gradually turn into one. Another extreme in the spectrum is the consensions that originated from the traditional Byzantine Agreement (BA). They guarantee the instantaneous end of the block, but limit the degree of decentralization.

Consensus of delegated confirmation of the share (DPOS) ¹, which is used in the main network of Aergo, is in the middle between the aforementioned two consensus. He delegates the exclusive right to generate blocks for a number of selected block manufacturers (BP), at the same time allowing reorganization in a limited range. (A) Following the PROF OF OF STAKE (POS) and (b) models, maintaining only a limited amount of BP, it solves both the productivity problem and the problem of excessive power, detected in POW-based consensus.

This article provides a detailed description of the DPOS, implemented in the Aergo blockchain core. In the remaining part of the article "DPOS" means DPOS implemented in the Aergo block nucleus, unless otherwise defined.

Delegated Property Property in Aergo

Production blocks

DPOS allowed to generate blocks only by limited quantity² of nodes called active block manufacturers (BP). They are chosen by voting among stakeholders. Time is evenly divided into slots, and for each slot must be created maximum block. Active BP are distributed over these slots by counting votes and in turns produce blocks.

For simplicity, let's consider an example of four active BP, which are respectively A , B , C and D in descending order of votes. Block interval is 1 second. If everything is in order, the blockchain works as shown in Figure 1.

DPOS CONSENSUS ON THE AERGO MAINNE
Picture 1. Production of blocks at normal operation; The letter in each square is the manufacturer unit

Each BP generates a block every four seconds. However, when the first unit is not received on time, the next BP must generate it. For example, suppose that A Created a block "1" and then B fell before producing block "2" in this case, FROM must generate a block "2", and not B . Figure 2 shows how the blockchain looks like in case of such a failure.

Figure 2. Production of blocks with failure b
Figure 2. Block production with failure b

There are no blocks corresponding to the slots "1" and "5", since b gives a failure, so blocks are distributed unevenly in time; The time interval between blocks "1" and "2" is about twice as long (2 (2 C) than usual (1 s).

Fork (branching)

On the other hand, DPOS allows branching and reorganization as in Bitcoin. Let's assume that Disabled from other BP due to a network failure. Even in this case b and others ( A , , ) Do not stop the production of blocks. They control their own blocks accordingly, as shown in Figure 3.

Consensus Fig. 3. network branching; B and (a, c, d) are disabled from each other
Figure 3. Network branching; B and (a, c, d) are disabled from each other

Please note that the slots "1" and "5" of the main chain (top) are empty, because blocks created by B , not accepted ( A , C , D ) due to network separation.

Lower chain managed B, is a side chain, because it is shorter than another; While the height of the main chain becomes 7, the height of the side chain is still only 3. Thus, according to the rule of the longest chain, as soon as the network problem is solved, and the blocks of the main chain are sent to B , B it becomes known that his chain is shorter than another. Finally, she begins to follow the main chain (reorganization).

Finished: the last irreversible block

If the block is connected to the block chain, it can be viewed as a block and its parent blocks driven by. Based on this idea, a concept called the last irreversible block (LIB) was introduced into DPOS. As soon as the block becomes lib, any reorganization that goes beyond its limits is prohibited. Accordingly, the completeness of the LIB and the blocks preceding it is guaranteed. Under normal conditions, LIB is constantly updated to a higher value, with the exception of the initial reboot period.

Speaking by technical language, LIB is determined in two stages:

  1. When most (⅔ +) BP attach the blocks to the chain, the first of them becomes the proposed LIB.
  2. The LIB proposed finally becomes LIB when complemented by blocks from another majority of BP.

Initially, the range of voting [or confirmation] on the block did not have restrictions. In other words, the block connected to the chain was considered a vote for the Block itself and all the superior blocks. However, later it will be changed to avoid conflicting libs³. In the modified version, a block generated by BP X, Confirms only a number of block predecessors produced by BP X last time.

Figure 4. Determination of the last irreversible block in the case of 4 BP
Figure 4. Determination of the last irreversible block in the case of 4 BP

A simple example is shown in Figure 4. This is the case with a DPOS 4-BP network, most votes in it amounts to 3. In this case, the voices of 3 BP are needed to achieve consensus, respectively, on each of the stages of the LIB definition. Therefore, as shown in Figure 3, block "one"It becomes the proposed LIB when connecting the block"3"To chains (1 phase). After that block "one"Finally goes to lib when the block is added to it."five"(second phase). Under normal conditions, as soon as the block is completed as a LIB, the height of LIB is increased by 1 when the new block is connected; One new block accompanies new lib.

Rates, vote and election

Active BP are selected by Aergo users who put their tokens (Aergo) ⁴. The interested party can vote freely for several candidates (a maximum of 30 candidates), although voting is limited to 1 voice per day. Voting result is collected every 100 blocks. Rating affects the change of regime after 100 blocks. This election scheme is illustrated in Figure 5. Here BP block "700" Selected in accordance with the rating collected on block "600" (and not "700"). It is designed to reduce the likelihood of unreasonably frequent change of regime as a result of reorganization, since the reorganization of past blocks is less likely than recently.

Figure 5. Election Scheme BP
Figure 5. Election scheme BP

Summary

On a simple example, consisting of 4 BP, we explained how DPOS works. Its main advantages are:

  • generating a block with a limited number of favorite BP; and
  • The ability to reorganize only within the limited range of blocks.

The first provides fast and stable block production, while the second guarantees the absolute finality of the blocks until most of the active BP are in normal operation. Thanks to them, DPOS can achieve high performance at a moderate degree of completion of transactions. Such a balance between performance and finality is one of the most important factors defining our choice of DPOS for consensus on the Aergo network.

**********

  1. DPOS was first represented as a consensus algorithm for BITSHARES (https: // BITSHARES.ORG / technology / delegated-proof-of-stake-consensus /). The current implementation of Aergo is similar to the implementation of the EOS (https: // GitHub.COM / EOSIO / Documentation / Blob / Master / TechnicalWhitepaper.MD # Consensus-Algorithm-BFT-DPOS).
  2. Currently, Aergo network operates with 13 active BP at the incubation stage (HTTPS: // Medium.COM / AERGO / AERGO-MAINNET-INCUBATION-8F097344D14E).
  3. "To correct the loss of the DPOS consensus due to the contradictory of the recent irreversible block" (https: // GitHub.COM / EOSIO / EOS / ISSUES / 2718).
  4. The rate and voting are carried out by submitting applications for participation in the auction.
Ctrl
Enter
Noticed a mistakeS
Highlight the text and press Ctrl+Enter
Discuss (0)
Related links:
Other column materials:
Eth
Cryptocurrencies
Eth
05 April 2021
0
BTC
Cryptocurrencies
BTC
05 April 2021
0
BNB
Cryptocurrencies
BNB
04 April 2021
0
XRP
Cryptocurrencies
XRP
03 April 2021
0
IOTX
Cryptocurrencies
02 December 2020
1
Binance
Exchanges
14 April 2021
0
Bitfinex
Exchanges
11 April 2021
0
USDT
Cryptocurrencies
02 April 2021
0
Этот сайт использует cookie для хранения данных. Продолжая использовать сайт, Вы даете свое согласие на работу с этими файлами.