Skip to main content

7.3 Consensus

Consensus mechanisms (also known as consensus protocols or consensus algorithms) allow distributed systems (networks of computers) to work together and stay secure. For example, consider a group of people going to the cinema. If there is not a disagreement on a proposed choice of film, then a consensus is achieved.

That is how the consensus mechanism works, and in the blockchain system, it is responsible for all validation mechanisms to maintain the integrity and correctness of the data transferred inside the blockchain. Consensus is a hybrid between proof of stake, proof of existence, and proof of connectivity.

In any centralized system, like a database holding key information about driving licenses in a country, a central administrator has the authority to maintain and update the database. The task of making any updates—like adding/deleting/updating names of people who qualified for certain licenses—is performed by a central authority who remains the sole in-charge of maintaining genuine records.

Public blockchains that operate as decentralized, self-regulating systems work on a global scale without any single authority. They involve contributions from hundreds of thousands of participants who work on verification and authentication of transactions occurring on the blockchain.

In such a dynamically changing status of the blockchain, these publicly shared ledgers need an efficient, fair, real-time, functional, reliable, and secure mechanism to ensure that all the transactions occurring on the network are genuine and all participants agree on a consensus on the status of the ledger. This all-important task is performed by the consensus mechanism, which is a set of rules that decides on the legitimacy of contributions made by the various participants (i.e., nodes or transactors) of the blockchain.

This consensus is designed to reduce the risks of a hostile takeover of the network by injecting V.M. or devices and ensure there is no possibility of malicious interference. This eliminates the risk of damaging the network, and, in addition, any node that is identified as fraudulent will lose all tokens deposited during staking.

From the analysis executed on the consensus methods implemented in the functional blockchains available in the market, it was found that once they reach maturity, they cannot cope with the processes of scalability and sustainable and efficient development.

The classic Proof of Work (PoW) process implemented in BTC or ETH blockchains has proven to be inefficient in terms of validation time and power consumption. Already at the maturity stage, the size of these blockchains has reached an increased size and requires more and more efficient devices dedicated to validation tasks.

These things make the PoW consensus type dependent on the advancement of technology, and any delay affects the operation of the entire blockchain mechanism. Elements such as computing power, rewards, investments, benefits, or energy consumption are elements that ensure the functioning of the PoW consensus type and are interdependent. Thus any change of one parameter will affect other parameters and will generate changes in the mechanism.

The consensus layer that underlies the XIDEN blockchain is built on three different protocols that solve the identified issues from other types of blockchains. These three protocols redefine the concept of POW. Therefore, this consensus is an optimized PoW that meets the requirements of scalability and sustainable and efficient development. It is primarily low energy and eco-friendly as the validation nodes are devices that the user/owner utilize regularly for their daily activities. Thus, there is no requirement for specially built devices that consume a high amount of energy just to perform the mathematical operations required for blockchain operation.

In the consensus mechanism Mining Resistance protocol has been implemented. This protocol is developed to protect the network from attacks, increased difficulty, or hostile takeovers to entities or organizations that have the ability to build technologically advanced devices or own large amounts of XDEN.

The three protocols implemented into the XIDEN consensus layer (POS, POE, and POC) work independently but are interconnected. When the user wants to initialize a function, the blockchain mechanism accesses the consensus protocols to verify its validity and conformity. If an item is not validated by any protocol then the function will not be executed.

7.3.1 Proof of Stake (PoS)​

Proof of Stake is a cryptocurrency consensus mechanism for processing transactions and creating new blocks in a blockchain. A consensus mechanism is a method for validating entries into a distributed database and keeping the database secure. In the case of cryptocurrency, the database is called a blockchain — so the consensus mechanism secures the blockchain.

Proof of Stake reduces the amount of computational work needed to verify blocks and transactions that keep the blockchain, and thus a cryptocurrency, secure. Proof-of-stake changes the way blocks are verified using the machines of token owners. The owners offer their tokens as collateral for the chance to validate blocks. Token owners with staked tokens become "validators."

Validators are then selected randomly to "mine," or validate the block. This system randomizes who gets to "mine" rather than using a competition-based mechanism like proof-of-work.

Proof-of-stake is designed to reduce the scalability and environmental sustainability concerns surrounding the proof-of-work (PoW) protocol. Proof-of-work is a competitive approach to verifying transactions, which naturally encourages people to look for ways to gain an advantage, especially since the monetary value is involved.

Bitcoin miners earn Bitcoin by verifying transactions and blocks. However, they pay their operating expenses like electricity and rent with fiat currency. What's really happening then is that miners are exchanging energy for cryptocurrency. The amount of energy required to mine PoW cryptocurrency profoundly affects the market dynamics of pricing and profitability. There are also environmental aspects to consider since PoW mining uses as much energy as a small country.

The PoS mechanism seeks to solve these problems by effectively substituting staking for computational power, whereby an individual's mining ability is randomized by the network. This means there should be a drastic reduction in energy consumption since miners can no longer rely on massive farms of single-purpose hardware to gain an advantage.

Long touted as a threat for cryptocurrency fans, the 66% attack is a concern when PoS is used, but it is very unlikely. A 66% attack is when someone controls 66% of a cryptocurrency and uses that majority to alter the blockchain. In PoS, a group or individual would have to own 66% of the staked cryptocurrency.

It is not only very expensive to have 66% of the staked cryptocurrency—staked currency is collateral for the privilege to "mine"—the miner(s) that attempt to revert a block through a 66% attack would lose all of their staked tokens. This creates an incentive for miners to act in good faith for the benefit of the cryptocurrency and the network.

Most other security features of PoS are not advertised, as this might create an opportunity to circumvent security measures. However, most PoS systems have extra safety features in place that add to the inherent security behind blockchains and the PoS mechanisms.

The PoS protocol implemented in the XIDEN Blockchain Consensus Layer is specially developed so that there is no possibility of taking over the network to alter the integrity of data by an entity or organization.

XIDEN PoS consists of two validation layers that are mutually verified. The layer that validates the transactions and submits the blocks to be registered in the blockchain consists of 30 validation nodes called Realm MetaNodes (RMNodes). These RMNodes have several active roles in the consensus. The main validation nodes store for the stake the amount of XDEN deposited for staking by the Guardian Nodes and manage the infrastructure composed of these Guardian Nodes.

RMNodes must have at least 2,000,000 XDEN in stake to be active. The first 2,000,000 XDENs are automatically allocated from the Total XDEN Supply when the blockchain is deployed, will be stored forever in the RMNodes, and will be used for validation.

To perform validation, 66% of RMNodes must validate the transaction. This percentage is calculated so that the possibility of taking over a major part of validators with the purpose of altering data is as small as possible.

The 2nd validation layer in the PoS protocol is called Delegated Stake and consists of the entire Guardian Nodes network. These light validators check if the Realm MetaNodes changed their status or identity. This validation is performed at each epoch change. The assignment of validation jobs is performed randomly and it is not possible to choose who to validate. To confirm the integrity of an RMNode's identity, 66% of the active Guardian Nodes must successfully validate.

In order for a Guardian Node to be active in the network, it must deposit the amount of 1000 XDEN required for staking. This quantity is stored in the staking wallet of Realm MetaNode. The total amount of XDEN in the RMNode wallet only affects the rewards.

This does not mean that if one RMNODE holds a higher amount of XDEN than the other RMNodes, it can take control and alter the integrity of data.

7.3.1.1 Unstake​

The amount of XDEN submitted for stake can only be controlled by the user who initiated the stake function for that amount. The user can unstake at any time as long as the cooldown is not active.

In order to protect the XIDEN system from flooding, the Cooldown function has been implemented and gas fees are active. Any transaction between two wallets regardless of their purpose must ensure a gas fee amount for transaction validation.

The Cooldown function is activated when a stake or unstake process is executed. That is, the amount of money that executed one of the functions is blocked to perform the stake or unstake process for 50 Epochs.

7.3.1.2 Fault​

The amount of XDEN deposited for stake represents a guarantee from the owner who wants to become a validator. Any validator who attempts to defraud the system or alter the integrity of data will be punished by having their amount of XDEN deposited for stake confiscated. The confiscated XDEN amount is then distributed in the network to other validation nodes that have discovered the irregularities. Thus, the participation of validating nodes is encouraged for discovering and reporting irregularities, with a significant amount of XDEN as a reward.

The Realm MetaNodes and Guardian Nodes are independent entities even if the XDEN for stake is deposited in the RMNode wallet. If an RMNode is discovered as an entity that attempted to defraud, only the amount owned by it will be confiscated and redistributed within the network. If it does not have enough available XDEN for stake then the RMNode will become an inactive node and can no longer validate.

The initially assigned Guardian Nodes to the now inactive RMNode will be redistributed as validation tasks to other active RMNodes in order to maintain the system’s activity and integrity.

7.3.2 Proof of Existence (PoE)​

Proof of Existence is a consensus layer mechanism that integrates and verifies the identities of the validators within the system. This layer is designed to work together with the other consensus mechanisms - PoS and PoC - in order to replace the classic Proof of Work consensus and improve the PoS through increased security.

Within the XIDEN blockchain, there are entities and devices that have important roles in ensuring the integrity and functionality of the system. Realm MetaNodes, Guardians Nodes, and validators are physical devices with a software component that perform certain functions. In addition to the primary functions, each of these devices runs a function that checks the fingerprint of the other devices at each epoch change and votes in a decentralized way on the integrity of a new device in the system or its status change.

The implementation of this layer came after an analysis of a potential problem. Since validation is performed on the principle of majority voting, there is a possibility that an entity could integrate devices in the form of validators that perform the stake function in order to take control of the majority and thus the network. By implementing Proof of Existence, a device is accepted into the network by decentralized voting and thus no devices can be integrated to intentionally take over the network.

The Proof of Existence consensus layer is built independently of the PoS and PoC layers but works in an interconnected way so that a device cannot perform functions without meeting the other rules.

7.3.2.1 PoE functionality​

Each device has unique hardware and software identifiers that form a fingerprint. This fingerprint is encrypted and transformed into a Matrix ID via VOBP.

Initially, at the start of the blockchain, a number of devices are added to the BDX dynamic list in order to have validators that can check the status, integrity, and activity of the previously integrated devices. Basically, the initial devices that are integrated into BDX will check each other and will play a role of acceptance through a decentralized vote of future devices that will enter the system, also with the purpose of validation.

The initial devices integrated into the system are distributed in a decentralized way to the users of the network who want to become validators. Device validation jobs are randomly distributed so that a device is not validated deliberately, even if it does not meet the criteria.

BDX is a dynamic list that securely stores Matrix IDs of device fingerprints. This list is updated every epoch. This means that devices are verified and receive an accuracy and validity status for the next epoch.

Validation of an existing device in the system needs 10 confirmations from the other existing devices.

Integrating a new device into the system needs 66% votes from existing devices in BDX. Since it is a decentralized network based on the work of each validating device, we have also developed a reward system. Each validator is graded according to the difficulty and the reward mode preferred. Each validator receives XDEN for the work done in the XIDEN network.

7.3.2.2 Fault​

The PoE layer works in conjunction with the PoS layer. To become a validator, the device must be integrated into a pool that has a minimum of 1000 XDEN staked as a guarantee that it will perform a correct job.

If a validator is found to have attempted to duplicate the identity of another validator, or to have operated under a different identity, they are punished by removing the XDEN from staking and redistributing it in the network to other validators.

If a device launches attacks on other validators to try to influence their voting or affect their voting ability, then the XDEN from staking is seized and the same procedure of redistribution to the network is applied.

7.3.3 Proof of Connectivity (PoC)​

PoC is a layer consensus mechanism that verifies the status, validity, and availability of all the devices integrated into the Xiden blockchain, whether they are validators or devices that are part of the SDR layer.

The validation process in this layer is performed in a decentralized, autonomous, and automated manner without any human intervention. Xiden validators have the role of constantly communicating with the devices within the system so that we have a clear historical record and accurate availability of the devices and resources available in the network.

This layer has been implemented with the purpose of having real-time data about the availability of the integrated devices in a decentralized way.

7.3.3.1 PoC functionality​

Each device has a unique fingerprint that is transformed into a Matrix ID to confer security for its identity. Validators open secure VOBP sessions to securely communicate with devices registered in the BDX, but also with devices registered in the SDR layer.

These sessions transmit data sets that contain the Matrix ID, available resources, and the time when the device became online and the time when it became offline. All this data is stored in the form of blocks in a database with blockchain architecture. Both BDX and SDR are up-to-date data on all validation devices integrated into the Xiden network.

Validation of these device data is performed by several validators before being registered. This means that devices open multiple sessions with multiple devices to communicate in real-time.

This consensus layer helps the system to eliminate the possibility for a device to attempt to defraud it by compromising a validator.

To validate this data, PoC requires six confirmations from the available validators within the network.

Depending on the PoC consensus layer, the rewards are distributed for both BDX status and SDR status. Depending on the data accuracy transmitted as resources and on the time of connection to the network, the devices are rewarded with XDEN.

7.3.3.2 Fault​

To become a validator, the device must be integrated into a pool that has a minimum of 1000 XDEN staked as a guarantee that it will perform a correct job. If a validator is found to have attempted to transmit erroneous connection data, it will not receive rewards. A device that permanently transmits erroneous data will be banned from participating in the reward system to eliminate the possibility of flooding with invalid data.

If a validator is found to be manipulating device data, it will be punished by confiscating XDEN from the stake and the same procedure of redistribution to the network is applied.