Consensus mechanism

AuxPoW + DPoS Consensus

Elastos employs a hybrid consensus mechanism of AuxPoW+DPoS for its main blockchain where each block is packaged by miners and then signed by DPoS supernodes, thereby creating a finality to blocks which prevents the blockchain from forking. Beneath the simplicity of Elastos’ hybrid consensus mechanism lies a highly sophisticated multi-stakeholder solution which provides maximum security and optimal network decentralization.

The miners who package blocks are actually bitcoin miners who merge-mine both BTC and ELA simultaneously. This means that Elastos is able to borrow massive hashpower from the Bitcoin network to secure its own. It is also noteworthy that the supernodes on Elastos are not like supernodes from other blockchain projects. On most blockchain platforms that employ DPoS consensus, the supernodes both package blocks and sign them. On Elastos however, the job of a supernode is to sign and verify the blocks. Consequently, DPoS supernodes can collectively choose to reject malicious blocks packaged by merged-miners and also provide the final stamp of validation for solved blocks – called “finality.”

Finality of Blocks

The main issue with PoW consensus – apart from being computationally intensive – is that there is a high probability of a fork when the miner community is divided. For example, Bitcoin forked into Bitcoin and Bitcoin Cash. More recently, Bitcoin Cash forked further into Bitcoin ABC and Bitcoin SV. This happens whenever the community is divided and cannot reach a consensus on what features and upgrades to implement or eliminate on the blockchain. When there is enough support on both sides, the miners split up, causing the blockchain to split into multiple blockchains. In order to prevent such a catastrophic event, Elastos employs a hybrid consensus mechanism where the miner community must always follow the voice of the majority of the community members, as decided by democratic vote. The miners who do not follow these rules are deemed invalid, in which case the DPoS supernodes will not sign these particular blocks. By splitting up the power of packaging blocks and signing blocks into two different processes, Elastos creates an ingenious method to ensure finality in each block. In doing so, Elastos prevents any sort of fork occuring in its blockchain. Of course, no consensus mechanism is perfectly secure, but the hybrid consensus mechanism employed by Elastos certainly adds an additional layer of security, further strengthening the network.

In addition, there are 12 CRC (Cyber Republic Consensus) supernodes that are active at all times and are always included in the 36 active supernodes that take part in the consensus mechanism. Thus, only 24 of the 36 active supernodes are elected by the community at any one time. Because the DPoS consensus for the Elastos blockchain requires ⅔ of the active nodes’ signatures, a block must be signed by at least 25 supernodes. This creates yet another layer of security for the hybrid consensus that Elastos employs. Not only do the PoW nodes have to be compromised, but the DPoS supernodes as well. As it is already astronomically costly and difficult to amass over 50% of the Bitcoin hashpower, it will be just as hard to amass over 50% of the Elastos hashpower. Furthermore, adding the DPoS layer to the mix means that even if the PoW nodes are somehow compromised, it will be the DPoS supernodes who have the final say in which blocks to sign and which to ignore. Thus, the DPoS supernodes can collectively ignore the malicious blocks that were sent to the blockchain P2P network. Also, if we hypothetically assume the worst – that all merged-miners and all of the 24 supernodes are compromised – the best a malicious actor can do is halt the production and signage of blocks. In this circumstance, the malicious entity will be limited because it will not be able to acquire the necessary 25 signatures to validate faulty blocks. The 12 CRC supernodes, which are controlled by private keys held by the 12 Cyber Republic council members, will always act honestly and will never accept any malicious blocks, as it is in their best interest to do so. After all, each council member must deposit 5,000 ELA to be considered for the Cyber Republic election and each can be voted out by the community at any time if he or she does not act in the best interest of the collective community voice.

How to make changes to the blockchain infrastructure

The DPoS consensus for the Elastos blockchain works differently than a typical DPoS consensus mechanism, with the community playing a major role in the consensus process. The PoW mining is conducted via merged-mining, a process which utilizes Bitcoin mining machines to package transactions into a block. Then, the supernodes take action by signing each block. The community can submit different proposals to Cyber Republic and may include changes to the present consensus mechanism for new sidechains or propose the creation of a new sidechain dedicated to a specific application. The proposal may also include an architectural change to be implemented on the main chain code. Should the proposal be accepted by the Cyber Republic Council, the supernodes upgrade to account for said change. Soon after, if any of the PoW miners fail to upgrade their clients accordingly, the blocks packaged by the miners will not be accepted by the supernodes. In this way, the majority of the power is given to the Cyber Republic community rather than the miners themselves, which prevents forks from occuring in the first place.

How does a block get added to the blockchain?

  1. Bitcoin miners use special machines to mine Bitcoin. They also mine ELA through auxiliary mining techniques via a process called merged-mining. Each block is protected by PoW consensus and each block is then broadcasted to the P2P network.
  2. Arbitrator nodes receive each PoW mined block. If the arbitrator is on duty (only one of the 36 arbitrators is on duty), it sends a proposal for each block to the rest of the 35 arbitrators, where each signs the block using its private keys. The arbitrator network is another P2P network that connects all 36 arbitrators. Each arbitrator checks transactions and then signs each block. Every block that is signed by each arbitrator is also broadcast to all arbitrators in the arbitrator network in order for it to be verified and confirmed.
  3. Each arbitrator also broadcasts each signed block to all the nodes in the PoW miner P2P network. When the PoW miner node sees that the block has ⅔ signatures from arbitrators, it puts the signed blocks into the blockchain and starts packaging the next set of transactions into a new block. The reason that each arbitrator broadcasts its signed block to the PoW P2P network is because it is more efficient and prevents some issues that might occur if only the on-duty arbitrator were to broadcast the block.

How do arbitrators work?

  1. Every arbitrator must run several nodes: one node for the ELA main chain, one for DID sidechain, one for Token sidechain, one for NEO sidechain, one for Ethereum sidechain, and so on. In doing so, the arbitrator configures itself to connect to the various nodes and thus enables itself to generate blocks for each sidechain. This does not mean that all of the sidechain nodes necessarily have to be running in one machine. Each sidechain node and even main chain nodes can run on different machines while the arbitrator process connects to these various nodes running on different machines through proper configuration. Even the actual data can be stored on different machines. By way of this mechanism, cloud services like AWS, Azure, and Google Cloud, may very well be utilized to run each sidechain node on separate machines while also using cloud storage solutions for actual blockchain data storage so as to reduce the burden of running all processes on one machine.
  2. Only the on-duty arbitrator packages and signs the blocks for each sidechain. This goes for all the sidechain blocks (both PoW and DPoS sidechains). In case of a PoW sidechain, the on-duty arbitrator packages and signs blocks and sends them to the main chain for merged-mining PoW. Once confirmed, the blocks are added to their respective sidechain. In case of a DPoS sidechain, the on-duty arbitrator packages each block and sends a block proposal to be signed by all the other arbitrators. As soon the block gets ⅔ votes(25 signatures), the DPoS sidechain block is confirmed and added to the blockchain. Every other arbitrator can verify whether the blocks packaged and signed by the on-duty arbitrator are valid. If invalid or malicious blocks are signed, that supernode will receive a punishment and will have some or all of its ELA taken and may be voted out of the supernode consensus completely, depending on the severity of the circumstance.
  3. If there are 3 arbitrators, they must be connected to each other. At any given moment, there are always two connections from each arbitrator. Therefore, if there are 36 arbitrators, there are always 35 connections from each arbitrator. On the arbitrator network, everyone is connected to each other because there are only 36 nodes – meaning the overhead is not significant. In the PoW network however, not every node is connected to every other node, as it is infeasible to do so given the thousands to hundreds of thousands of nodes in the network.
  4. How do normal nodes know which arbitrator is on-duty? There is a sequence of on-duty arbitrators that advances every 72 minutes. This is determined by the public keys of each arbitrator. Every proposal is proposed by a different on-duty arbitrator because arbitrators rotate after each block. Each round consists of 36 blocks, each of which lasts roughly 72 minutes. Therefore, the arbitrator that will be on-duty is determined beforehand. An election occurs every 72 minutes and determines the order of the on-duty arbitrators. There is a list of arbitrators and their respective votes that is cached in every PoW node which is accessible to anyone. From this resource, it is quite easy to check which arbitrator is going to be on-duty at any point in time.
  5. Every arbitrator can vote or withdraw its vote at anytime. At the beginning of the nth round, the votes will be collected for n+1, n+2 round so the sequence of on-duty arbitrators is known by nodes beforehand.