CoinEx Institution | CSC Pool: A Mining Pool Assumption Based on the PoS Consensus
After the launch of CoinEx Smart Chain (CSC), a new consensus mechanism blazes a path to the Ethernet ecosystem. Unlike ETH, the EVM-based CSC adopts the proof-of-stake (PoS) consensus mechanism, which, simply put, is a mining model of electing validators through staking CET. However, by directly staking CET to a validator, one cannot get the rewards distributed on the CSC, a design different from other PoS systems. So how to earn staking rewards? This article hereby puts forward an assumption around the question.
Groundbreaking innovation on the CSC consensus layer
First of all, this assumption is based on CSC, so what exactly is CSC?
CSC is the abbreviation of “CoinEx Smart Chain”, which refers to the public chain of CoinEx. Different from its predecessor DEX chain that focuses on decentralized transactions and delivers ultra-high matching efficiency by fixing the matching engine to the consensus layer based on Cosmos, CSC is a smart chain that supports smart contracts and satisfies users’ needs for freewheeling application scenarios. Developed by CoinEx’s internal team based on the Ethereum Virtual Machine, it is perfectly compatible with the Ethereum ecosystem. It has achieved extremely high efficiency and low transaction fees, thanks to the optimization of the consensus layer. Compared with DEX, CSC supports a larger number of application scenarios and versatile functions, thus leaving more room for imagination.
CSC is developed based on the Ethereum Virtual Machine. The biggest difference between CSC and Ethereum lies in the consensus mechanism. Ethereum is still built on the proof-of-work (PoW) consensus mechanism, while CSC adopts the unique CPoS consensus mechanism that combines proof-of-authority (PoA) and PoS.
Different consensus mechanisms working on varying mining principles
Mining is a fairly abstract concept. In a nutshell, it is a process where each node continuously performs the hash computation to obtain a hash value with the first few digits as “0”. The first node that calculates such a value and broadcasts a block will become the block proposer, to obtain all the resulting rewards. For example, a Bitcoin block is generated every ten minutes. The node that digs a Bitcoin block can get rewards worth about RMB 1.5 million. In Ethereum, it only takes seven seconds to generate rewards of RMB 30,000, thanks to the PoW-based mining model.
The disadvantage of the PoW mining mechanism is that it consumes enormous amounts of energy, extremely bad for the environment. According to the above-explained reward model, every node vies to be the first puzzle solver. Only by doing so, can they get considerable rewards. Therefore, mines rush to buy a large number of high-end graphics cards to boost their hashrates. For miners, graphics cards mean productivity. The endless hashrate competition finally results in that standalone mining no longer works. So there emerge mines, a collection of numerous mining machines. The resulting calculation process needs to consume even more electricity, which is quite detrimental to the environment.
Compared with the power-hungry, hashrate-vying PoW model, the PoS mining mechanism on which CSC is built looks much more eco-friendly. In the PoS consensus mechanism, the probability of block generation is determined not by the node hashrate but by the number of tokens staked to the node. Generally speaking, the more staked tokens, the higher the probability of block generation and the more rewards obtained. To put it simply, graphics cards are used for mining in the PoW model, while tokens serve the purpose in the PoS model (like CET in CSC).
CPoS consensus mechanism: staking not equal to rewards
The CPoS consensus mechanism used by CSC is different from the ordinary PoS in the following ways.
The first difference is about validators. Nodes exist on all blockchains. They can be seen as blockchain projects that run on the server. Containing the full copy of a blockchain, nodes are directly connected through the P2P network to share transactions and block data. Anyone can run a node. Validators are special nodes to verify and package transactions. They are sometimes called “block proposers”. Generally, blockchains adopting the PoW consensus mechanism such as Bitcoin and Ethereum do not have a limit on the number of validators. However, those built on the PoS consensus mechanism are the other way around. For instance, CSC supports up to 101 validators. That is to say, only the top 101 nodes by the staked amount can become validators, to participate in block generation and obtaining block rewards. Furthermore, CSC also set a lower limit of staking amount at 10,000 CET for a validator. In other words, nodes below such a level are not eligible to become validators.
The person who stakes CET to a validator is called the staker. Anyone can become a staker. It should be noted that block rewards are entirely obtained from the addresses set by validators and that ordinary stakers will not receive any block rewards on the CSC, a design different from its predecessor DEX chain.
CSC adopts a distinctive mining reward model. Block rewards mainly consist of the fixed CET rewards for one block and the sum of transaction fees on all transactions on the block. This is different from the previous DEX chain: the larger the staked amount of a validator, the higher the probability of block generation. With the number of validators fixed at 101 and every 200 blocks as an election cycle, the sequence of block generation within these 200 blocks is fixed. Therefore, the yields of each block are not monopolized by the validator that generates the block. Instead, rewards are distributed among all validators in proportion to their staked amounts. To reduce the system load, validator yields are allocated once every 200 blocks.
Coexistence of two models: “limited company” and “listed company”
Based on the CPoS consensus mechanism, an assumption about the CSC mining pool is hereby proposed to meet the needs of the numerous CET holders for participating in CSC mining. The assumption is detailed below.
Assuming A has a validator, B and C hold CET, and all of the three want to engage in CSC mining. They may agree on a contribution ratio beforehand (A contributing 100,000 CET, B 1 million, and C 10 million, for instance); then they sign a contract, just like starting a company; and split the rewards with server costs deducted at the agreed-upon contribution ratio. This is known as the “limited company” model.
Although it seems straightforward at first sight, this model faces many problems that are difficult to overcome. For example, it lacks flexibility. After a contract is signed, any material change to it like the joining of a new member of the early exit of an existing member will require calculating the yields in advance and entering a new contract all over again. Moreover, whether a member has staked tokens in the contractual amount has to be manually verified. Most troubling, however, is that manual calculation is needed every time rewards are withdrawn and dividends are distributed, which proves to be a quite time-consuming and labor-intensive operation.
To address the above problems, a simpler model called “the listed company” is put forth.
The aforesaid assumption of three persons — A, B, and C — is continued, with some adjustments. Instead of signing a contract with A, B, and C this time stake CET to A’s validator directly. In the meantime, A develops a program to monitor changes in the number of tokens staked to its node. The program can also automatically calculate the yields payable to each staker and pay dividends to all stakers regularly. In this way, anyone can get involved in and withdraw from mining operations at their discretion, without reaching an agreement with a validator beforehand. That is free mining in a real sense.
The first step to achieve the above goal is to have a program that can automatically maintain the staking ratio. The specific process turns to be quite simple. First, A needs to monitor all staking and de-staking operations under the validator contract, and screen out those carried out on its own validator. Then, the program will dynamically modify A’s staking data according to specific operations, so that A can have access to the real-time staking data.
The availability of the real-time node staking data makes it possible to automatically calculate yields attributable to each staker, which amounts to the second step. CSC distributes rewards every 200 blocks. Given this, the program can retrieve the latest staking data every time block rewards are distributed, and then generate the snapshot of yields payable to each staker at the ratio of its staked amount. In this way, the yield calculation precision is narrowed down to 200 blocks or about 10 minutes, which is quite flexible and precise. The last step is to add a timed task: automatically distributing yields every week. The program will make statistics of yield snapshots generated in the past week, calculate the specific amount of rewards attributable to each staker in the week, and make payments to them automatically.
As you can see, this simple program can update staking data, generate staker yield snapshots, and distribute block rewards automatically.