{"id":"MIP-3","name":"Linear Memory","status":"Final","chain":"monad","category":{"id":"infrastructure","name":"Infrastructure","description":"Foundational patterns enabling other standards"},"journeyStages":[{"id":"gas","name":"Gas & Fees","description":"Paying for transactions"}],"uxImpact":"MIP-3 changes how Monad prices memory-heavy transactions. Show a Monad-aware fee estimate and surface simulation failures before signing. Memory is shared across calls under an 8 MiB cap, so linear pricing does not guarantee a lower fee or successful execution.","officialUrl":"https://github.com/monad-crypto/MIPs/blob/main/MIPs/MIP-3.md","discussionUrl":"https://forum.monad.xyz/t/mip-3-linear-evm-memory-cost/362","lastReviewed":"2026-09-18","lastUpdated":"2026-09-18","kind":"proposal","hasDetailedContent":true,"content":{"id":"MIP-3","specConstraints":[{"id":"memory-cap-failure","constraint":"Contracts exceeding the memory cap can fail despite the lower memory-expansion price.","appliesTo":"application","normativity":"backwards-compatibility","specQuote":"However, contracts that allocate more than 8 MB of memory will now halt exceptionally.","specSection":"Backwards Compatibility","specUrl":"https://github.com/monad-crypto/MIPs/blob/main/MIPs/MIP-3.md#backwards-compatibility","designImplication":"Use current Monad simulation for the whole call tree. The memory pool is shared across call contexts; do not promise that every large batch fits or can be fixed by raising its gas limit. Show the reported failure and a smaller supported operation when available."}],"sources":[{"label":"Canonical MIP-3 proposal","url":"https://github.com/monad-crypto/MIPs/blob/7c95e69cb26d43d82e50d06199d4810067a3a2e0/MIPs/MIP-3.md","type":"official-spec"},{"label":"Monad opcode pricing documentation","url":"https://docs.monad.xyz/developer-essentials/opcode-pricing","type":"reference"},{"label":"Monad developer changelog","url":"https://docs.monad.xyz/developer-essentials/changelog","type":"reference"}],"lastReviewed":"2026-09-18","lastUpdated":"2026-09-18","summary":"MIP-3 changes how Monad prices memory-heavy transactions. Show a Monad-aware fee estimate and surface simulation failures before signing. Memory is shared across calls under an 8 MiB cap, so linear pricing does not guarantee a lower fee or successful execution.","applicability":{"whenToUse":["Your product needs chain-aware estimates for memory-heavy operations.","Your product handles large allocations, return data, or batched calls.","The flow should explain that linear pricing can be easier to model while simulation remains authoritative.","A failed memory-heavy simulation needs an actionable error before signing."],"whenToAvoid":["Use a generic Ethereum memory estimator for Monad transactions.","Treat linear pricing as a universal accuracy or fee guarantee.","Promise that batching is always cheaper or that large allocations cannot fail."]},"designerTakeaways":["You can distinguish chain-aware memory pricing from estimator confidence.","You can warn when an allocation approaches the shared 8 MiB memory cap.","You can surface failed large-allocation simulations before signing."],"problemsSolved":[{"problem":"Ethereum memory pricing does not describe Monad transactions","oldWay":"Apply Ethereum's linear-plus-quadratic memory schedule to a Monad estimate.","newWay":"Use a Monad-aware estimator and simulate the actual call.","impact":"high"},{"problem":"Some operations unexpectedly expensive","oldWay":"Memory expansion on Ethereum includes a quadratic component as allocations grow.","newWay":"Linear word-based pricing is easier to model, but runtime limits still apply","impact":"high"},{"problem":"Large allocations can hit a shared execution limit","oldWay":"Assume a large return or allocation scales without a chain limit","newWay":"Warn when the shared 8 MiB cap may be exceeded","impact":"medium"},{"problem":"Users hit gas limits unexpectedly","oldWay":"Transaction fails partway through due to memory cost spike","newWay":"Explain when a frame exceeds remaining memory and reverts","impact":"medium"}],"uxPatterns":[{"name":"Predictable Gas Estimates","description":"Show a chain-aware estimate with uncertainty and cap context","userFlow":["User initiates a data-heavy operation","App estimates gas with the Monad memory schedule","Shows the estimate with confidence and cap context","Explains linear word-based pricing without promising precision","User confirms with a simulation-backed expectation"]},{"name":"Allocation Size Guardrail","description":"Let users inspect allocation size and shared-cap risk before submission","userFlow":["User adjusts allocation size","Live simulation updates","User sees cap risk and estimate confidence","Chooses a size that fits the execution context","Confirms with a current estimate"]}],"uiComponents":[{"name":"LinearGasEstimate","description":"Shows gas estimate with confidence indicator","states":["estimating","confident","uncertain"],"props":["gasUnits","gasPrice","confidence"]},{"name":"BatchSizeSelector","description":"Slider or input for selecting batch size","states":["single","batch","max"],"props":["min","max","value","costPerItem","onChange"]},{"name":"CostScaleExplainer","description":"Visual explanation of linear cost scaling","states":["collapsed","expanded"],"props":["baseCount","selectedCount","baseCost"]}],"antiPatterns":[{"pattern":"Using Ethereum gas estimates on Monad","why":"Different pricing models lead to wrong estimates","instead":"Use Monad-specific gas estimation","severity":"high"},{"pattern":"Showing low confidence estimates as precise","why":"Users budget wrong, get frustrated","instead":"Show confidence level, range when uncertain","severity":"medium"},{"pattern":"Promising every batch is cheaper per item","why":"Other opcode costs, state access, and shared memory limits still affect the result.","instead":"Compare current simulations of the proposed operations before showing a saving.","severity":"medium"}],"onMonad":[{"aspect":"Memory Pricing","ethereum":"Memory cost includes both terms: 3 × words + floor(words² / 512), where words = ceil(bytes / 32).","monad":"Linear in 32-byte words: memory_size_words = (memory_byte_size + 31) // 32; memory_cost = memory_size_words // 2","designImplication":"Use the Monad memory formula in chain-aware estimation; do not promise a fixed accuracy band"},{"aspect":"Estimate Accuracy","ethereum":"Accuracy depends on the transaction and estimator; no universal band","monad":"Linear pricing may be easier for tooling to model; no universal accuracy band is established","designImplication":"Show estimator confidence and simulation results instead of a protocol precision promise"},{"aspect":"Large Data Operations","ethereum":"Memory expansion is bounded by gas and includes a quadratic component","monad":"Memory is pooled across call contexts under a shared 8 MiB cap; exceeding a frame's remaining memory reverts","designImplication":"Warn and simulate near the cap; do not promise that batching or large allocations are always viable"}],"keyTakeaways":["MIP-3 = linear memory pricing in 32-byte words","Monad pools memory across call contexts under a shared 8 MiB cap","A frame that exceeds its remaining memory fails exceptionally and reverts","Linear pricing does not guarantee estimate accuracy or batch economics","Use Monad-specific gas estimation, not Ethereum's","Show confidence levels when displaying estimates"],"technicalNotes":"MIP-3 is Final and bundled in MONAD_NINE. For a frame, memory_size_words = (memory_byte_size + 31) // 32 and memory_cost = memory_size_words // 2. Memory is pooled across call contexts: remaining_memory = 8 * 1024 * 1024 - j - k, where j is memory used by parent calls and k is memory used by the current call; memory returns to the pool when a call returns. Exceeding a frame's remaining memory halts that frame exceptionally, consumes its available gas, and reverts its state changes. Use chain-aware simulation and estimation; this does not establish a universal accuracy range."},"sources":[{"label":"Official specification","url":"https://github.com/monad-crypto/MIPs/blob/main/MIPs/MIP-3.md","type":"official-spec"},{"label":"Monad forum discussion","url":"https://forum.monad.xyz/t/mip-3-linear-evm-memory-cost/362","type":"discussion"},{"label":"Canonical MIP-3 proposal","url":"https://github.com/monad-crypto/MIPs/blob/7c95e69cb26d43d82e50d06199d4810067a3a2e0/MIPs/MIP-3.md","type":"official-spec"},{"label":"Monad opcode pricing documentation","url":"https://docs.monad.xyz/developer-essentials/opcode-pricing","type":"reference"},{"label":"Monad developer changelog","url":"https://docs.monad.xyz/developer-essentials/changelog","type":"reference"}],"urls":{"canonical":"https://www.eipsfordesigners.com/standards/MIP-3","markdown":"https://www.eipsfordesigners.com/standards/MIP-3/content.md","agent":"https://www.eipsfordesigners.com/standards/MIP-3/agent.md","api":"https://www.eipsfordesigners.com/api/standards/MIP-3","official":"https://github.com/monad-crypto/MIPs/blob/main/MIPs/MIP-3.md","discussion":"https://forum.monad.xyz/t/mip-3-linear-evm-memory-cost/362"},"freshness":{"lastReviewed":"2026-09-18","lastUpdated":"2026-09-18"}}