# Nibiru EVM

Nibiru EVM is a novel, EVM-equivalent execution layer natively built into the Nibiru blockchain. Nibiru EVM preserves full compatibility with EVM bytecode and the Ethereum JSON-RPC API, ensuring seamless portability for EVM developers.

In this Section Synopsis
Why Nibiru EVM? A brief primer on the EVM portion of Nibiru's Execution Engine.
Precompiles Understand the extensions to Nibiru EVM that give it functionality beyond what's present in the default Ethereum Virtual Machine.
FunToken Mechanism Clean, multi-VM composability for fungible tokens (FunTokens).

# Why Nibiru EVM?

  1. ERC-20 tokens elevate to an interchain standard: Nibiru's unique "FunToken" (fungible token) mechanism modularizes ERC-20 tokens and the "Bank Coins". Through a precompile contract, ERC-20 tokens can be seamlessly registered as "FunTokens" on Nibiru. These FunTokens are fully compatible with the Inter-Blockchain Communication (IBC) protocol, enabling their free movement and usage across connected blockchains.

  2. Interopability Across Virtual Machines (VMs): Nibiru EVM was designed to be compatible with Wasm VM and Inter-Blockchain Communication (IBC). Nibiru accounts are VM-agnostic, and Ethereum contracts can call Wasm contracts and vice versa.

  3. Fast Settlement and Superior Scalability: Nibiru benefits from parallel optimistic execution, instant finality, and sub 2-second settlements. This creates a better experience for Web3 users and a promising platform for application developers as well.

  4. Toolchain Compatibility and Flexibility: Applications from Ethereum can easily launch on Nibiru and tap into a multi-chain liquidity layer using IBC, Circle CCTP, and LayerZero. At the same time, Rust develpers can access everything with Wasm. Choose your own stack without causing fragmentation.

  5. Inexpensive gas fees: Nibiru keeps gas fees low, making it more economical for users to interact with applications on the network.

# Benefits to Developers

Any application that can exist on Ethereum can launch on Nibiru without difficulty and benefit from its parallel optimistic execution and instant finality. Nibiru's EVM execution environment gives developers the ability to build and deploy applications in a familiar EVM environment with a lower barrier to entry, extending Nibiru’s core functionality in Wasm (WebAssembly) with the extensive user base and developer community of Ethereum.

Builders will now be able to use existing tooling like Solidity, Hardhat, Remix, and Metamask, all while enjoying the performance benefits of Nibiru.

# Transaction Throuput on Ethereum

The Ethereum blockchain only allows for about 20-40 transactions per second (TPS) for all Ethereum users. When the limit is reached, users are forced to compete against each other for their transactions to be included, which drives up gas fees during periods of congestion.

# Ethereum Virtual Machine (EVM)

The Ethereum Virtual Machine (EVM) is a decentralized computation engine that runs on thousands of interconnected computers (nodes) using Ethereum clients. It serves as the execution environment for smart contracts on a network that implements the Ethereum protocol. The EVM ensures deterministic computation, meaning every node produces the exact same result given the same initial state and transaction, maintaining the integrity and consistency of the blockchain.

The Nibiru EVM is responsible for storing and executing Ethereum smart contracts on Nibiru in an isolated runtime, which means the code running inside the EVM cannot access external systems such as the filesystem. This isolation enhances security and predictability in smart contract execution.

Nibiru implements the Ethereum protocol to offer compatibility and interoperability with existing Ethereum-based applications. Nibiru maps to a different consensus engine yet leverages an execution environment that is equivalent in capabilities to Ethereum's.

# Is Nibiru EVM a separate chain, layer 2, or rollup running in tandem with the base layer?

Ethereum protocol functionality on Nibiru is not a separate blockchain. It is a purely additive upgrade (V2 on mainnet). Distinct from things like Layer 2s, optimistic or zero-knowledge (ZK) rollups, and side chains, Nibiru EVM is a piece of the broader Nibiru Execution Engine.

It is one possible avenue for executing state changes to be included in a block similar to other types of transaction messages. Non-EVM transactions and EVM transactions can co-exist within the same block.

# EVM-equivalent versus Ethereum-equivalent

Nibiru EVM is EVM-equivalent but not quite Ethereum-equivalent.

"[It is] exactly like Ethereum "from within", but [has] some differences on the outside, particularly in data structures like the block structure and state tree. The goal [with EVM-equivalence] is to be fully compatible with existing applications, but make some minor modifications to Ethereum to make development easier and to make proof generation faster." - Vitalik

If something is fully and uncompromisingly Ethereum-equivalent, is means that it

"[does] not change any part of the Ethereum system to make it easier to generate proofs. [It does] not replace hashes, state trees, transaction trees, precompiles or any other in-consensus logic, no matter how peripheral." - Vitalik (in the context of zero-knownledge proofs)

Reference: Vitalik Buterin, 2022. The different types of ZK-EVMs (opens new window)

# Programming Language Support

# Solidity and Vyper

Nibiru EVM makes the Nibiru blockchain Ethereum compatible, allowing trustless deployment of Solidity and Vyper smart contracts, or any other language the compiles to EVM bytecode.

# Rust

In addition to EVM bytecode, Nibiru's execution engine supports Wasm (WebAssembly) smart contracts. This allows developers to write smart contracts in Rust that compile downto Wasm bytecode.

Notably, these Rust/Wasm contracts can be called directly from smart contracts on the EVM. This is made possible by the Nibiru Wasm precompile, which enables EVM contracts to invoke and execute Wasm contracts. This multi-VM interoperability is compatible with standard Ethereum development libraries like ethers.js.

  1. Nibiru Precompiles
  2. Alpha Testing Release