{"eip":1682,"title":"Storage Rent","description":"This EIP describes a scheme to charge for data in state, and 'archive' data which is no longer being paid for. It also describes how resurrection of 'archived' data happens.","authors":["Felix J Lange (@fjl)","Martin Holst Swende (@holiman)"],"status":"Withdrawn","type":"Standards Track","category":"Core","created":"2018-11-10","discussionsTo":"https://ethereum-magicians.org/t/storage-rent-eip/2357","repo":"EIPs","label":"EIP-1682","officialUrl":"https://eips.ethereum.org/EIPS/eip-1682","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1682.md","url":"https://eips.huatuo.xyz/eip-1682/","tldr":{"en":"A withdrawn proposal to charge accounts ongoing rent for the state they occupy, deactivating those that stop paying and letting anyone restore them later.","ja":"撤回された提案。アカウントが占有する状態に対して継続的な賃料を課し、支払いを止めたアカウントは無効化し、後から誰でも復元できるようにする。","ko":"철회된 제안. 계정이 차지하는 상태에 지속적으로 임대료를 부과하고, 내지 않는 계정은 비활성화하며, 나중에 누구나 복원할 수 있게 한다.","zh":"已撤回的提案：对账户占用的状态持续收取租金，停止缴费的账户会被停用，之后任何人都可以将其恢复。"},"tags":["state","rent","storage","core","withdrawn"],"explainers":{"en":{"lang":"en","tldr":"A withdrawn proposal to charge accounts ongoing rent for the state they occupy, deactivating those that stop paying and letting anyone restore them later.","tags":["state","rent","storage","core","withdrawn"],"related":[4444,4762],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1682/","markdown":"## What problem does it solve?\n\nEvery account and storage slot ever written to Ethereum must be kept by every full node forever. Users pay once, when they write data, but the network bears the storage cost indefinitely. The authors argued that this unbounded growth is not sustainable and that the protocol needed a hard upper bound on state size.\n\nEIP-1682 proposed **storage rent**: accounts pay continuously for the space they use, and accounts that stop paying are removed from active state but can be resurrected.\n\n## How it works\n\n**Accounts gain three fields:**\n\n```text\naccount = [nonce, balance, storageroot, codehash, rentbalance, rentblock, storagesize]\n```\n\n- `rentbalance`: ether set aside specifically for rent.\n- `rentblock`: last block at which rent was settled.\n- `storagesize`: number of storage slots in use.\n\n**Charging rent.** When a block modifies an account, rent is computed for the blocks since `rentblock` in proportion to `storagesize`, taken first from `rentbalance` then from the regular balance, and **burned**. The per-slot fee rises as total state approaches a constant `MAX_STORAGE_SIZE = 2**32` trie nodes, so rent gets steeper as the chain fills up.\n\n**Inactive accounts.** An account that cannot pay becomes *inactive*: its code and storage are removed and it behaves as if it has no code.\n\n**New opcodes:**\n\n| Opcode | Effect |\n| --- | --- |\n| `PAYRENT amount addr` | Move ether from the caller into `addr`'s rent balance (anyone can pay for anyone) |\n| `RENTBALANCE addr` | Push `addr`'s rent balance |\n| `SSIZE addr` | Push `addr`'s storage size |\n| `RESTORETO addr codeaddr` | Restore an inactive account from a contract whose storage root matches it |\n\nTo restore account A, you deploy a new contract B, rebuild A's exact storage with `SSTORE`s, then call `RESTORETO`. The cost of restoring therefore equals the cost of recreating the data.\n\nA separate rent balance exists because some contracts reject plain ether transfers, or track their balance precisely (e.g. crowdfunding), and must not have rent deducted from it.\n\n## Sample code\n\nThe rent calculation from the spec (Python pseudocode):\n\n```python\nMAX_STORAGE_SIZE = 2**32\n\ndef storagefee_factor(block):\n    ramp = MAX_STORAGE_SIZE / (MAX_STORAGE_SIZE - total_storage_size(block))\n    return 2**22 * ramp\n\ndef charge_rent(prestate, poststate, addr, currentblock):\n    fee = rent(prestate, poststate, addr, currentblock)\n    if fee \u003c= poststate[addr].rentbalance:\n        poststate[addr].rentbalance -= fee\n    else:\n        fee -= poststate[addr].rentbalance\n        poststate[addr].rentbalance = 0\n        poststate[addr].balance -= min(poststate[addr].balance, fee)\n    poststate[addr].rentblock = currentblock\n```\n\n## Things to know\n\n- **Status: Withdrawn.** Storage rent was never adopted on Ethereum, and several gas costs (`PAYRENT`, `RESTORETO`) were left \"TBD\".\n- Rent breaks a basic expectation that contract storage persists forever; restoration was meant to soften this, but restoring requires someone to still have the full data.\n- Accounts are only charged when touched, so idle accounts would not be removed automatically; the spec accepts this to avoid tracking every account.\n- Ethereum's state-growth work later moved in other directions, such as history expiry ([EIP-4444](/eip-4444/)) and stateless clients with Verkle-style gas changes ([EIP-4762](/eip-4762/)).\n"},"ja":{"lang":"ja","tldr":"撤回された提案。アカウントが占有する状態に対して継続的な賃料を課し、支払いを止めたアカウントは無効化し、後から誰でも復元できるようにする。","tags":["state","rent","storage","core","withdrawn"],"related":[4444,4762],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1682/","markdown":"## 何を解決するのか\n\nEthereum に書き込まれたすべてのアカウントとストレージスロットは、すべてのフルノードが永遠に保持しなければなりません。ユーザーはデータを書き込むときに一度だけ支払いますが、ストレージのコストはネットワークが無期限に負担します。著者らは、この際限のない増大は持続可能ではなく、プロトコルには状態サイズの厳格な上限が必要だと主張しました。\n\nEIP-1682 は**ストレージレント（storage rent）**を提案しました。アカウントは使用する容量に対して継続的に支払い、支払いを止めたアカウントはアクティブな状態から取り除かれますが、復活させることができます。\n\n## 仕組み\n\n**アカウントに 3 つのフィールドが加わります。**\n\n```text\naccount = [nonce, balance, storageroot, codehash, rentbalance, rentblock, storagesize]\n```\n\n- `rentbalance`: 賃料のために特別に確保された ether。\n- `rentblock`: 賃料が最後に精算されたブロック。\n- `storagesize`: 使用中のストレージスロットの数。\n\n**賃料の徴収。** ブロックがアカウントを変更すると、`rentblock` 以降のブロック分の賃料が `storagesize` に比例して計算され、まず `rentbalance` から、次に通常の残高から引かれ、**バーン**されます。スロットあたりの料金は、状態全体が定数 `MAX_STORAGE_SIZE = 2**32` のトライノードに近づくほど上がるため、チェーンが埋まるにつれて賃料は急になります。\n\n**非アクティブなアカウント。** 支払えないアカウントは*非アクティブ*になります。コードとストレージは削除され、コードを持たないかのように振る舞います。\n\n**新しいオペコード:**\n\n| オペコード | 効果 |\n| --- | --- |\n| `PAYRENT amount addr` | 呼び出し元から `addr` の賃料残高へ ether を移す（誰でも誰の分でも支払える） |\n| `RENTBALANCE addr` | `addr` の賃料残高をプッシュする |\n| `SSIZE addr` | `addr` のストレージサイズをプッシュする |\n| `RESTORETO addr codeaddr` | ストレージルートが一致するコントラクトから、非アクティブなアカウントを復元する |\n\nアカウント A を復元するには、新しいコントラクト B をデプロイし、`SSTORE` で A とまったく同じストレージを再構築してから `RESTORETO` を呼び出します。したがって復元のコストは、データを作り直すコストに等しくなります。\n\n賃料用の残高が別に存在するのは、通常の ether 送金を拒否するコントラクトや、残高を厳密に追跡するコントラクト（たとえばクラウドファンディング）があり、それらの残高から賃料を差し引いてはならないためです。\n\n## サンプルコード\n\n仕様にある賃料の計算です（Python の疑似コード）。\n\n```python\nMAX_STORAGE_SIZE = 2**32\n\ndef storagefee_factor(block):\n    ramp = MAX_STORAGE_SIZE / (MAX_STORAGE_SIZE - total_storage_size(block))\n    return 2**22 * ramp\n\ndef charge_rent(prestate, poststate, addr, currentblock):\n    fee = rent(prestate, poststate, addr, currentblock)\n    if fee \u003c= poststate[addr].rentbalance:\n        poststate[addr].rentbalance -= fee\n    else:\n        fee -= poststate[addr].rentbalance\n        poststate[addr].rentbalance = 0\n        poststate[addr].balance -= min(poststate[addr].balance, fee)\n    poststate[addr].rentblock = currentblock\n```\n\n## 知っておくべきこと\n\n- **ステータス: Withdrawn。** ストレージレントは Ethereum で採用されることはなく、いくつかの gas コスト（`PAYRENT`、`RESTORETO`）は「TBD」のままでした。\n- 賃料は、コントラクトのストレージが永遠に残るという基本的な期待を壊します。復元はこれを和らげるためのものでしたが、復元するには誰かが完全なデータをまだ持っている必要があります。\n- アカウントに課金されるのは触れられたときだけなので、使われていないアカウントは自動的には取り除かれません。仕様は、すべてのアカウントを追跡しなくて済むようにこれを受け入れています。\n- Ethereum の状態増大への取り組みは、その後、履歴の期限切れ（[EIP-4444](/eip-4444/)）や、Verkle 方式の gas 変更を伴うステートレスクライアント（[EIP-4762](/eip-4762/)）など、別の方向に進みました。\n"},"ko":{"lang":"ko","tldr":"철회된 제안. 계정이 차지하는 상태에 지속적으로 임대료를 부과하고, 내지 않는 계정은 비활성화하며, 나중에 누구나 복원할 수 있게 한다.","tags":["state","rent","storage","core","withdrawn"],"related":[4444,4762],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1682/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움에 기록된 모든 계정과 스토리지 슬롯은 모든 풀 노드가 영원히 보관해야 합니다. 사용자는 데이터를 쓸 때 한 번만 비용을 내지만, 스토리지 비용은 네트워크가 무기한 부담합니다. 저자들은 이런 무한한 증가는 지속 가능하지 않으며, 프로토콜에 상태 크기의 엄격한 상한이 필요하다고 주장했습니다.\n\nEIP-1682는 **스토리지 렌트(storage rent)**를 제안했습니다. 계정은 사용하는 공간에 대해 계속 비용을 내고, 비용을 내지 않는 계정은 활성 상태에서 제거되지만 되살릴 수 있습니다.\n\n## 어떻게 동작하나요?\n\n**계정에 세 필드가 추가됩니다.**\n\n```text\naccount = [nonce, balance, storageroot, codehash, rentbalance, rentblock, storagesize]\n```\n\n- `rentbalance`: 임대료를 위해 따로 떼어 둔 이더.\n- `rentblock`: 임대료가 마지막으로 정산된 블록.\n- `storagesize`: 사용 중인 스토리지 슬롯 수.\n\n**임대료 징수.** 블록이 계정을 수정하면 `rentblock` 이후의 블록에 대한 임대료가 `storagesize`에 비례해 계산되고, 먼저 `rentbalance`에서, 그다음 일반 잔액에서 차감되어 **소각**됩니다. 슬롯당 요금은 전체 상태가 상수 `MAX_STORAGE_SIZE = 2**32` 트라이 노드에 가까워질수록 올라가므로, 체인이 찰수록 임대료가 가팔라집니다.\n\n**비활성 계정.** 낼 수 없는 계정은 *비활성*이 됩니다. 코드와 스토리지가 제거되고 코드가 없는 것처럼 동작합니다.\n\n**새 opcode:**\n\n| Opcode | 효과 |\n| --- | --- |\n| `PAYRENT amount addr` | 호출자에서 `addr`의 임대료 잔액으로 이더를 옮김(누구나 누구를 위해서든 낼 수 있음) |\n| `RENTBALANCE addr` | `addr`의 임대료 잔액을 푸시 |\n| `SSIZE addr` | `addr`의 스토리지 크기를 푸시 |\n| `RESTORETO addr codeaddr` | 스토리지 루트가 일치하는 컨트랙트로 비활성 계정을 복원 |\n\n계정 A를 복원하려면 새 컨트랙트 B를 배포하고, `SSTORE`로 A와 똑같은 스토리지를 다시 구성한 뒤 `RESTORETO`를 호출합니다. 따라서 복원 비용은 데이터를 다시 만드는 비용과 같습니다.\n\n임대료 잔액이 따로 있는 이유는, 일반 이더 전송을 거부하거나 잔액을 정확히 추적하는(예: 크라우드펀딩) 컨트랙트가 있어 그 잔액에서 임대료가 차감되어서는 안 되기 때문입니다.\n\n## 샘플 코드\n\n명세에 나온 임대료 계산입니다(Python 의사 코드).\n\n```python\nMAX_STORAGE_SIZE = 2**32\n\ndef storagefee_factor(block):\n    ramp = MAX_STORAGE_SIZE / (MAX_STORAGE_SIZE - total_storage_size(block))\n    return 2**22 * ramp\n\ndef charge_rent(prestate, poststate, addr, currentblock):\n    fee = rent(prestate, poststate, addr, currentblock)\n    if fee \u003c= poststate[addr].rentbalance:\n        poststate[addr].rentbalance -= fee\n    else:\n        fee -= poststate[addr].rentbalance\n        poststate[addr].rentbalance = 0\n        poststate[addr].balance -= min(poststate[addr].balance, fee)\n    poststate[addr].rentblock = currentblock\n```\n\n## 알아둘 점\n\n- **상태: Withdrawn.** 스토리지 렌트는 이더리움에 채택된 적이 없으며, 일부 gas 비용(`PAYRENT`, `RESTORETO`)은 \"TBD\"로 남았습니다.\n- 임대료는 컨트랙트 스토리지가 영원히 유지된다는 기본 기대를 깨뜨립니다. 복원은 이를 완화하려는 것이었지만, 복원하려면 누군가 전체 데이터를 여전히 갖고 있어야 합니다.\n- 계정은 건드려질 때만 요금이 부과되므로 유휴 계정은 자동으로 제거되지 않습니다. 명세는 모든 계정을 추적하지 않기 위해 이를 받아들입니다.\n- 이더리움의 상태 증가 대응 작업은 이후 히스토리 만료([EIP-4444](/eip-4444/))나 Verkle 방식 gas 변경을 동반한 스테이트리스 클라이언트([EIP-4762](/eip-4762/)) 등 다른 방향으로 옮겨 갔습니다.\n"},"zh":{"lang":"zh","tldr":"已撤回的提案：对账户占用的状态持续收取租金，停止缴费的账户会被停用，之后任何人都可以将其恢复。","tags":["state","rent","storage","core","withdrawn"],"related":[4444,4762],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1682/","markdown":"## 它解决什么问题？\n\n写入以太坊的每一个账户和存储槽，都必须被每个全节点永久保存。用户在写入数据时只付一次费，但存储成本却由网络无限期地承担。作者认为这种无限制的增长不可持续，协议需要对状态大小设置一个硬性上限。\n\nEIP-1682 提出了**存储租金（storage rent）**：账户为其使用的空间持续付费，停止付费的账户会被移出活跃状态，但可以复活。\n\n## 它如何运作\n\n**账户新增三个字段：**\n\n```text\naccount = [nonce, balance, storageroot, codehash, rentbalance, rentblock, storagesize]\n```\n\n- `rentbalance`：专门为租金预留的以太币。\n- `rentblock`：上一次结算租金的区块。\n- `storagesize`：正在使用的存储槽数量。\n\n**收取租金。** 当区块修改某个账户时，会按自 `rentblock` 以来经过的区块数、与 `storagesize` 成比例地计算租金，先从 `rentbalance` 中扣，再从普通余额中扣，并将其**销毁**。随着总状态接近常量 `MAX_STORAGE_SIZE = 2**32` 个 trie 节点，每个存储槽的费用会上升，因此链越满，租金越陡。\n\n**停用账户。** 无法支付的账户会变为*停用*状态：它的代码和存储被移除，表现得就像没有代码一样。\n\n**新操作码：**\n\n| 操作码 | 作用 |\n| --- | --- |\n| `PAYRENT amount addr` | 把以太币从调用者转入 `addr` 的租金余额（任何人都可以为任何人付费） |\n| `RENTBALANCE addr` | 压入 `addr` 的租金余额 |\n| `SSIZE addr` | 压入 `addr` 的存储大小 |\n| `RESTORETO addr codeaddr` | 用存储根与之匹配的合约来恢复一个停用账户 |\n\n要恢复账户 A，你需要部署一个新合约 B，用 `SSTORE` 重建 A 的完全相同的存储，然后调用 `RESTORETO`。因此，恢复的成本等于重新创建这些数据的成本。\n\n之所以另设租金余额，是因为有些合约会拒绝普通的以太币转账，或精确追踪自己的余额（例如众筹），不能从中扣除租金。\n\n## 示例代码\n\n规范中的租金计算（Python 伪代码）：\n\n```python\nMAX_STORAGE_SIZE = 2**32\n\ndef storagefee_factor(block):\n    ramp = MAX_STORAGE_SIZE / (MAX_STORAGE_SIZE - total_storage_size(block))\n    return 2**22 * ramp\n\ndef charge_rent(prestate, poststate, addr, currentblock):\n    fee = rent(prestate, poststate, addr, currentblock)\n    if fee \u003c= poststate[addr].rentbalance:\n        poststate[addr].rentbalance -= fee\n    else:\n        fee -= poststate[addr].rentbalance\n        poststate[addr].rentbalance = 0\n        poststate[addr].balance -= min(poststate[addr].balance, fee)\n    poststate[addr].rentblock = currentblock\n```\n\n## 需要注意\n\n- **状态：Withdrawn。** 存储租金从未在以太坊上被采纳，若干 gas 成本（`PAYRENT`、`RESTORETO`）也一直是“TBD”。\n- 租金打破了合约存储永久保存这一基本预期；恢复机制本想缓和这一点，但恢复需要有人仍然持有完整的数据。\n- 账户只有在被触及时才会被收费，所以闲置账户不会被自动移除；规范接受这一点，以避免追踪每一个账户。\n- 以太坊在状态增长方面的工作后来转向了其他方向，例如历史过期（[EIP-4444](/eip-4444/)）以及带有 Verkle 式 gas 改动的无状态客户端（[EIP-4762](/eip-4762/)）。\n"}}}
