{"id":"MIP-3","name":"Linear Memory","status":"Proposed","chain":"monad","category":{"id":"infrastructure","name":"Infrastructure","description":"Foundational patterns enabling other standards"},"journeyStages":[{"id":"gas","name":"Gas & Fees","description":"Paying for transactions"}],"uxImpact":"Linear memory pricing replaces Ethereum's quadratic model — gas costs scale predictably with operation size. Design implications: show tighter estimate ranges with higher confidence, use Monad-specific gas estimation (not Ethereum defaults), enable batch and data-heavy flows without surprise fee jumps. Design decisions: whether to explain linear scaling to users or just show accurate estimates; how to present confidence levels on fee previews.","officialUrl":"https://github.com/monad-crypto/MIPs/blob/main/MIPS/MIP-3.md","hasDetailedContent":true,"content":{"id":"MIP-3","summary":"MIP-3 changes how Monad charges for memory usage. Instead of quadratic pricing (where doubling memory costs 4x), it uses linear pricing (doubling costs 2x). This makes gas costs more predictable and prevents certain contract patterns from being prohibitively expensive. For users, it means gas estimates are more accurate and fewer surprise fee jumps.","applicability":{"whenToUse":["Your product addresses: gas estimates often wrong for memory-heavy operations.","Your product addresses: some operations unexpectedly expensive.","The flow should deliver: linear pricing = estimates match actuals more closely.","Fee screens need estimates, speed options, and plain-language breakdowns."],"whenToAvoid":["Use Monad-specific gas estimation.","Show confidence level, range when uncertain.","Show per-item cost comparison."]},"designerTakeaways":["You can design UI that delivers linear pricing = estimates match actuals more closely.","You can design UI that delivers predictable cost scaling for data-heavy operations.","You can collapse multi-step actions into one confirmation users understand."],"problemsSolved":[{"problem":"Gas estimates often wrong for memory-heavy operations","oldWay":"Estimate shows $2, actual cost is $8 due to quadratic memory pricing","newWay":"Linear pricing = estimates match actuals more closely","impact":"high"},{"problem":"Some operations unexpectedly expensive","oldWay":"Returning large arrays costs exponentially more","newWay":"Predictable cost scaling for data-heavy operations","impact":"high"},{"problem":"DeFi protocols avoid certain patterns","oldWay":"Can't efficiently process large batches on-chain","newWay":"Batch operations economically viable","impact":"medium"},{"problem":"Users hit gas limits unexpectedly","oldWay":"Transaction fails partway through due to memory cost spike","newWay":"More consistent gas consumption","impact":"medium"}],"uxPatterns":[{"name":"Predictable Gas Estimates","description":"Show users accurate cost predictions","mockup":"concept/nft-gallery","userFlow":["User initiates batch operation","App estimates gas (linear scaling)","Shows high-confidence estimate","Explains predictable pricing","User confirms with accurate expectation"]},{"name":"Batch Size Slider","description":"Let users choose batch size with live cost preview","mockup":"concept/bundled-defi","userFlow":["User adjusts batch size slider","Live cost updates (linearly)","User sees predictable scaling","Chooses optimal batch size","Confirms with known cost"]}],"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":"Not explaining why batch is cheaper per-item","why":"Users don't understand value of batching","instead":"Show per-item cost comparison","severity":"medium"}],"onMonad":[{"aspect":"Memory Pricing","ethereum":"Quadratic: memory_cost = a × size²","monad":"Linear: memory_cost = b × size","designImplication":"Batch operations much more predictable in cost"},{"aspect":"Estimate Accuracy","ethereum":"±20-50% common for complex operations","monad":"±5-10% typical with linear model","designImplication":"Can show tighter ranges, higher confidence"},{"aspect":"Large Data Operations","ethereum":"Often prohibitively expensive","monad":"Economically viable","designImplication":"Enable features like batch claims, large airdrops"}],"keyTakeaways":["MIP-3 = linear memory pricing (more predictable)","Gas estimates are more accurate on Monad","Batch operations scale predictably","Use Monad-specific gas estimation, not Ethereum's","Show confidence levels when displaying estimates"],"technicalNotes":"MIP-3 modifies the EVM memory expansion cost formula. Ethereum uses: memory_cost = (size² / 512) + (3 × size). Monad uses linear pricing: memory_cost = k × size. This primarily affects contracts that allocate large memory regions, like those processing arrays or returning large data structures."},"sources":[{"label":"Official specification","url":"https://github.com/monad-crypto/MIPs/blob/main/MIPS/MIP-3.md","type":"official-spec"}],"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"},"freshness":{"lastReviewed":"2026-04-05","lastUpdated":"2026-04-05"}}