What is CometBFT? — Interchain Stack Highlights
Interchain Stack Highlights is a comprehensive ICF blog series that explores cutting-edge features, updates, and advancements shaping the future of the interchain. This edition focuses on CometBFT, a fundamental component of the Interchain Stack and the consensus engine powering the interchain and beyond. CometBFT enables flexible, modular development of various distributed solutions in an ever-expanding interoperable ecosystem. Let’s dive in.
What Is CometBFT?
CometBFT is a consensus engine designed for the interchain and beyond. Consensus engines ensure that agreement is reached (consensus) between all network nodes or participants in a distributed network, so they arrive at a mutual understanding of the state of the ledger and the order of transactions being processed.
Consensus engines are essential in distributed systems to ensure transactions are processed honestly, without double-spending or fraudulent activities, and all nodes maintain an accurate and consistent view of the ledger’s state. As a fork of and successor to Tendermint Core, CometBFT is the state machine replication engine powering the Interchain Stack and external projects seeking to build reliable, secure, large-scale application-specific blockchains.
CometBFT provides a reliable and efficient solution for securely replicating an application’s state across multiple machines, even if less than one-third of the machines fail or behave maliciously. This capability is known as Byzantine Fault Tolerance (BFT). As long as less than one-third of the nodes in the network are faulty, CometBFT can maintain correct operation, making it a highly secure and reliable solution for maintaining system integrity and resilience.
CometBFT Design
CometBFT consists of two main components: a blockchain consensus engine based on the Tendermint consensus algorithm and a generic application interface called the Application Blockchain Interface (ABCI). ABCI is a protocol that separates the application logic from the consensus logic, enabling standardized communication between the application and the consensus engine. It defines rules for how applications interact with the consensus engine, store and retrieve data, and validate transactions.
Splitting CometBFT into a modular design like this addresses several shortcomings of traditional monolithic blockchain architectures like Bitcoin or Ethereum which combine various components into a single program. By abstracting the consensus engine and P2P layers from the specific details of a blockchain application’s logic, developers can reuse code components more easily, maintain codebases with less complexity, and integrate with different programming languages and development environments. CometBFT versions from v0.38 onward use ABCI v2 (ABCI++).
ABCI++
ABCI++ is the flagship feature of CometBFT. It enables developers to add further programmability and customization to every step of the consensus engine, spurring innovation in the interchain and attracting cutting-edge projects from external blockchain ecosystems, such as dYdX and Berachain to build with the Interchain Stack. ABCI++ is so powerful because it transfers control from the consensus layer to the application, so the application can define the logic it wants to apply to its blocks.
In previous versions of ABCI, transactions were collected in the Tendermint/CometBFT mempool before being passed to the proposer. A proposal was then created and sent for consensus, and the proposer would finalize the block without asking for feedback from other validators before executing the block.
This design gave the proposer full control over the entire block construction process, including transaction ordering and block contents, leading to unfortunate practices such as front-running and difficulties surrounding MEV capture. In contrast, in ABCI++, when a proposal is created, the application examines it and decides whether it is correct using application-side logic. The application may even replace the default proposal with its own, enabling greater sovereignty.
Another standout feature of ABCI++ is the possibility of attaching arbitrary data — such as Oracle data or future transactions — to the votes (vote extensions). Vote extensions are verified before the block is finalized and can be used by the next block proposer to make the appropriate changes.
In the vote extension mechanism, additional data that must be considered when creating the next proposal is always signed by the validator who added it, adding a censorship-resistant layer at the consensus level. Vote extensions are verified before the block is finalized, preventing wrongdoing and opacity, and creating a much more secure, verifiable, and back-and-forth process between the consensus and application layers.
Validators can check transaction ordering and block contents, preventing frontrunning and enabling applications to enhance in-protocol MEV and share it with more stakeholders since it is no longer transferred straight to the block proposer. They can also check for logic and inclusion (for example, whether the block includes an Oracle update transaction) and only vote yes to continue the blockchain if the update is included.
As Maghnus Mareneck of Skip Protocol explained in his 2023 Nebular Summit keynote, ABCI++ enables many features from prominent projects like Chainlink or Eigenlayer in Cosmos SDK chains, enabling them to be fully sovereign and “10x more powerful.” He enthused, “It creates this highly super-powered application that can do so much more in protocol that’s normally required outside applications.”
Why Build with CometBFT?
Modular Design and Language Flexibility
Developers can use CometBFT for BFT state machine replication of applications written in any programming language and development environment. This allows the system to be pulled apart if and where necessary, making it a flexible and easy-to-use solution for various distributed applications.
CometBFT’s modularity improves maintainability and scalability, increasing flexibility in designing and implementing distributed applications. Unlike monolithic blockchains that limit developers to the language of the blockchain stack, CometBFT’s modularity allows for greater freedom in choosing tools and technologies best suited for specific projects.
Ethereum, for example, supports a Turing-complete bytecode virtual machine, which is only compatible with languages that compile down to that bytecode, whereas CometBFT decouples the consensus engine and P2P layers from the details of the state of the particular blockchain application. This provides a high degree of flexibility, customizability, and ease of integration, leading to more efficient development and deployment processes.
CometBFT supports multiple cryptographic curves, namely ed25519, secp251k1, and bls12_381, with the general direction of providing flexibility at every module, allowing developers to choose a preferred solution for a particular area (e.g., built-in p2p or libp2p).
Usability
CometBFT was designed with a strong focus on usability and a clear, articulated product strategy that places users’ needs first and foremost. CometBFT provides a simple interface and documentation, making it easier for developers to understand and implement the consensus algorithm in their projects. With the evolving requirements of the interchain, understanding developers’ needs and incorporating new features to address them ensures that CometBFT remains relevant and provides continual utility.
The Informal Systems steward team responsible for maintaining and iterating CometBFT is dedicated to improving quality assurance (QA) and correctness, combining its expertise in specifications with formal methods. Each new feature and functionality is rigorously tested using advanced techniques like model-based testing to ensure security, stability, and ultimate usability.
High Performance
CometBFT is highly performant and optimized for speed, allowing it to process a large number of transactions per second with a single-slot finality without sacrificing security or integrity. Its rigorous development enables faster functionality rollout without sacrificing quality by progressively updating the system’s architecture to meet the evolving needs of the interchain.
High performance is matched with a system architecture that enables CometBFT to scale horizontally and add more nodes to the network as needed, making it suitable for large-scale distributed applications.
Stability
CometBFT (Tendermint prior) has been in production since the launch of Cosmos Hub in 2019, making it one of the most battle-tested consensus engines in the blockchain industry. Many projects have successfully used it to transform the landscape of the interchain and beyond.
Who Uses CometBFT?
Hundreds of innovative blockchain solutions harness the modular, performant, and stable CometBFT to secure an increasing range of use cases. CometBFT-based networks secure billions of dollars of digital assets across the blockchain space and leverage ABCI++ to enable cutting-edge features for their users.
Osmosis
The interchain’s most popular DEX Osmosis leverages CometBFT’s ABCI++ to receive data from validators to make blocks more censorship-resistant and enable threshold encryption on the platform. This provides users greater privacy as no one can view their transactions until they are onchain, decrypted, and executed by everyone. Threshold encryption prevents undesirable practices like sandwich attacks or front-running by validators manipulating the order of transactions within blocks. Osmosis co-founder Dev Ojha has made many valuable contributions to optimize CometBFT’s performance, including adding support to make mempool update async from block.Commit.
Skip Protocol
Skip Protocol creates user-friendly tooling to help developers build high-quality, accessible, and powerful blockchain applications. Harnessing ABCI++, Skip Protocol provides features such as MEV auctions for chains to easily and permissionlessly capture their own MEV without outside parties. Searchers can find transactions in the mempool and add them to the block and bids are private so they cannot be outbid, creating a much more credible auction with encrypted bundles.
Skip also provides Chainlink-style decentralized oracles with the same security properties natively in-chain with ABCI++. Popular DEX dYdX uses Skip’s Slinky software to support a new price oracle mechanism and a permissionless market listing system.
dYdX
dYdX further uses ABCI++ for its vote extensions for collaborative block building to mitigate MEV in order-driven markets. Validators jointly decide on a block’s contents, and orders are grouped together in batches that undergo an auction with a single uniform price. This prevents proposers from unilaterally controlling inclusion or ordering transactions, ensuring fair competition between makers and takers, and directing value towards liquidity and price formation.
Evmos
Scalable Layer 1 blockchain Evmos is built with the Interchain Stack and is compatible and interoperable with the Ethereum Virtual Machine (EVM). Evmos leverages CometBFT’s modular architecture as a plug-and-play replacement for the consensus engines of other blockchains, replacing Ethereum’s consensus mechanism with CometBFT, and accomplishing fast finality, high transaction throughput, and short block times (~2 seconds).
Gitopia
The decentralized code collaboration platform Gitopia relies on CometBFT to ensure the network’s security, scalability, decentralization, and stability. CometBFT safeguards Gitopia against attacks, enabling it to process high transaction volumes with low latency. It also fosters broad participation in the consensus process, maintaining operational reliability even under adversarial conditions. CometBFT’s emphasis on community governance and sovereignty aligns with Gitopia’s decentralized code collaboration ethos.
Celestia
Celestia is a modular data availability network based on CometBFT and Cosmos SDK that securely scales with the number of users, making it easy for anyone to launch their own customizable blockchain that interoperates with any virtual machine.
Soarchain
DePIN network Soarchain uses CometBFT to provide a robust, secure, and consistent framework for replicating its blockchain application across multiple machines, ensuring resistance against attacks such as Sybil attacks and double-spending by leveraging CometBFT’s Byzantine Fault Tolerant (BFT) State Machine Replication (SMR).
What’s Next for CometBFT?
As the interchain expands and new use cases emerge, CometBFT is in continuous iteration, incorporating new features to become more flexible, performant, and secure, enhancing the developer experience further and attracting more innovative projects to the interchain. Some upcoming performance improvements to CometBFT include:
- Dynamic Optimal Graph (DOG): DOG is a novel transaction dissemination protocol for CometBFT’s mempool. At its current prototype stage, it has already shown compelling results at scale, where it is seen to reduce the bandwidth taken by transaction dissemination by more than 75%.
- Mempool Lanes: Mempool Lanes are designed to provide Quality of Service guarantees when system resources like block size, mempool capacity, or network traffic reach their limits. Developers will be able to classify transactions into “lanes” with different priorities, ultimately ensuring that high-priority transactions have lower latency.
These enhancements aim to improve the developer experience, broaden the scope of applications built with CometBFT, and serve the wider blockchain ecosystem.
Wrapping Up
CometBFT is a consensus engine designed for the interchain and beyond, offering ultimate flexibility and performance. Its ABCI++ protocol enables programmability and customization, with features like vote extensions enabling MEV auctions, decentralized oracles, and threshold encryption.
Comet’s modular design allows developers to use it with any programming language and development environment, making it a versatile choice for building distributed applications. With new features to enhance the developer experience and serve the wider blockchain ecosystem, CometBFT makes it easy for developers to build and deploy customized, secure, and performant blockchain applications.
Keep up to date with the latest features and version releases of CometBFT by following its developments on X or diving into the docs. Stay tuned for the next edition of Interchain Stack Highlights, providing updates and insights across the stack.