Skip to content

Build on Monad Blockchain – Comprehensive Guide for Developers 2024

Monad

Introduction

The web3 ecosystem has seen rapid growth in recent years, with new L1s (Layer1) and L2s (Layer2) blockchains coming into existence each day. Monad is an L1 that stands out as a new player focused on scalability, security, and efficiency while maintaining compatibility with the Ethereum ecosystem(yes it is 100% EVM compatible). It introduces several technical innovations aimed at solving the blockchain trilemma—scalability, security, and decentralization—while improving developer experience and overall transaction throughput.

What is Monad?

Image from the Pipeline

Image from The Pipeline

It is a high-performance, Ethereum-compatible Layer 1 blockchain that offers a significant leap in transaction throughput and scalability. Its implementation of the Ethereum Virtual Machine complies with the Shanghai fork. With innovations like Parallel Execution, Deferred Execution, and MonadBFT, it can process up to 10,000 transactions per second (TPS). It has near zero gas fees and possesses 1s single slot finality.

But what is it that sets it apart from other L1s? The answer to this is the focus on enabling high-throughput execution without compromising on scalability, security, or decentralization. Unlike some Layer 1 blockchain that achieve speed at the cost of decentralization, Monad introduces a balanced approach through its advanced technical architecture.

Monad’s goal is to provide the infrastructure developers need to build decentralized applications (dApps) that can scale to millions of users while maintaining low latency low fees and a very high transaction speed. dApps and decentralized finance (DeFi) applications demand greater scalability, it is a promising solution that enhances the user and developer experience altogether.

Key Features

It addresses the current limitations in blockchain scalability with the following key features:

  1. High Throughput and Scalability: Monad can handle 10,000 TPS, making it highly suitable for DeFi, gaming, and NFT applications that require fast, high-volume transactions.
  2. Parallel Execution: It introduces a novel parallel execution model, allowing multiple transactions to be processed simultaneously across different cores, which significantly reduces bottlenecks associated with sequential processing.
  3. Deferred Execution: This innovative approach separates transaction validation from execution. It validates transactions first and executes them later, allowing for greater concurrency and efficient resource utilization.
  4. MonadBFT Consensus: The consensus protocol used here is a highly optimized Byzantine Fault Tolerant (BFT) algorithm, ensuring that the network remains secure even in the face of malicious nodes.
  5. EVM Compatibility: It is fully compatible with the Ethereum Virtual Machine (EVM), making it easy for developers to migrate or deploy Ethereum-based applications on the Monad blockchain without major code modifications.

Understanding Monad’s Architecture

The architecture is what truly sets it apart in the blockchain ecosystem. Its design revolves around high performance, reduced latency, and scalability, leveraging modern technologies such as multi-core processors, advanced consensus mechanisms, and state-of-the-art data management systems. Here are the key elements of its architecture:

MonadBFT: Securing the Network with Byzantine Fault Tolerance

It uses MonadBFT, a variation of the Byzantine Fault Tolerant (BFT) consensus protocol, to ensure network security and fault tolerance. In a decentralized network, nodes (validators) need to agree on the state of the blockchain even if some nodes act maliciously or fail. BFT protocols are designed to handle such situations by ensuring consensus even with up to one-third of the nodes being compromised.

It is a pipelined two-phase BFT algorithm with optimistic responsiveness and linear communication overhead in the common case and quadratic communication in the case of a timeout. As in most BFT algorithms, communication proceeds in phases; at each phase, the leader sends a signed message to the voters, who send signed responses to the following leader. Pipelining allows the quorum certificate (QC) or timeout certificate (TC) for block k to piggyback on the proposal for block k+1.

It optimizes the traditional BFT consensus to handle a high number of transactions without slowing down communication between validators. Here’s how it works:

  • Leader-Based Consensus: A leader is chosen from the validators to propose new blocks, and the other validators vote on the proposal. This allows for a fast and secure finalization of blocks.
  • Fault Tolerance: Up to one-third of validators can act maliciously or experience faults without affecting the integrity of the blockchain.

Mempool

Pending user transactions are stored in the mempool of each validator until they are included in a finalized block. Pending transactions are shared with other validator mempools by erasure-coding the transaction and then communicating over a broadcast tree for efficiency.

Transaction hashing

MonadBFT is an efficient means of coming to an agreement about an arbitrary payload. However, block propagation is still a significant bottleneck; for example, a block with 10,000 transactions with 500 byte transactions will be 5 MB; blocks of this size would put undue bandwidth requirements on validator nodes.

To alleviate this issue, block proposals refer to transactions by hash only – significant savings, as hashes are 32 bytes. Because of this, all validator mempools need to have the transactions in their mempool when voting on proposals and committing blocks. Transactions that are submitted to a validator’s mempool are shared with other validator mempools by erasure-coding the transaction and then communicating over a broadcast tree for efficiency.

Parallel Execution: Breaking the Sequential Processing Bottleneck

One of Monad’s groundbreaking innovations is its ability to execute transactions in parallel, significantly increasing throughput. Traditional blockchains like Ethereum process transactions sequentially, leading to congestion and slower processing times. Monad addresses this by executing multiple transactions simultaneously across different processor cores.

Here’s how parallel execution works in Monad:

  • Non-Conflicting Transactions: Monad identifies transactions that do not interact with the same account or contract and processes them in parallel. For example, two transactions affecting different accounts can be executed concurrently.
  • Optimistic Execution: Monad uses an “optimistic” approach to execution. Transactions are processed in parallel, but if a conflict arises (e.g., two transactions try to modify the same account), Monad can detect and resolve it by re-executing the transaction sequentially.

This parallel execution mechanism gives Monad its competitive edge, allowing it to handle thousands of transactions simultaneously without the throughput limitations of sequential blockchains.

Deferred Execution: Validating Now, Executing Later

Deferred Execution is another core architectural innovation in Monad. Traditionally, blockchains execute transactions immediately after validating them. In Monad, however, transaction validation and execution are decoupled.

  • Validation First: It first validates transactions—checking whether they are legitimate and whether the sender has sufficient funds or permissions.
  • Execution Deferred: Instead of executing the transaction immediately, Monad defers the execution to a later stage. This deferred execution enables greater concurrency as validated transactions can be executed in parallel.

By deferring execution, Monad optimizes resource utilization and reduces execution time, leading to faster finalization of transactions without compromising security.

MonadDB: Efficient State Management

Managing the blockchain state efficiently is a critical aspect of any high-performance blockchain. Monad introduces MonadDB, a custom-built database designed to handle the unique requirements of blockchain state storage and retrieval.

It offers several advantages over traditional key-value databases used by most blockchains:

  • Native Patricia Trie Support: MonadDB natively implements the Patricia Trie data structure (used by Ethereum) both in-memory and on-disk. This improves performance by avoiding the overhead of embedding one data structure inside another.
  • Asynchronous I/O: MonadDB supports asynchronous I/O (using Linux’s io_uring) to handle multiple state reads and writes without blocking the execution pipeline. This is crucial for maintaining high throughput when handling large volumes of data.

MonadDB ensures that the blockchain state can be accessed and modified efficiently, even under high transaction loads, making it a key component of Monad’s performance-oriented architecture.

Comparison to Ethereum

It claims to be 100% EVM compatible, but there are certain features like Transactions Per Second(TPS), block time, and finality which set it apart when compared to the Ethereum ecosystem. Let us look into the comparison below:

AttributeEthereumMonad
Transactions/second (smart contract calls and transfers)~10~10,000
Block time12s1s
Finality2 epochs (12-18 min)Single-slot (1s)
Bytecode standardEVM (Shanghai fork)EVM (Shanghai fork)
RPC APIEthereum RPC APIEthereum RPC API
CryptographyECDSAECDSA
AccountsLast 20 bytes of keccak-256 of public key under ECDSALast 20 bytes of keccak-256 of public key under ECDSA
Consensus mechanismGasper
(Casper-FFG finality gadget +
LMD-GHOST fork-choice rule)
MonadBFT (pipelined HotStuff with additional research improvements)
MempoolYesYes
Transaction orderingLeader’s discretion (in practice, PBS)Leader’s discretion (default behavior: priority gas auction)
Sybil-resistance mechanismPoSPoS
Delegation allowedNo; pseudo-delegation through LSTsYes
Hardware requirements (full node)4-core CPU
16 GB RAM
1 TB SSD
25 Mbit/s bandwidth
16-core CPU
32 GB RAM
2 TB SSD
100 Mbit/s bandwidth
Information from the official documentation

Why Developers Should Build on Monad

With its high throughput, scalability, and developer-friendly environment, it provides an attractive platform for building decentralized applications. Here’s why developers should consider building on Monad: Check out the official documentation here.

1. Scalability for High-Volume Applications

For developers building DeFi platforms, NFT marketplaces, or gaming dApps, scalability is crucial. Monad’s ability to handle 10,000 TPS ensures that applications can scale without facing the bottlenecks commonly experienced on Ethereum or other Layer 1 blockchain. The parallel execution model further enhances performance, making it ideal for high-traffic applications

2. Low Fees and Fast Finality

With its optimized transaction processing and low overhead, it offers significantly lower transaction fees compared to Ethereum. The Deferred Execution model also reduces latency, enabling super-fast finality of transactions, which is essential for applications like decentralized exchanges (DEXs) or payment systems that require real-time interactions from the users.

3. Seamless EVM Compatibility

Monad’s full compatibility with the Ethereum Virtual Machine (EVM) allows developers to easily build Ethereum-based dApps and smart contracts without the need to rewrite them. This means that developers can leverage pre-existing Ethereum tools, such as wallets like Metamask, and development tools such as Hardhat, and block explorers like Etherscan while benefiting from Monad’s better performance.

4. Developer-Friendly Environment

Monad is designed with keeping developers in mind. In addition to EVM compatibility, it offers versatile developer tooling, comprehensive documentation, and active support from the community. Developers can use familiar tools and frameworks while building on a platform that’s built for scalability and efficiency.

Use Cases for Monad

The rich landscape of Ethereum tooling and applied cryptography research can plug seamlessly into Monad while benefiting from improved throughput and scale: like analytics/indexing (e.g. Etherscan, Dune), applications (any dApp built for Ethereum), developer tooling (e.g. Hardhat, Apeworx, Foundry), wallets (e.g. Phantom, MetaMask) Other areas to build in are:

  • DeFi Applications: Decentralized finance platforms, especially those dealing with high-frequency trades and liquidity pools, require fast transaction throughput and low fees, its architecture makes it ideal for building scalable DeFi solutions.
  • NFT Marketplaces: The demand for NFTs often causes network congestion on blockchains like Ethereum. The ability to handle thousands of transactions per second and low fees make it an ideal platform for NFT marketplaces that handle large volumes of transactions/
  • Gaming: Real-time multiplayer games built on the blockchain need fast and reliable transaction processing. Monad’s parallel execution ensures smooth gameplay experiences without the lags or delays commonly associated with slower blockchains.

Conclusion

Monad is a next-generation Layer 1 blockchain designed to push the boundaries of scalability, throughput, and developer experience. With its innovative architecture—including MonadBFT, Parallel Execution, Deferred Execution, and MonadDB—it offers a powerful platform for developers building decentralized applications that require high performance and low fees.

By addressing key issues like transaction bottlenecks, state management, and security, Monad sets itself apart from existing Layer 1 blockchains. For developers looking to build on a scalable, EVM-compatible platform, it is an exciting and promising choice that could lead to the next wave of decentralized innovation.