{"eip":7973,"title":"Warm Account Write Metering","description":"Introduce warm account writes, decreasing the cost of writing to an account after the first write.","authors":["Charles Cooper (@charles-cooper)","Maria Silva (@misilva73)","Ben Adams (@benaadams)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2025-06-14","requires":[2200],"discussionsTo":"https://ethereum-magicians.org/t/eip-7973-warm-account-write-metering/25907","repo":"EIPs","label":"EIP-7973","officialUrl":"https://eips.ethereum.org/EIPS/eip-7973","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7973.md","url":"https://eips.huatuo.xyz/eip-7973/","tldr":{"en":"Makes repeated writes to the same account within a transaction cheaper after the first one, since the state root is only recomputed once, putting native ETH transfers on a par with token transfers.","ja":"同じトランザクション内で同一アカウントへ繰り返し書き込む場合、2 回目以降を安くする。ステートルートの再計算は 1 回だけで済むため、ネイティブ ETH の送金をトークン送金と同等のコストにそろえる。","ko":"같은 트랜잭션 안에서 같은 계정에 반복해서 쓰는 경우 첫 번째 이후를 더 저렴하게 만든다. 상태 루트를 한 번만 다시 계산하면 되므로, 네이티브 ETH 전송을 토큰 전송과 같은 수준으로 맞춘다.","zh":"让同一笔交易内对同一账户的重复写入在第一次之后更便宜，因为状态根只需重新计算一次，使原生 ETH 转账与代币转账的成本相当。"},"tags":["gas","repricing","state","sstore","core"],"explainers":{"en":{"lang":"en","tldr":"Makes repeated writes to the same account within a transaction cheaper after the first one, since the state root is only recomputed once, putting native ETH transfers on a par with token transfers.","tags":["gas","repricing","state","sstore","core"],"related":[2200,2929,7928],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7973/","markdown":"## What problem does it solve?\n\nUpdating the state trie is one of the most expensive parts of processing a block. For storage, Ethereum already recognises that the second write to a slot in the same transaction is cheaper than the first ([EIP-2200](/eip-2200/) net metering). For the account itself (its nonce, balance or code hash), every write costs the same.\n\nThat creates odd incentives. Sending WETH to the same account several times in one transaction gets cheaper per transfer, but sending native ETH does not. This penalises native ETH and any future opcodes that move value. In reality, all writes to one account in a transaction can be batched into a single trie update, so later writes cost the node far less than the first.\n\n## How it works\n\nThe old parameters `GAS_CALL_VALUE` and `GAS_STORAGE_UPDATE` are removed and replaced by three new ones (values still TBD):\n\n| Parameter | Meaning |\n| --- | --- |\n| `GAS_COLD_ACCOUNT_WRITE` | First update to an account in this transaction (account trie) |\n| `GAS_COLD_STORAGE_WRITE` | First update to a storage slot (storage trie) |\n| `GAS_WARM_WRITE` | Any later write that does not trigger a new root calculation |\n\n**Value-moving calls and creation** (`CALL` family, `CREATE`, `CREATE2`): instead of the flat `GAS_CALL_VALUE`, charge `GAS_COLD_ACCOUNT_WRITE` if the account still equals its value at the start of the transaction, otherwise `GAS_WARM_WRITE`.\n\n**`SSTORE`** is split into two parts: the cost of touching the account tuple (cold or warm, as above) plus the slot-specific cost. A storage write makes the account dirty, so a second `SSTORE` to the same contract pays only the warm account part. Refund logic is adjusted to match, including refunding the cold account write if a slot is restored to its original value while the account was otherwise clean.\n\nFor compatibility with Block-Level Access Lists ([EIP-7928](/eip-7928/)) and parallel execution, the \"original\" account values can be taken from the BAL entry of an earlier transaction in the same block.\n\n## Sample code\n\nThe account-write part of the charge, simplified from the spec's pseudocode:\n\n```python\ndef account_write_cost(state, address) -\u003e int:\n    original = get_account_original(state, address)  # value at tx start\n    current = get_account(state, address)\n    if current != original:\n        return GAS_WARM_WRITE          # already dirtied in this tx\n    return GAS_COLD_ACCOUNT_WRITE      # first write: pays for the trie update\n```\n\nEffect on a contract paying out ETH in a loop (Solidity):\n\n```solidity\n// Under this EIP, paying the same recipient several times in one tx\n// costs the cold account write once, then the warm write for the rest.\nfor (uint256 i = 0; i \u003c n; i++) {\n    (bool ok, ) = recipient.call{value: amount}(\"\");\n    require(ok);\n}\n```\n\n## Things to know\n\n- **Status: Draft.** All three new gas values are TBD pending stateful benchmarks, so no actual savings can be quoted yet.\n- This is a backwards-incompatible repricing and needs a network upgrade.\n- Wallets and nodes must update `eth_estimateGas`; the spec warns that stale estimates could cause problems.\n- Net metering for accounts (a refund when an account ends the transaction unchanged) was considered and left out for simplicity.\n- The authors note that cheaper account writes might open new attack vectors and call for more analysis.\n"},"ja":{"lang":"ja","tldr":"同じトランザクション内で同一アカウントへ繰り返し書き込む場合、2 回目以降を安くする。ステートルートの再計算は 1 回だけで済むため、ネイティブ ETH の送金をトークン送金と同等のコストにそろえる。","tags":["gas","repricing","state","sstore","core"],"related":[2200,2929,7928],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7973/","markdown":"## 何を解決するのか\n\nステートトライの更新は、ブロック処理の中で最もコストの高い部分の 1 つです。ストレージについては、同じトランザクション内での同じスロットへの 2 回目の書き込みが 1 回目より安いことを、Ethereum はすでに認めています（[EIP-2200](/eip-2200/) の net metering）。しかしアカウント自体（nonce、残高、コードハッシュ）への書き込みは、毎回同じコストがかかります。\n\nこのため奇妙なインセンティブが生まれます。1 つのトランザクション内で同じアカウントに WETH を複数回送ると 1 回あたりのコストは下がりますが、ネイティブ ETH ではそうなりません。これはネイティブ ETH と、今後価値を移動させるあらゆる opcode に不利に働きます。実際には、1 トランザクション内の同一アカウントへの書き込みはすべて 1 回のトライ更新にまとめられるため、2 回目以降のノードへの負担は 1 回目よりはるかに小さくなります。\n\n## 仕組み\n\n従来のパラメータ `GAS_CALL_VALUE` と `GAS_STORAGE_UPDATE` は削除され、3 つの新しいパラメータに置き換えられます（値はまだ未定）。\n\n| パラメータ | 意味 |\n| --- | --- |\n| `GAS_COLD_ACCOUNT_WRITE` | このトランザクションでのアカウントへの最初の更新（アカウントトライ） |\n| `GAS_COLD_STORAGE_WRITE` | ストレージスロットへの最初の更新（ストレージトライ） |\n| `GAS_WARM_WRITE` | 新たなルート計算を引き起こさない、それ以降の書き込み |\n\n**価値を移動する呼び出しとコントラクト作成**（`CALL` ファミリー、`CREATE`、`CREATE2`）: 固定の `GAS_CALL_VALUE` の代わりに、アカウントがトランザクション開始時の値のままであれば `GAS_COLD_ACCOUNT_WRITE` を、そうでなければ `GAS_WARM_WRITE` を課金します。\n\n**`SSTORE`** は 2 つの部分に分割されます。アカウントのタプルに触れるコスト（上記のコールドまたはウォーム）と、スロット固有のコストです。ストレージへの書き込みはアカウントを dirty にするため、同じコントラクトへの 2 回目の `SSTORE` はウォームのアカウント分だけを支払います。リファンドのロジックもそれに合わせて調整され、アカウントが他に変更されていない状態でスロットが元の値に戻された場合は、コールドのアカウント書き込み分も返金されます。\n\nBlock-Level Access Lists（[EIP-7928](/eip-7928/)）や並列実行との互換性のため、アカウントの「元の」値は、同じブロック内の先行トランザクションの BAL エントリから取得できます。\n\n## サンプルコード\n\n仕様の擬似コードを簡略化した、アカウント書き込み部分の課金:\n\n```python\ndef account_write_cost(state, address) -\u003e int:\n    original = get_account_original(state, address)  # value at tx start\n    current = get_account(state, address)\n    if current != original:\n        return GAS_WARM_WRITE          # already dirtied in this tx\n    return GAS_COLD_ACCOUNT_WRITE      # first write: pays for the trie update\n```\n\nループ内で ETH を支払うコントラクトへの影響（Solidity）:\n\n```solidity\n// Under this EIP, paying the same recipient several times in one tx\n// costs the cold account write once, then the warm write for the rest.\nfor (uint256 i = 0; i \u003c n; i++) {\n    (bool ok, ) = recipient.call{value: amount}(\"\");\n    require(ok);\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** 3 つの新しいガス値はすべて、ステートフルなベンチマークを待って未定のため、実際の削減量はまだ示せません。\n- これは後方互換性のない価格改定であり、ネットワークアップグレードが必要です。\n- ウォレットとノードは `eth_estimateGas` を更新する必要があります。仕様は、古い見積もりが問題を引き起こす可能性があると警告しています。\n- アカウントに対する net metering（トランザクション終了時にアカウントが変更されていない場合のリファンド）も検討されましたが、簡潔さのために見送られました。\n- 著者は、アカウント書き込みを安くすると新たな攻撃手段が生まれる可能性があり、さらなる分析が必要だとしています。\n"},"ko":{"lang":"ko","tldr":"같은 트랜잭션 안에서 같은 계정에 반복해서 쓰는 경우 첫 번째 이후를 더 저렴하게 만든다. 상태 루트를 한 번만 다시 계산하면 되므로, 네이티브 ETH 전송을 토큰 전송과 같은 수준으로 맞춘다.","tags":["gas","repricing","state","sstore","core"],"related":[2200,2929,7928],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7973/","markdown":"## 어떤 문제를 해결하나요?\n\n상태 트라이를 업데이트하는 일은 블록 처리에서 가장 비용이 큰 부분 중 하나입니다. 스토리지의 경우 같은 트랜잭션 안에서 같은 슬롯에 두 번째로 쓰는 것이 첫 번째보다 저렴하다는 점을 이더리움은 이미 인정하고 있습니다([EIP-2200](/eip-2200/)의 net metering). 하지만 계정 자체(nonce, 잔액, 코드 해시)에 대한 쓰기는 매번 같은 비용이 듭니다.\n\n이 때문에 이상한 인센티브가 생깁니다. 한 트랜잭션에서 같은 계정에 WETH를 여러 번 보내면 전송당 비용이 줄어들지만, 네이티브 ETH는 그렇지 않습니다. 이는 네이티브 ETH와 앞으로 가치를 이동시킬 모든 opcode에 불리합니다. 실제로는 한 트랜잭션에서 한 계정에 대한 모든 쓰기를 하나의 트라이 업데이트로 묶을 수 있으므로, 이후의 쓰기가 노드에 주는 부담은 첫 번째보다 훨씬 적습니다.\n\n## 어떻게 동작하나요?\n\n기존 파라미터 `GAS_CALL_VALUE`와 `GAS_STORAGE_UPDATE`는 제거되고 세 개의 새 파라미터로 대체됩니다(값은 아직 미정).\n\n| 파라미터 | 의미 |\n| --- | --- |\n| `GAS_COLD_ACCOUNT_WRITE` | 이 트랜잭션에서 계정에 대한 첫 번째 업데이트(계정 트라이) |\n| `GAS_COLD_STORAGE_WRITE` | 스토리지 슬롯에 대한 첫 번째 업데이트(스토리지 트라이) |\n| `GAS_WARM_WRITE` | 새로운 루트 계산을 일으키지 않는 이후의 모든 쓰기 |\n\n**가치를 이동시키는 호출과 생성**(`CALL` 계열, `CREATE`, `CREATE2`): 고정된 `GAS_CALL_VALUE` 대신, 계정이 트랜잭션 시작 시점의 값과 같으면 `GAS_COLD_ACCOUNT_WRITE`를, 그렇지 않으면 `GAS_WARM_WRITE`를 부과합니다.\n\n**`SSTORE`**는 두 부분으로 나뉩니다. 계정 튜플을 건드리는 비용(위와 같은 cold 또는 warm)과 슬롯 고유의 비용입니다. 스토리지에 쓰면 계정이 dirty 상태가 되므로, 같은 컨트랙트에 대한 두 번째 `SSTORE`는 warm 계정 부분만 지불합니다. 환급 로직도 이에 맞게 조정되며, 계정이 그 외에는 변경되지 않은 상태에서 슬롯이 원래 값으로 복원되면 cold 계정 쓰기 비용도 환급합니다.\n\n블록 수준 접근 목록(Block-Level Access Lists, [EIP-7928](/eip-7928/))과 병렬 실행과의 호환을 위해, 계정의 \"원래\" 값은 같은 블록에서 앞선 트랜잭션의 BAL 항목에서 가져올 수 있습니다.\n\n## 샘플 코드\n\n명세의 의사 코드를 단순화한, 계정 쓰기 부분의 부과 방식:\n\n```python\ndef account_write_cost(state, address) -\u003e int:\n    original = get_account_original(state, address)  # value at tx start\n    current = get_account(state, address)\n    if current != original:\n        return GAS_WARM_WRITE          # already dirtied in this tx\n    return GAS_COLD_ACCOUNT_WRITE      # first write: pays for the trie update\n```\n\n루프에서 ETH를 지급하는 컨트랙트에 미치는 영향(Solidity):\n\n```solidity\n// Under this EIP, paying the same recipient several times in one tx\n// costs the cold account write once, then the warm write for the rest.\nfor (uint256 i = 0; i \u003c n; i++) {\n    (bool ok, ) = recipient.call{value: amount}(\"\");\n    require(ok);\n}\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 세 개의 새 가스 값은 모두 상태 기반(stateful) 벤치마크를 거쳐 정해질 예정이라 미정이며, 실제로 얼마나 절약되는지는 아직 말할 수 없습니다.\n- 이는 하위 호환되지 않는 가격 재조정이며 네트워크 업그레이드가 필요합니다.\n- 지갑과 노드는 `eth_estimateGas`를 업데이트해야 합니다. 명세는 오래된 추정치가 문제를 일으킬 수 있다고 경고합니다.\n- 계정에 대한 net metering(트랜잭션이 끝났을 때 계정이 변경되지 않았다면 환급)도 검토되었으나 단순함을 위해 제외되었습니다.\n- 저자들은 계정 쓰기를 더 저렴하게 만들면 새로운 공격 경로가 열릴 수 있으며 추가 분석이 필요하다고 밝힙니다.\n"},"zh":{"lang":"zh","tldr":"让同一笔交易内对同一账户的重复写入在第一次之后更便宜，因为状态根只需重新计算一次，使原生 ETH 转账与代币转账的成本相当。","tags":["gas","repricing","state","sstore","core"],"related":[2200,2929,7928],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7973/","markdown":"## 它解决什么问题？\n\n更新状态树是处理区块中成本最高的环节之一。对于存储，以太坊已经承认同一笔交易内对同一槽位的第二次写入比第一次便宜（[EIP-2200](/eip-2200/) 的 net metering）。但对账户本身（其 nonce、余额或代码哈希）的写入，每次成本都一样。\n\n这造成了奇怪的激励。在一笔交易中多次向同一账户发送 WETH，每次转账的成本会降低，而发送原生 ETH 却不会。这对原生 ETH 以及未来任何转移价值的 opcode 都不公平。实际上，一笔交易中对同一账户的所有写入都可以合并为一次树更新，因此后续写入给节点带来的负担远低于第一次。\n\n## 它如何运作\n\n旧参数 `GAS_CALL_VALUE` 和 `GAS_STORAGE_UPDATE` 被移除，由三个新参数取代（具体数值仍待定）：\n\n| 参数 | 含义 |\n| --- | --- |\n| `GAS_COLD_ACCOUNT_WRITE` | 本交易中对账户的首次更新（账户树） |\n| `GAS_COLD_STORAGE_WRITE` | 对存储槽位的首次更新（存储树） |\n| `GAS_WARM_WRITE` | 不会触发新根计算的后续写入 |\n\n**转移价值的调用与创建**（`CALL` 系列、`CREATE`、`CREATE2`）：不再收取固定的 `GAS_CALL_VALUE`，而是在账户仍等于交易开始时的值时收取 `GAS_COLD_ACCOUNT_WRITE`，否则收取 `GAS_WARM_WRITE`。\n\n**`SSTORE`** 被拆分为两部分：触及账户元组的成本（如上所述的 cold 或 warm）加上槽位本身的成本。存储写入会使账户变脏（dirty），因此对同一合约的第二次 `SSTORE` 只需支付 warm 的账户部分。退款逻辑也相应调整，包括当槽位恢复为原始值且账户在其他方面未被修改时，退还 cold 账户写入的费用。\n\n为了兼容区块级访问列表（Block-Level Access Lists，[EIP-7928](/eip-7928/)）和并行执行，账户的\"原始\"值可以取自同一区块中更早交易的 BAL 条目。\n\n## 示例代码\n\n收费中账户写入的部分，由规范的伪代码简化而来：\n\n```python\ndef account_write_cost(state, address) -\u003e int:\n    original = get_account_original(state, address)  # value at tx start\n    current = get_account(state, address)\n    if current != original:\n        return GAS_WARM_WRITE          # already dirtied in this tx\n    return GAS_COLD_ACCOUNT_WRITE      # first write: pays for the trie update\n```\n\n对循环中支付 ETH 的合约的影响（Solidity）：\n\n```solidity\n// Under this EIP, paying the same recipient several times in one tx\n// costs the cold account write once, then the warm write for the rest.\nfor (uint256 i = 0; i \u003c n; i++) {\n    (bool ok, ) = recipient.call{value: amount}(\"\");\n    require(ok);\n}\n```\n\n## 需要注意\n\n- **状态：Draft。** 三个新的 gas 值都有待有状态基准测试后确定，因此目前还无法给出实际的节省幅度。\n- 这是一次不向后兼容的重新定价，需要网络升级。\n- 钱包和节点必须更新 `eth_estimateGas`；规范警告说，过时的估算可能引发问题。\n- 账户的 net metering（账户在交易结束时未变化则退款）曾被考虑，但为简单起见而省略。\n- 作者指出，更便宜的账户写入可能带来新的攻击面，需要进一步分析。\n"}},"requiredBy":[8007]}
