CodeChain Consensus Algorithms

Kwang Yul Seo
CodeChain
Published in
3 min readOct 16, 2018

What is the best consensus algorithm? PoW (Proof of Work), PoS (Proof of Stake) or PoA (Proof of Authority)? There is no right answer here. It is hard to say a specific consensus algorithm is the best because each algorithm has its merits and demerits regarding performance, security, and decentralization.

When you set up a blockchain network by yourself, you need to choose a consensus algorithm that meets your network requirements. If you want a consensus algorithm that provides high TPS (Transaction Per Second) and fast block confirmation speed, a consensus algorithm based on BFT (Byzantine Fault Tolerance) is definitely the right choice. However, if you build an application that requires many validators with a high level of security, PoW is a better option.

CodeChain lets you choose a consensus algorithm when you set up a network. Currently, it supports PoA, PoW, and Tendermint. CodeChain has a pluggable consensus architecture, which allows easy integration of new consensus algorithms. You can choose a consensus algorithm that best serves your application.

CodeChain currently runs two testnets.

Our first testnet, Saluki, uses a PoA consensus algorithm. Because we know the identity of nodes participating in a PoA network, we can punish Byzantine nodes by law. PoA is simple and fast because it does not need a staking mechanism that slashes the deposit of a node when the node misbehaves.

Our other testnet, Husky, uses a PoW consensus algorithm based on the Cuckoo Cycle. Each node has to compute the solution of the problem by finding cycles in random bipartite graphs. When a node finds a solution, it can produce a block and get the block reward. Husky currently produces a block every 30 seconds and the difficulty is adjusted automatically if block producing speed is either too fast or too slow.

We are going to open our third testnet, Corgi, that uses Tendermint, the best known BFT consensus algorithm. Tendermint is resilient up to ⅓ Byzantine nodes and has the throughput of 1000–2000 TPS. It guarantees instant finality (3–4 seconds) while PoW only has probabilistic finality. Some deposits are required to participate in the network as a node and they are slashed when the node misbehaves. BFT is different from PoA in that a node does not need to verify its identity.

CodeChain is experimenting with many new consensus algorithms as well. One is a consensus algorithm that is similar to Algorand which utilizes a VRF (Verifiable Random Function) to choose committee members. We are also experimenting with a hybrid approach which combines PoW and BFT where PoW is used to choose committee members for BFT consensus. More details will follow soon.

Blockchain consensus algorithms are actively being researched at the moment. We expect many new consensus algorithms that achieve performance, security, and decentralization simultaneously will be proposed. CodeChain will provide a test bed where researchers and developers can experiment with their new ideas without a hassle.

--

--