RFP 5 - A Fast Consensus for Cosmos SDK Chains

Researchers: Miguel Matos & team at INESC-ID

Summary

Many existing consensus engines such as Tendermint have inefficiencies in throughput and latency. Tendermint is the consensus engine that is standard in Cosmos SDK chains, but because of its limitations, Composable intends to replace Tendermint for its own Cosmos SDK chain, Picasso Cosmos. This chain is central to Composable’s cross-chain interoperable infrastructure. Thus, we must ensure that our chain has the highest throughput and lowest latency possible. This is particularly critical as we are developing products in the block building space. This means that speed is of the essence.

We were able to modify the Picasso Cosmos chain using Kauri as a consensus algorithm instead of Tendermint. We selected Kauri as it is an incredibly scalable and fast consensus engine, and we seek these characteristics in Picasso Cosmos in order to optimally support the various transactions and processes it supports.

In addition to making Kauri compatible with the Cosmos SDK, we must also modify it to be compatible with the Inter-Blockchain Communication (IBC) protocol. Thus, Kauri can operate for our Picasso Cosmos chain and within our IBC-powered cross chain infrastructure.

This initiative will contribute the following:

  • A blockchain consensus mechanism for Cosmos SDK chains which is scalable and fast, thanks to its modification of the Kauri consensus mechanism

Background & Problem Statement

Background

Core background concepts/definitions are as follows:

Existing Blockchain Consensus Mechanisms:

In blockchain systems, a consensus mechanism is a program that facilitates distributed agreement about the ledger’s state amongst all nodes. Thus, the consensus algorithm is critical to ensuring the validity of a blockchain’s state.

However, a number of issues exist in the present landscape for blockchain consensus mechanisms. First, most consensus mechanisms used in practice are outdated, and have a lower throughput and higher latency than many newer consensus mechanisms that have been developed by researchers. Second, it is often difficult to build applications along the consensus of blockchains.

The Cosmos network largely addresses the latter issue, making it easy for appchains to build in the Interchain and leverage its consensus mechanism. In regards to the former issue, the consensus mechanism on Cosmos (Tendermint) is a relatively high-performance Byzantine fault tolerance (BFT) consensus algorithm. Yet, Tendermint is still a number of years old and could be further improved to handle even higher throughput with decreased latency.

For many consensus mechanisms such as Tendermint, this lack of scalability is caused by their requirement of a single leader process to receive and validate votes from a quorum of processes and then broadcast the result. These limitations stem from bottlenecks both at the network and processing levels that result from the large number of messages that need to be sent, received, and processed to reach consensus. For instance, the PBFT protocol groups participants in a clique and uses an all-to-all communication pattern resulting in quadratic message complexity. While many proposals to improve PBFT have been put forward (such as BFT-SMART or Spinning), most retain its inefficient communication pattern.

A number of newer approaches to consensus have introduced dissemination/aggregation trees to propagate values and collect and validate votes. However, these trees increase round latency, which limits throughput for deeper trees.

Kauri, a Novel Consensus Mechanism:

Thus, Kauri was created: the first tree-based communication abstraction for BFT consensus protocols. Kauri is a BFT communication abstraction that can sustain high throughput as the system size grows, leveraging a novel pipelining technique to perform scalable dissemination and aggregation on trees.

The table below summarizes the advantages of Kauri compared to existing consensus mechanisms:

Complete details of the Kauri consensus protocol can be found in the research paper by Neiheiser et al., 2021, linked in the resources section below.

Problem Statement

For the Picasso Cosmos Chain at the heart of Composable’s cross-chain interoperable infrastructure, we must ensure that our chain has the highest throughput and lowest latency possible, as we are working on a number of different innovations in the block building space. This means that speed is of the essence. Therefore, we replace Tendermint on Picasso Cosmos, instead leveraging the incredibly scalable Kauri consensus engine.

Thus, the research question/objective here is as follows:

  • How can we make the consensus of our Picasso Cosmos chain faster and more scalable?

Plan & Deliverables

Expected outputs/deliverables are as follows:

  • A blockchain consensus mechanism for Cosmos SDK chains
  • Deployment of this consensus mechanism on Composable’s Picasso Cosmos chain to prove the concept

The plan for achieving this output is outlined below:

Experiment: Making the Kauri Consensus Mechanism Compatible with Cosmos and IBC

To address the above research question, we aim to modify the Kauri consensus engine so it is Cosmos SDK- and IBC-compatible.

The Tendermint Core is how Cosmos nodes manage all things consensus-related; the Core communicates with end user clients via RPC endpoints, while it talks to the local application state machine instance via Tendermint’s Application Blockchain Interface (ABCI).

Also of note is that the Tendermint Core acts as a client that initiates requests (such as “Query”) from the ABCI. This is how an application receives the ledger of transactions for which consensus has been reached. These transactions are then input into the state machine of the application. All Tendermint instances reach consensus on the transaction ledger in this manner, meaning the application state machine is replicated in lockstep for all network nodes.

Given this architecture, we were able to integrate Kauri into our Cosmos chain by removing the Tendermint Core. We added a shim that communicates in the same manner as the Core (e.g. has an RPC endpoint for end user clients and delivers the consensus ledger along the ABCI to applications). This is similar to the protocol outlined by Paradigm and linked in the References section of this document.

Currently, we have the Kauri consensus engine in testnet to run the Picasso Cosmos chain. Previously, there was a C++ implementation of Kauri, and now we are looking to create a rust implementation and put Kauri into the Cosmos SDK.

References

How to Participate

If you’re a researcher who believes that you would be a good fit to contribute to any of the Composable RFPs, please reach out to Composable’s Lead Research Associate, Sydney Sweck, at sydney@composable.finance. In the email, be sure to include:

  • The RFP number(s) you’d like to contribute to
  • Your relevant background experience
  • How you think you could contribute to the research