
{"id":183052,"date":"2026-06-18T15:41:42","date_gmt":"2026-06-18T15:41:42","guid":{"rendered":"https:\/\/mycryptomania.com\/?p=183052"},"modified":"2026-06-18T15:41:42","modified_gmt":"2026-06-18T15:41:42","slug":"the-memory-model-is-the-architecture-account-vs-eutxo","status":"publish","type":"post","link":"https:\/\/mycryptomania.com\/?p=183052","title":{"rendered":"The Memory Model Is the Architecture: Account vs. eUTXO"},"content":{"rendered":"<p><em>A protocol engineer\u2019s analysis of state representation, parallel execution, and the tradeoffs that don\u2019t make it into the pitch\u00a0deck.<\/em><\/p>\n<p>The account-vs-UTXO debate is usually framed as developer ergonomics: mutable objects and method calls versus functional purity and immutable outputs. That framing buries the lede. The state model is the concurrency model. It determines how the runtime schedules execution, where contention surfaces, which classes of bug are <em>reachable<\/em> versus merely <em>avoidable<\/em>, and how lean a node\u2019s working set stays after years of operation. Parallelism, MEV surface, L2 sequencer complexity, and state growth are all downstream of this one decision.<\/p>\n<p>What follows is an analysis from the runtime\u2019s perspective\u200a\u2014\u200aincluding the points where the UTXO model\u2019s advantages stop being\u00a0free.<\/p>\n<h3>1. State Representation: Global Trie vs. UTXO\u00a0Set<\/h3>\n<h3>The account model: keyed mutable\u00a0storage<\/h3>\n<p>An account-model chain maintains a single authenticated key-value store. On Ethereum that\u2019s a Merkle-Patricia Trie keyed by keccak256(address), with each leaf holding (nonce, balance, storageRoot, codeHash). Contract storage is a second trie nested under storageRoot, keyed by keccak256(slot).<\/p>\n<p>Execution is read-modify-write against this structure. The EVM resolves a SLOAD, mutates registers, and commits via SSTORE. Two properties fall out of this and drive everything later:<\/p>\n<p><strong>Authenticated reads\/writes are not free.<\/strong> Each access is an O(log n) trie traversal over keccak-hashed paths with poor locality, so the cost is dominated by random NVMe\/page-cache I\/O, not the arithmetic. EIP-2929&#8217;s cold\/warm split (2100 vs. 100 gas for SLOAD) is a direct admission that the <em>first<\/em> touch of a slot is where the real cost\u00a0lives.<strong>The write set is not known until execution.<\/strong> Storage slots can be computed at runtime (mapping keys, dynamic dispatch via DELEGATECALL). The runtime cannot know what a transaction will touch without running it. Hold onto this\u200a\u2014\u200ait is the entire parallelism story.<\/p>\n<h3>The UTXO model: state as a consumed\/created graph<\/h3>\n<p>A UTXO ledger has no accounts, no balances, and no in-place mutation. State is exactly the set of Unspent Transaction Outputs. A transaction is a pure transition: it names a set of existing outputs to consume and defines a set of new outputs to\u00a0create.<\/p>\n<p>tx : {UTXO_in} \u2192 {UTXO_out}    where every UTXO_in is removed from the set<br \/>                               and every UTXO_out is appended exactly once<\/p>\n<p>Each output carries a globally unique identifier id = H(txid \u2016 output_index) and can be consumed at most once. The lineage of consumptions and creations forms a DAG. There is no &#8220;balance to update,&#8221; only prior state destroyed and new state minted. This is the same invariant Rust enforces at compile time\u200a\u2014\u200asingle ownership, single consumption, no shared mutable state\u200a\u2014\u200alifted to the\u00a0ledger.<\/p>\n<p>The practical consequence is that a transaction must <em>name its exact inputs by hash before broadcast<\/em>. That requirement is the source of nearly every other property in this article\u200a\u2014\u200agood and\u00a0bad.<\/p>\n<h3>2. Concurrency: Where Parallelism Actually Comes\u00a0From<\/h3>\n<p>This is the most misunderstood part of the comparison, so be precise about it: <strong>parallel execution requires knowing the read\/write set before you run the transaction.<\/strong> The account model and the UTXO model differ in <em>when<\/em> and <em>how<\/em> that set becomes known\u200a\u2014\u200anot in some inherent capacity for concurrency.<\/p>\n<h3>EVM: undeclared access forces\u00a0optimism<\/h3>\n<p>The EVM cannot know a transaction\u2019s footprint a priori, so parallel EVM runtimes use Optimistic Concurrency Control. <strong>Block-STM<\/strong> (Aptos, and the approach several parallel-EVM efforts adopt) speculatively executes transactions in parallel, records read\/write sets, and validates after the fact. On a detected conflict\u200a\u2014\u200atwo transactions writing the same DEX reserve slot\u200a\u2014\u200ait aborts the dependent transaction and re-executes. Under low contention this is close to linear speedup. Under a hot slot (a popular pool, an NFT mint) it degrades toward sequential plus the wasted cost of aborted attempts and re-validation passes. The contention didn\u2019t disappear; it moved into CPU\u00a0thrash.<\/p>\n<h3>The account model can be declarative<\/h3>\n<p>It\u2019s worth killing a common oversimplification: account models are not intrinsically un-parallelizable. <strong>Solana\u2019s Sealevel<\/strong> parallelizes by requiring every transaction to declare its account access list (read-only vs. writable) up front; the scheduler then runs transactions with disjoint writable sets concurrently, no speculation needed. <strong>Sui<\/strong> does the same with its object model\u200a\u2014\u200atransactions touching only <em>owned<\/em> objects skip consensus ordering entirely and parallelize trivially, while <em>shared<\/em> objects fall back to sequenced execution. Both are account\/object models that bought parallelism by adopting the UTXO discipline of <em>declaring your footprint<\/em>. The lesson generalizes: the win was never \u201cUTXO,\u201d it was \u201cdeclare your state\u00a0access.\u201d<\/p>\n<h3>UTXO: disjointness by construction<\/h3>\n<p>In a UTXO chain that declaration is mandatory and unforgeable\u200a\u2014\u200athe inputs <em>are<\/em> the footprint. Two transactions conflict iff their input sets intersect, which is a set-membership check against consumed-output hashes (amortized O(1) per input via a hash set; scheduling N transactions is O(total inputs)). Disjoint input sets are conflict-free by construction, with no speculation and no rollback path to maintain. The scheduler gets a hard guarantee instead of a hopeful\u00a0one.<\/p>\n<p>That\u2019s the genuine, defensible advantage: <strong>deterministic conflict detection with zero abort machinery.<\/strong> Keep it in mind for the next section, where the same mechanism becomes a liability.<\/p>\n<h3>3. Programmability: The eUTXO Execution Context<\/h3>\n<p>A bare UTXO pairs a value with a spending predicate (typically a signature check). It has no persistent memory and can\u2019t enforce invariants across transactions. The Extended UTXO (eUTXO) model\u200a\u2014\u200aformalized in the IOG\/Cardano research line and used in spirit by object\/UTXO hybrids like Fuel\u200a\u2014\u200aadds programmable, <em>local<\/em> state to each output via three components:<\/p>\n<p><strong>Validator (script):<\/strong> the predicate, addressed by its hash. It returns a boolean; it does not compute\u00a0outputs.<strong>Datum:<\/strong> an arbitrary data payload attached to the output. This is the output\u2019s local\u00a0memory.<strong>Redeemer:<\/strong> the caller-supplied argument provided when consuming the output (the analogue of calldata).<\/p>\n<p>Spending an output runs the validator over its local\u00a0context:<\/p>\n<p>validate(Datum, Redeemer, ScriptContext) \u2192 Bool<\/p>\n<p>ScriptContext exposes the whole transaction\u200a\u2014\u200aall inputs, all outputs, validity interval, signatories\u200a\u2014\u200aso the script can constrain what the <em>resulting<\/em> transaction must look like. There is no global state\u00a0read.<\/p>\n<h3>Worked example: a constant-product pool<\/h3>\n<p>In the account model, an AMM pool\u2019s reserves (x, y) live in shared storage slots that every swap mutates in place. In eUTXO, the entire pool <em>is one UTXO<\/em> whose datum holds (x, y). A\u00a0swap:<\/p>\n<p>Consumes the pool\u00a0UTXO.Supplies a redeemer (swap 10 X for\u00a0Y).The validator checks the invariant on the <em>new<\/em> output: it recomputes x&#8217; \u00b7 y&#8217; \u2265 k (with fees), verifies the produced pool UTXO carries the correct updated datum (1010, 990), and returns\u00a0True.<\/p>\n<p>The old pool UTXO is destroyed and a new one with the updated datum is minted, atomically. Multi-step protocols are built by threading the datum through a chain of consume\/create steps\u200a\u2014\u200astate machines on a graph, never a global trie lookup. Note the inversion: the validator <em>verifies<\/em> a state transition the caller already computed; it doesn\u2019t <em>produce<\/em>\u00a0one.<\/p>\n<h3>4. The Contention Tax: Where eUTXO Parallelism Collapses<\/h3>\n<p>This is the section the optimistic version of this article leaves out, and it\u2019s the one that matters most if you\u2019re choosing an architecture to <em>ship<\/em>\u00a0on.<\/p>\n<p>Re-read the AMM example with the scheduler from \u00a72 in mind. The entire pool is a single UTXO. A UTXO can be consumed exactly once. Therefore <strong>only one swap against that pool can land per block.<\/strong> Every other swap in the mempool named the same input; the moment one of them is included, the rest reference an output that no longer exists and are invalid by construction.<\/p>\n<p>The property that made disjoint transactions trivially parallel makes <em>contended<\/em> transactions strictly serial\u200a\u2014\u200aand worse than the EVM here, because there\u2019s no \u201cqueue behind the current state\u201d semantics, just instant invalidation. On a popular pool this is a throughput cliff, not a gentle degradation. This is not theoretical: it\u2019s exactly why production Cardano DEXs (Minswap, SundaeSwap, and others) run <strong>batcher \/ off-chain aggregation<\/strong> layers. Users submit orders as their own UTXOs; a batcher collects them and folds them into the pool UTXO sequentially, one fold per block. You get back throughput, but you\u2019ve reintroduced a privileged off-chain actor that orders and includes flow\u200a\u2014\u200awhich is precisely an MEV role (see\u00a0\u00a76).<\/p>\n<p>The architectural escape hatches, and their\u00a0costs:<\/p>\n<p><strong>Shard the state across many UTXOs<\/strong> (e.g., split liquidity into K parallel pool UTXOs). Restores K-way parallelism but fragments liquidity and pushes routing complexity to the\u00a0client.<strong>Off-chain batching\/solvers.<\/strong> Restores throughput, recentralizes ordering.<strong>Design around single-writer hotspots entirely.<\/strong> Often the right call, but it constrains what protocols are natural to\u00a0build.<\/p>\n<p>The honest framing: eUTXO gives you <em>free parallelism on uncontended state and a hard serialization wall on contended state<\/em>. The account\/STM model gives you <em>speculative parallelism that degrades continuously under contention<\/em>. Neither is strictly better; they fail differently, and you should pick the failure mode that matches your workload\u2019s contention profile.<\/p>\n<h3>5. Determinism: Construction-Time vs. Execution-Time Evaluation<\/h3>\n<p>This is eUTXO\u2019s cleanest and most underrated win, and it survives the \u00a74 critique\u00a0intact.<\/p>\n<p>In the account model, a transaction is evaluated at <strong>execution time<\/strong>. The user signs against state S; the world mutates S \u2192 S&#8217; while the transaction sits in the mempool; the transaction executes against S&#8217;, fails its slippage check, reverts\u200a\u2014\u200aand the user still pays gas for the cycles burned reaching the\u00a0revert.<\/p>\n<p>eUTXO transactions are evaluated at <strong>construction time<\/strong>. Inputs, outputs, and the resulting datum are fully specified before broadcast, so the on-chain client is a <em>verifier<\/em>, not a compute engine. It checks two things: do the named inputs still exist in the unspent set, and does each validator return True. If your targeted pool UTXO was consumed by someone else first, your transaction doesn&#8217;t revert\u200a\u2014\u200ait&#8217;s structurally invalid and is dropped at the validation gate, before any script runs. You don&#8217;t pay for failed computation. (Cardano&#8217;s two-phase model is the practical embodiment: phase-1 checks structure\/balance for free; phase-2 runs scripts, and only a phase-2 <em>script<\/em> failure forfeits posted collateral.)<\/p>\n<h3>L2 derivation consequences<\/h3>\n<p>For rollups this is a real simplification, not a slogan. An EVM sequencer must execute the full state transition to compute the post-state root before it can commit a block. A UTXO-based sequencer\u2019s core job reduces to verifying input disjointness and signatures\/scripts\u200a\u2014\u200athe expensive transition computation was already done by the client that built the transaction. The heavy compute is pushed to the edge, and the L1\u2192L2 derivation pipeline gets leaner and easier to make deterministic and fault-provable. The flip side is that wallet\/client tooling must now do real work (UTXO selection, datum construction, fee balancing), which is where the eUTXO developer-experience complaints legitimately come\u00a0from.<\/p>\n<h3>6. Security: Reentrancy as a Structural Property\u200a\u2014\u200aand What eUTXO Does Not\u00a0Fix<\/h3>\n<h3>Reentrancy is precluded, not\u00a0patched<\/h3>\n<p>Reentrancy exists in the account model because a contract can make an external call <em>before<\/em> committing its own state update, leaving a stale intermediate state for the callee to exploit. The defense is disciplined sequencing (checks-effects-interactions) and reentrancy guards\u200a\u2014\u200ai.e., a coding practice you can\u00a0forget.<\/p>\n<p>In eUTXO there is no intermediate state to re-enter. State transition is atomic destruction-and-creation: the instant a transaction is validated, its input UTXO is consumed and gone; the updated UTXO does not exist until the transaction\u2019s outputs are appended at the end. There is no point in the lifecycle where a contract holds a half-updated balance on the ledger that another execution context could observe and exploit. The vulnerability class isn\u2019t mitigated\u200a\u2014\u200ait\u2019s structurally unrepresentable.<\/p>\n<h3>Replay prevention without\u00a0nonces<\/h3>\n<p>The account model serializes an account\u2019s transactions with an incrementing nonce, which couples otherwise-independent transactions: a stuck tx at nonce 5 blocks nonce 6. eUTXO needs no nonces\u200a\u2014\u200aeach output\u2019s unique id = H(txid \u2016 index) is consumed exactly once, so a rebroadcast fails because its inputs are gone. A wallet can fan out hundreds of independent transactions over disjoint UTXOs in parallel with no sequence head-of-line blocking. (The cost: you must manage a UTXO set and avoid accidentally double-spending your own outputs across concurrent transactions\u200a\u2014\u200aa real client-side concern for high-frequency systems.)<\/p>\n<h3>eUTXO does not eradicate MEV<\/h3>\n<p>This is where the original needs correcting. MEV is extractable value from <em>ordering and inclusion<\/em>, and eUTXO has both. Whoever lands their transaction first against a contended UTXO (a pool, an oracle, an auction) wins; everyone else is invalidated. Block producers still choose ordering. And as \u00a74 showed, the standard eUTXO scaling pattern <em>introduces<\/em> batchers\/solvers who explicitly order user flow\u200a\u2014\u200aa textbook MEV-extraction position. eUTXO changes the <em>shape<\/em> of MEV (front-running becomes \u201cyour input got consumed first\u201d rather than \u201cyour trade executed at a worse price\u201d) and removes the specific failure of paying gas for a doomed revert, but it does not remove the economic incentive or the producer\u2019s ordering power. Claiming otherwise is the kind of thing a reviewer who\u2019s run a Cardano batcher will catch immediately.<\/p>\n<h3>7. State Growth and\u00a0Pruning<\/h3>\n<p>EVM state monotonically inflates: dead contracts, abandoned tokens, and dust persist in the active trie because the structure is interconnected and reachability is hard to reason about. State-expiry proposals have stalled for years for exactly this reason, and node operators eat the cost in RAM and NVMe provisioning.<\/p>\n<p>The UTXO model prunes by construction. The active validation state is <em>only<\/em> the unspent set; a consumed output is removed and never consulted again to validate future transactions. The working set stays lean without a state-rent mechanism. Two caveats keep this honest: (1) the UTXO <em>set itself<\/em> can still grow if outputs are created faster than consumed\u200a\u2014\u200awhich is why Cardano enforces a min-ADA-per-UTXO to price storage and discourage dust, and (2) pruning the <em>active<\/em> set doesn\u2019t eliminate the <em>historical<\/em> chain data a new node must process to sync. The advantage is real but it\u2019s about working-set size, not total\u00a0data.<\/p>\n<h3>When to Choose\u00a0What<\/h3>\n<p>Reduce it to contention profile and execution semantics, not ideology:<\/p>\n<p><strong>Choose account\/STM<\/strong> when state is densely shared and write-heavy at common hotspots, when you want maximum developer familiarity, and when you can tolerate speculative re-execution overhead under load. You\u2019re betting on optimism degrading gracefully.<strong>Choose declarative-access (Solana\/Sui-style)<\/strong> when you can require footprint declaration and your workload is mostly disjoint\u200a\u2014\u200ayou get UTXO-like scheduling guarantees while keeping object\/account ergonomics.<strong>Choose eUTXO<\/strong> when you want construction-time determinism, structural elimination of an entire bug class, trivial parallelism on disjoint state, and cheap pruning\u200a\u2014\u200aand when you can engineer around single-writer hotspots with sharding or batching rather than pretend they don\u2019t\u00a0exist.<\/p>\n<p>The account model optimized for the developer\u2019s mental model first. The UTXO model optimizes for the runtime\u2019s guarantees first and pushes complexity to the client. As throughput and determinism requirements rise, that trade keeps looking better\u200a\u2014\u200aprovided you go in knowing exactly where the serialization wall is, rather than discovering it in production.<\/p>\n<p>Follow me on\u00a0<a href=\"https:\/\/x.com\/luishsoares\">X<\/a>.<\/p>\n<p><a href=\"https:\/\/medium.com\/coinmonks\/the-memory-model-is-the-architecture-account-vs-eutxo-9200439b023a\">The Memory Model Is the Architecture: Account vs. eUTXO<\/a> was originally published in <a href=\"https:\/\/medium.com\/coinmonks\">Coinmonks<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>","protected":false},"excerpt":{"rendered":"<p>A protocol engineer\u2019s analysis of state representation, parallel execution, and the tradeoffs that don\u2019t make it into the pitch\u00a0deck. The account-vs-UTXO debate is usually framed as developer ergonomics: mutable objects and method calls versus functional purity and immutable outputs. That framing buries the lede. The state model is the concurrency model. It determines how the [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":183053,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-183052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interesting"],"_links":{"self":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/183052"}],"collection":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=183052"}],"version-history":[{"count":0,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/posts\/183052\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=\/wp\/v2\/media\/183053"}],"wp:attachment":[{"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=183052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycryptomania.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=183052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}