Sitemap
Godechain

Godechain

POSA

4 min readMar 31, 2023

--

POSA: Combination algorithm of DPOS and POA

For a long time, proof-of-work (PoW) has been seen as a practical solution for decentralized networks, but it is not friendly to the entire public chain environment because a large number of participants are required to maintain network security during the proof-of-work operation, resulting in an increasing cost of contributors as the number of participants increases.

In addition, the POS consensus algorithm was once considered one of the most desirable algorithms in the history of public chain development, but controversy still exists. ​Compared to the POW algorithm, the POS algorithm is not fully decentralized..Similarly, in DPOS algorithms proposed by EOS and other ecosystems, there are problems such as excessive power, corruption, and vulnerability to attacks..Based on the above history and experience, the GodeChain team tried to combine DPOS and POA to achieve a new consensus algorithm (POSA). The specific scheme employed was as follows:

l Blocks are created from a limited number of validations.

l Verifiers take turns generating blocks in POSA fashion, similar to Ethereum’s Clique consensus engine.

l The verifier set is screened and eliminated by on-chain governance rules based on equity pledge. Of course, GodeChain also supports on-chain pledge, a mechanism that allows users to delegate GODE to a specific validator and share the validator’s reward based on the total pledge amount.

Roles and verifications in the POSA algorithm

Role: Node that generates new blocks and validates existing blocks.

The verifier: is the node server that runs the verifier node software and operates in special verification mode. It allows the node to connect to the starting node and generate a new block..Once the validator generates the block, it uses the bootstrap node to propagate it across the network to other validators. Other validators must validate and set this block. To prove the correctness of the block, the user must verify 2/3*N+1 block.

To become a verifier, the user must meet the following requirements:

Get Godechain’s stories in your inbox

Join Medium for free to get updates from this writer.

Has its own, fully synchronized node, running in fully synchronized mode, using the unlocked verifier private key ( — unlock=param) :

1. Register its validator address in the pledge system contract through the register Validator(address validatorAddress, uint16 commissionRate) function. When registering, the user must specify the verifier’s address and commission rate.

2. Ask one of the existing verifier owners to propose that the user become a verifier.

3. Wait for 2/3 of the verifiers to endorse the candidate.

Penalty: GodeChain’s availability depends on each verifier in the PoSA Consensus verifier set being able to generate blocks in time when it’s their turn to block. The validator may miss a block for a number of reasons, especially due to hardware, software, configuration, or network issues. This unstable operation will impair network performance and bring more uncertainty to the system.

GodeChain has an internal contract to keep track of the blocks each validator misses. Once the metric exceeds a predefined threshold, the verifier’s block reward will not be distributed, but shared with other, better verifiers. In this way, poorly performing validators will gradually drop out because their principals will receive little or no incentive. If the figure is still higher than another higher threshold level, the verifier will be punished by forfeiting part of the mortgaged assets of the verifier in the pledge system.

1. If the verifier misses the block due to the misdemeanor threshold time, such verifier will lose the entire era of awards. The default value of the misdemeanor-Threshold is 50.

2. If the verifier misses a block within the felonyThreshold, such verifier will be imprisoned and no reward will be generated for the verifier’s JailEpochLength period (usually approximately 1 week). The default value of felonyThreshold is 150. Incarcerated verifiers will lose all rewards for 1 week or 25% of their monthly rewards. Once validatorJailEpochLength has ended a jailed verifier and they have been released from prison, they can start generating new blocks. The release from prison is a very important mechanism that allows us to avoid the problem of simply not producing new blocks or corrupting validators with poor performance..Essentially, this is just the verifier owner confirming that the verifier is back up and ready to go. To be released from jail, the owner of the verifier must call the function releaseValidatorFromJail(addressvalidatorAddress) and be able to continue producing blocks at the start of the next epoch.

Pledge of rights and interests and on-chain governance

PoSA implements decentralized community governance. Cosmos and EOS are examples of its application, and the core logic can be summarized as follows: token holders, including verifiers, can “lock” their tokens into equity pledges. Token holders can entrust their tokens to any verifier or a verifier candidate. They can then select a different validator or candidate to delegate their token.

All verifier candidates will be ranked according to the number of entrusted tokens they have received, with the top candidate becoming the true verifier. Verifiers can share block revenues with their principals. Verifiers may suffer penalties, i.e., penalties for their bad behavior, such as double signature and/or instability. Such losses are also shared with their clients. The verifier and the client have an “unbinding period”. When a malicious Byzantine action is detected, the token remains locked for a certain amount of time and the wrongdoer is detected and punished.

--

--