Monad 백서

Monad

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 30쪽

allel execution](/monad-arch/execution/parallel-execution): * An executor is a virtual machine for executing transactions. Monad runs many executors in parallel. * An executor takes a transaction and produces a **result**. A result is a list of **inputs** to and **outputs** of the transactions, where inputs are (ContractAddress, Slot, Value) tuples that were SLOADed in the course of execution, and outputs are (ContractAddress, Slot, Value) tuples that were SSTOREd as a result of the transaction. * Results are initially produced in a pending state; they are then committed in the original order of the transactions. When a result is committed, its outputs update the current state. When it is a result's turn to be committed, Monad checks that its inputs still match the current state; if they don't, Monad reschedules the transaction. As a result of this concurrency control, Monad's execution is guaranteed to produce the same result as if transactions were run serially. * When transactions are rescheduled, many or all of the required inputs are cached, so re-execution is generally relatively inexpensive. Note that upon re-execution, a transaction may produce a different set of Inputs than the previous execution did; ### MonadDb: high-performance state backend All active state is stored in [MonadDb](/monad-arch/execution/monaddb), a storage backend for solid-state drives (SSDs) that is optimized for storing merkle trie data. Updates are batched so that the merkle root can be updated efficiently. MonadDb implements in-memory caching and uses [asio](https://think-async.com/Asio/) for efficient asynchronous reads and writes. Nodes should have 32 GB of RAM for optimal performance. ## Comparison to Ethereum: User's Perspective | Attribute | Ethereum | Monad | | - | - | - | | **Transactions/second** (smart contract calls and transfers) | \~10 | \~10,000 | | **Block Frequency** | 12 seconds | 300 ms | | **Finality** | [2 epochs](https://hackmd.io/@prysmaticlabs/finality) (12-18 min) | 600 ms | | **Bytecode standard** | EVM ([Fusaka fork](https://www.evm.codes)) | EVM ([Fusaka fork](https://www.evm.codes)) | | **Precompiles** | `0x01` to `0x11` (Fusaka fork) | `0x01` to `0x11` (Fusaka fork) plus `0x0100` (P256, [EIP-7951](https://eips.ethereum.org/EIPS/eip-7951)) and `0x1000` (staking). See [Precompiles](/developer-essentials/precompiles) | | **Max contract size** | 24.5 kb | 128 kb | | **RPC API** | [Ethereum RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) | [Monad RPC API](/reference/json-rpc) (generally identical to Ethereum RPC API, see [differences](/reference/rpc-differences)) | | **Cryptography** | ECDSA | ECDSA | | **Accounts** | Last 20 bytes of keccak-256 of public key under ECDSA | Last 20 bytes of keccak-256 of public key under ECDSA | | **Consensus mechanism** | Gasper (Casper-FFG finality gadget + LMD-GHOST fork-choice rule) | [MonadBFT](/monad-arch/consensus/monad-bft) (tail-fork-resistant pipelined consensus with linear messaging complexity in the common case) | | **Mempool** | Global | [Local](/monad-arch/consensus/local-mempool) | | **Transaction ordering** | Leader's discretion (in practice, PBS) | Leader's discretion (default behavior: priority gas auction) | | **Sybil-resistance mechanism** | PoS | PoS | | **Delegation allowed** | No; pseudo-delegation through LSTs | Yes; see [Staking](/monad-arch/consensus/staking) | | **Hardware Requirements** (full node) | 4-core CPU, 32 GB RAM, 4 TB SSD NVMe, 25 Mbit/s bandwidth ([reference](https://eips.ethereum.org/EIPS/eip-7870)) | 16-core CPU, 32 GB RAM, 2 x 2 TB SSD NVMe, 100 Mbit/s bandwidth ([more info](/node-ops/hardware-requirements)) | ## Tooling and Infrastructure Many leading Ethereum developer tools support Monad testnet. See [Tooling and Infrastructure](/tooling-and-infra) for a list of supported providers by category. ## Next Steps Monad's public testnet is live. Head to [Network Information](/developer-essentials/network-information) to get started. Now that you are familiar with Monad's architecture and features, head to [Deployment Summary for Developers](/developer-essentials/summary) for everything you need to know to deploy. # Monad for Users Source: https://docs.monad.xyz/introduction/monad-for-users One-pager on Monad for users Monad is a high-performance Ethereum-compatible L1, offering users the best of both worlds: **portability** and **performance**. From a portability perspective, Monad offers **full bytecode compatibility** for the Ethereum Virtual Machine (EVM), so that applications built for Ethereum can be ported to Monad without code changes, and **full Ethereum RPC compatibility**, so that infrastructure like Etherscan or The Graph can be used seamlessly. From a performance perspective, Monad offers **10,000 tps** of throughput, i.e. 1 billion transactions per day, while offering **300ms block frequency** and **600ms finality**. This allows Monad to support many more users and far more interactive experiences than existing blockchains, while offering far cheaper per-transaction costs. ## What's familiar about Monad? From a user perspective, Monad behaves very similarly to Ethereum. You can use the same wallets (e.g. MetaMask) or block explorers (e.g. Etherscan) to sign or view transactions. The same apps built for Ethereum can be ported to Monad without code changes, so it is expected that you'll be able to use many of your favorite apps from Ethereum on Monad. The address space in Monad is the same as in Ethereum, so you can reuse your existing keys. Like Ethereum, Monad features linear blocks, and linear ordering of transactions within a block. Like Ethereum, Monad is a proof-of-stake network maintained by a decentralized set of validators. Anyone can run a node to independently verify transaction execution, and significant care has been taken to keep hardware requirements minimal. ## What's different about Monad? Monad makes exceptional performance possible by introducing **parallel execution** and **superscalar pipelining** to the Ethereum Virtual Machine. **Parallel execution** is the practice of utilizing multiple cores and threads to strategically execute work in parallel while still committing the results in the original order. Although transactions are executed in parallel "under the hood", from the user and developer perspective they are executed serially; the result of a series of transactions is always the same as if the transactions had been executed one after another. **Superscalar pipelining** is the practice of creating stages of work and executing the stages in parallel. A simple diagram tells the story: <img alt="Pipelining, Laundry Day" /> <p>Pipelining laundry day. Top: Naive; Bottom: Pipelined. Credit: Prof. Lois Hawkes, FSU</p> When doing four loads of laundry, the naive strategy is to wash, dry, fold, and store the first load of laundry before starting on the second one. The pipelined strategy is to start washing load 2 when load 1 goes into the dryer. Pipelining gets work done more efficiently by utilizing multiple resources simultaneously. **Monad** introduces pipelining to address existing bottlenecks in state storage, transaction processing, and distributed consensus. In particular, Monad introduces pipelining and other optimizations in five major areas: * [MonadBFT](/monad-arch/consensus/monad-bft) for performant, tail-fork-resistant BFT consensus * [RaptorCast](/monad-arch/consensus/raptorcast) for efficient block transmission * [Asynchronous Execution](/monad-arch/consensus/asynchronous-execution) for pipelining consensus and execution to raise the time budget for execution * [Parallel Execution](/monad-arch/execution/parallel-execution) and [JIT Compilation](/monad-arch/execution/native-compilation) for efficient transaction execution * [MonadDb](/monad-arch/execution/monaddb) for efficient state access Monad's client, which was written from scratch in C++ and Rust, reflect these architectural improvements and result in a platform for decentralized apps that can truly scale to world adoption. ## Why should I care? Decentralized apps are replacements for centralized services with several significant advantages: * **Open APIs / composability**: decentralized apps can be called atomically by other decentralized apps, allowing developers to build more complex functionality by stacking existing components. * **Transparency**: app logic is expressed purely through code, so anyone can review the logic for side effects. State is transparent and auditable; proof of reserves in DeFi is the default. * **Censorship-resistance and credible neutrality:** anyone can submit transactions or upload applications to a permissionless network. * **Global reach**: anyone with access to the internet can access crucial financial services, including unbanked/underbanked users. However, decentralized apps need cheap, performant infrastructure to reach their intended level of impact. A single app with 1 million daily active users (DAUs) and 10 transactions per user per day would require 10 million transactions per day, or 100 tps. A quick glance at [L2Beat](https://l2beat.com/scaling/activity) - a useful website summarizing the throughput and decentralization of existing EVM-compatible L1s and L2s - shows that no EVM blockchain supports even close to that level of throughput right now. Monad materially improves on the performance of an EVM-compatible blockchain network, pioneering several innovations that will hopefully become standard in Ethereum in the years to come. With Monad, developers, users, and researchers can reuse the wealth of existing applications, libraries, and applied cryptography research that have all been built for the EVM. ## Testnet Monad's public testnet is live. Head to [Network Information](/developer-essentials/network-information) to get started. # Why Blockchain? Source: https://docs.monad.xyz/introduction/why-blockchain A simple mental model for the 'what' and 'why'. A blockchain is decentralized agreement among a diverse set of participants about two things: 1. An official **ordering** (ledger) of transactions 2. An official **state of the world**, including balances of accounts and the state of various programs. In modern blockchains such as Ethereum, transactions consist of balance transfers, creation of new programs, and function calls against existing programs. The aggregate result of all transactions up to now produces the current state, which is why *agreement about (1) above implies agreement about (2).* A blockchain system has a set of protocol rules, also known as a consensus mechanism, which describe how a distributed set of nodes which are currently in sync will communicate with each other to agree upon additional transactions to add to the ledger. ([MonadBFT](/monad-arch/consensus/monad-bft) is an example of a consensus mechanism.) Induction keeps the nodes in sync: they start with the same state and apply the same transactions, so at the end of applying a new list of transactions, they still have consistent state. Shared global state enables the development of decentralized apps - apps that live "on the blockchain", i.e. on each of the nodes in the blockchain system. A decentralized app is a chunk of code (as well as persistent, app-specific state) that can get invoked by any user, who does so by submitting a transaction pointing to a function on that app. Each of the nodes in the blockchain is responsible for correctly executing the bytecode being called; duplication keeps each node honest. ## An example app Decentralized apps can implement functionality that we might otherwise expect to be implemented in a centralized fashion. For example, a very simple example of a decentralized app is a *Virtual Bank* (typically referred to in crypto as a Lending Protocol). In the physical world, a bank is a business that takes deposits and loans them out at a higher rate. The bank makes the spread between the high rate and the low rate; the borrower gets a loan to do something economically productive; and you earn interest on your deposits. Everyone wins! A Virtual Bank is simply an app with four major methods: `deposit`, `withdraw`, `borrow`, and `repay`. The logic for each of those methods is mostly bookkeeping to ensure that deposits and loans are being tracked correctly: ```python theme={null} class VirtualBank: def deposit(sender, amount): # transfer amount from sender to myself (the bank) # do internal bookkeeping to credit the sender def withdraw(sender, amount): # ensure the sender had enough on deposit # do internal bookkeeping to debit the sender # transfer amount from myself (the bank) to sender def borrow(sender, amount): # ... def repay(sender, amount); # ... ``` In Ethereum, or in Monad, someone can write code for this Virtual Bank and upload it; then anyone can utilize it for borrowing and lending, potentially far more easily than when trying to get access to banking services in their home country. This simple example shows the power of decentralized apps. Here are a few other benefits to call out: * **Open APIs / composability**: decentralized apps can be called atomically by other decentralized apps, allowing developers to build more complex functionality by stacking existing components. * **Transparency**: app logic is expressed purely through code, so anyone can review the logic for side effects. State is transparent and auditable; proof of reserves in DeFi is the default. * **Censorship-resistance and credible neutrality:** anyone can submit transactions or upload applications to a permissionless network. * **Global reach**: anyone with access to the internet can access crucial financial services, including unbanked/underbanked users. # Why Monad: Decentralization + Performance Source: https://docs.monad.xyz/introduction/why-monad Monad addresses today's performance bottlenecks through optimization while preserving decentralization. Monad is an Ethereum-compatible Layer-1 blockchain. It produces a block every 300 ms, reaches full finality in 600 ms, and has the throughput capacity for more than 10,000 transactions per second. Monad reaches these numbers while preserving decentralization, rather than trading it away for speed. The rest of this page explains how. ## Performance at a glance | Metric | Value | Basis | | - | - | - | | Throughput | 10,000+ TPS | Capacity | | Block time | 300 ms | Observed (mainnet) | | Speculative finality | 300 ms (1 slot) | Protocol | | Finality | 600 ms (2 slots) | Protocol | | Block gas budget | 150M gas (500M gas/s) | Observed (mainnet) | | Per-transaction gas limit | 30M gas | Protocol | <Note> The **Basis** column says where each number comes from. **Observed** figures are measured on Monad mainnet, where the mean block time was about 302 ms in September 2026. **Capacity** is the design throughput for typical transactions rather than a reading of current demand, so the rate you see in practice depends on how much gas each transaction uses. **Protocol** figures come from MonadBFT itself: a block reaches [speculative finality](/monad-arch/consensus/monad-bft#speculative-finality) after one slot and full finality after two. </Note> ## Decentralization matters A blockchain has several major components: * Consensus mechanism for achieving agreement on transactions to append to the ledger * Execution/storage system for maintaining the active state In increasing the performance of these components, one could cut corners, for example by requiring all of the nodes to be physically close to each other (to save on the overhead of consensus), or by requiring a huge amount of RAM (to keep much or all of the state in memory), but it would be at a significant cost to decentralization. And decentralization is the whole point! As discussed in [Why Blockchain?](/introduction/why-blockchain), decentralized shared global state allows many parties to coordinate while relying on a single, shared, objective source of truth. Decentralization is key to the matter; a blockchain maintained by a small group of node operators (or in the extreme case, a single operator!) would not offer benefits such as trustlessness, credible neutrality, and censorship-resistance. For any blockchain network, decentralization should be the principal concern. Performance improvements should not come at the expense of decentralization. ## Today's performance bottlenecks Ethereum's current execution limits (2.5M gas per second) are set conservatively, but for several good reasons: * Inefficient storage access patterns * Single-threaded execution * Very limited execution budget, because consensus can't proceed without execution * Concerns about state growth, and the effect of state growth on future state access costs Monad addresses these limitations through algorithmic improvements and architectural changes, pioneering several innovations that will hopefully become standard in Ethereum in the years to come. Maintaining a high degree of decentralization, while making material performance improvements, is the key consideration. ## Addressing these bottlenecks through optimization Monad enables pipelining and other optimizations in four major areas to enable exceptional Ethereum Virtual Machine performance and materially advance the decentralization/scalability tradeoff. Subsequent pages describe these major areas of improvement: * [MonadBFT](/monad-arch/consensus/monad-bft), a frontier BFT consensus mechanism solving the [tail-forking](https://www.category.xyz/blogs/monadbft-fast-responsive-fork-resistant-streamlined-consensus) problem * [RaptorCast](/monad-arch/consensus/raptorcast) for efficient block transmission * [Asynchronous Execution](/monad-arch/consensus/asynchronous-execution) for pipelining consensus and execution to raise the time budget for execution * [Parallel Execution](/monad-arch/execution/parallel-execution) and [JIT Compilation](/monad-arch/execution/native-compilation) for efficient transaction execution * [MonadDb](/monad-arch/execution/monaddb) for efficient storage of Ethereum state # JSON-RPC API Reference Source: https://docs.monad.xyz/reference/json-rpc/api Reference for Monad's JSON-RPC interface ## eth\_blockNumber Returns the number of most recent block. <a href="/reference/json-rpc/playground?method=eth_blockNumber"> <span /> <span>Open in RPC Playground</span> <svg> <path /> </svg> </a> **Parameters** This method takes no parameters. **Returns** <ResponseField name="result" type="string"> The current block number, hex-encoded. </ResponseField> **Example** <CodeGroup> ```json Request theme={null} { "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 } ``` ```json Response theme={null} { "jsonrpc": "2.0", "id": 1, "result": "0x4b7" } ``` </CodeGroup> ## eth\_call Executes a new message call immediately without creating a transaction on the block chain. <a href="/reference/json-rpc/playground?method=eth_call"> <span /> <span>Open in RPC Playground</span> <svg> <path /> </svg> </a> **Parameters** <ParamField type="object"> Transaction call object. <Expandable title="properties"> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> <ParamField type="string" /> </Expandable> </ParamField> <ParamField type="string"> Block tag (`latest`, `safe`, `finalized`, `pending`) or 32-byte block hash. </ParamField> **Returns** <ResponseField name="result" type="string"> The return data of the executed contract call, hex-encoded. </ResponseField> **Example** <CodeGroup> ```json Request theme={null} { "jsonrpc
프로젝트로 돌아가기