Concept

Consensus

The consensus mechanism of XT Smart Chain is based on the HPoA consensus mechanism.
HPoS is a proof-of-stake-based consensus mechanism, which is a hybrid of DPoS and PoA.
PoS can effectively defend against 51% attacks but is not decentralized enough. HPoS involves token holders voting and electing a set of validators, increasing decentralization and benefiting community governance.

XSC adopts HPOS consensus mechanism of low transaction cost, low transaction delay, and high transaction concurrency, and supports up to 21 active validators. The administrator can designate any address to become a common validator, and the 21 validators with the largest number of pledges the node is an active validator, responsible for the packaging of the block producing node. After each epoch, the pledge amount ranks among the top 21 validators, and it will become the active validator for the next epoch.

All active validators are sorted according to predefined rules and packed into blocks in turn. If a validator fails to pack blocks in time in its own round, n/2 (n is active) The number of validators) Active validators who have not participated in the block will randomly perform block generation. At least n/2+1 active validators are working normally to ensure the normal operation of the blockchain.

The difficulty value of the block is 2 when it is generated normally, and 1 when it is not generated in a predetermined order. When the blockchain forks, the blockchain selects the corresponding fork based on the cumulative maximum difficulty.

Working Mechanism of HPOS

Blocks are generated by a limited set of validators.
Validators take turns generating blocks in a PoS manner, similar to Ethereum's Clique consensus engine.
The set of validators is selected based on stake-based governance on the XT Smart Chain, with a certain probability and randomness.
Changes to the validator set are relayed through a cross-chain communication mechanism.
The Parlia consensus engine interacts with a set of system contracts to enable slashing, revenue distribution, and validator set updates.
Based on the fundamental principles of blockchain design, if this consensus mechanism is not followed, non-compliant nodes will be forked out, while compliant nodes can always verify whether the consensus mechanism is being followed. This is the foundation of blockchain security and decentralization.

Description

Validator

There is no limit in theory, anyone can become a validator, which can be set by the administrator (validatorV1Admin).

Active validator

Currently the validator set responsible for packaging blocks, up to 21.

epoch

The time interval in blocks. The current 1epoch = 200block. At the end of each period, the blockchain interacts with the system contract to update the active validator.

Previous

Introduction

Next

Reward & Punishment