Introducing Polaris VM

Dev Bear
Berachain Foundation
5 min readMar 6, 2023

Today we are excited to share with the Berachain community the first open source project built entirely in house, Polaris. This new Blockchain library serves as the foundation and baseplate for the Berachain EVM network. Built on top of the Cosmos SDK, Polaris offers superior support for the Ethereum Virtual Machine (EVM) compared to existing implementations both within the Cosmos ecosystem, and outside of it.

In the process of building one of the strongest, fastest, and most liquid networks, the decision to stick with the familiar EVM was crucial. When composing the perfect developer experience for people building on the network, the current market solutions for connecting the EVM to Cosmos, unfortunately, all came short. This led us to build up a new alternative to Ethermint from the ground up, making improvements across the board to ensure we can create a vibrant and thriving ecosystem of developers who can leverage our platform to build cutting-edge decentralized applications that are secure, fast, and user-friendly.

In this blog post, we review the current landscape of EVM infrastructure, the design choices that led us to this development, and a runthrough of our (now) open-source repository.

Motivation

The road to creating a scalable, secure, and sustainable EVM for Cosmos has been a challenging one. It all started with Ethermint, which gave birth to the original sidechain vision. However, the expected adoption did not materialize, and as a result, the vision for Ethermint has since evolved. The current focus is on developing multiple highly secure, fast finality, EVM-based chains that can provide greater interoperability and composability for smart contracts in the Interchain. While the visions align with what we are trying to achieve at Berachain, the actual output comes short of our desideratum.

Our primary objective now is to create a high-quality user experience for developers, users, and operators. We want to prioritize the ease and convenience of building, operating, and using applications on our platform. Our team is committed to pushing the boundaries of UX and implementing innovative solutions that will make our platform more user-friendly than ever before.

When designing the architecture of Berachain, certain characteristics of the Cosmos model attracted us to committing to the platform in order to help scale the chain. These features include the IBC module, interchain security, and the deep developer tooling available to us. Considering the options of different VMs on the market today, we believed from day one that the need for a proper EVM network on Cosmos would translate well with our community, and our goal of serving as a true liquidity node uniting the EVM and Cosmos ecosystems.

While the new direction of Ethermint attracted some developer attention (EVMOS, Canto, and other EVM solutions on Cosmos all are powered by this), certain drawbacks of Ethermint led us to pursue a different path. This path included one with more composability and performance that can help provide users an enhanced version of the user experience they expect on Ethereum and its scaling solutions. Polaris was a long journey but provides exactly that — the best of Cosmos with the best of the EVM. We’re excited to forge the gold standard for EVM on Cosmos, and to work closely with new and already existing EVM on Cosmos chains to encourage Polaris’ adoption as their VM of choice.

About Polaris

Polaris is a general purpose blockchain framework that allows for the integration of the Ethereum Virtual Machine (EVM) into any underlying networking or consensus layer.

One of the key features of Polaris is its ability to seamlessly integrate with other blockchains in the Cosmos ecosystem, allowing for the transfer of digital assets and data between different chains. This is made possible through the use of the Inter-Blockchain Communication (IBC) protocol, which is built into the Cosmos SDK and enables secure, trustless communication between different blockchains.

In addition to Cosmos functionality, Polaris can be applied into the context of any layer-one architecture thanks to its composability and modularity. Where Polaris truly shines is in its superior support for the EVM. Polaris is designed to be fully compatible with the Ethereum network, meaning that it can support all existing Ethereum dApps and smart contracts without requiring any modifications or additional development work. This is achieved through a high-performance EVM implementation that is optimized for speed and reliability.

Polaris also offers robust security features, including support for the latest Ethereum network upgrades and improved protection against common attack vectors, such as re-entrancy attacks and gas limit vulnerabilities.

Overall, Polaris is a powerful new framework that offers a compelling alternative to existing EVM implementations like Ethermint. Its seamless integration with blockchains and robust EVM support make it a promising platform for building decentralized applications and unlocking new use cases.

Architecture

Polaris runs an Ethereum mainnet-equivalent VM on top of a host chain. With a modular plugin-based architecture, Polaris enables any host chain (e.g. Cosmos SDK-based chains etc.) to execute Ethereum transactions on smart contracts. The application of the host chain must implement a series of plugins (Configuration, State, Block, Precompile, Gas, Tx Pool) so that Polaris Core can run state transitions in accordance with the specifications of the EVM.

By utilizing this architecture, developers can add, remove and replace componenets within the system as they wish, making Polaris a fully configurable EVM playground.

Benchmarks

While building out the modular architecture, a large amount of energy and resources were additionally placed on maintain high performance standards. On average, Polaris is operating 2.013x faster on popular ERC20/721 operations compared to EVMOS when comparing the nanosecond per operation for the highlighted methods. Benchmarks were run on a 2021 M1 Max Macbook Pro.

Ethermint

BenchmarkTokenTransfer: 242135 ns/op

BenchmarkTokenTransferFrom: 220632 ns/op

BenchmarkTokenMint: 226673 ns/op

Polaris

BenchmarkTokenTransfer: 115739 ns/op

BenchmarkTokenTransferFrom: 124508 ns/op

BenchmarkTokenMint: 104184 ns/op

Wrapping Up

For developers looking to get familiar with the new developments the foundation has created, they can always depend on the network sticking to the ethos of decentralization and open-source nature. Prior to the network being governed and owned by the community, we will make it our mission that core parts of the protocol such as Polaris are also open to iterate on so that they can prosper come time for mainnet.

|| Explore and contribute to the Berachain Polaris

Polaris public release kicks off the official rollout of the Berachain network! We will follow this blog post with an official protocol roadmap and publish an overview of the next milestones, including the much anticipated Devnet.

For more updates, follow us on Twitter and join the conversation on Discord. If you’re interested in joining the Berachain Foundation to help bring mass-adoption to Cosmos, view our Toronto offices job openings or reach out to Dev (https://twitter.com/itsdevbear) or Smokey (https://twitter.com/smokeythebera).

GitHub: https://github.com/berachain
Twitter: https://twitter.com/berachain
Discord: https://discord.gg/berachain

--

--