{"eip":2045,"title":"Particle gas costs for EVM opcodes","description":"According to recent benchmarks, EVM opcodes for computation (ADD, SUB, MUL, etc.) are generally overpriced relative to opcodes for storage I/O (SLOAD, SSTORE, etc.). Currently the minimum gas cost is 1 (i.e. one unit of gas), and most computational opcodes have a cost near to 1 (e.g.","authors":["Casey Detrio (@cdetrio)","Alex Beregszaszi (@axic)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2019-05-17","discussionsTo":"https://ethereum-magicians.org/t/eip-2045-fractional-gas-costs/3311","repo":"EIPs","label":"EIP-2045","officialUrl":"https://eips.ethereum.org/EIPS/eip-2045","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2045.md","url":"https://eips.huatuo.xyz/eip-2045/","tldr":{"en":"Proposed a sub-gas unit called the particle (1 gas = 10,000 particles) so cheap computational opcodes like ADD and DUP could be priced below 1 gas.","ja":"パーティクルというガスより小さい単位（1 ガス = 10,000 パーティクル）を導入し、ADD や DUP のような安価な計算オペコードを 1 ガス未満で価格設定できるようにする提案。","ko":"파티클이라는 가스보다 작은 단위(1 가스 = 10,000 파티클)를 제안해, ADD나 DUP 같은 저렴한 연산 opcode의 가격을 1 가스 미만으로 매길 수 있게 했다.","zh":"提议引入一个比 gas 更小的单位，称为 particle（1 gas = 10,000 particles），使 ADD、DUP 等廉价的计算类 opcode 的价格可以低于 1 gas。"},"tags":["gas","evm","opcodes","pricing","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed a sub-gas unit called the particle (1 gas = 10,000 particles) so cheap computational opcodes like ADD and DUP could be priced below 1 gas.","tags":["gas","evm","opcodes","pricing","core"],"related":[2035,1884,2929],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2045/","markdown":"## What problem does it solve?\n\nBenchmarks of optimised EVM implementations suggested that pure computation (`ADD`, `MUL`, `DUP`, `SWAP`…) is overpriced compared with storage access (`SLOAD`, `SSTORE`). Making computation cheaper would let more transactions fit in a block without raising the gas limit, which would also speed up state growth.\n\nBut there is little room to cut: the minimum cost is 1 gas and these opcodes already cost 2–8 gas. You cannot make `DUP` 10× cheaper when it costs 3.\n\nEIP-2045 introduces a finer unit so costs can go below 1 gas.\n\n## How it works\n\n- A new counter `particlesUsed` runs alongside `gasUsed`. **1 gas = 10,000 particles** (`PARTICLES_PER_GAS`).\n- Opcodes priced in particles add to `particlesUsed`. Whenever it reaches 10,000, one gas is moved into `gasUsed` and the remainder stays in the particle counter.\n- Opcodes priced in whole gas work as before.\n- Suggested new prices from the spec: `DUP`/`SWAP` 3 gas → 3,000 particles (0.3 gas); `ADD`/`SUB` 3 gas → 6,000 particles; `MUL` 5 gas → 5,000 particles.\n\nParticles are an internal EVM detail. Transaction gas limits, block gas limits, headers and receipts all stay in whole gas, so users and most contract authors would not see them.\n\nThe spec notes a faster implementation could keep a single counter scaled by 10,000 and round up at the end, and that a power-of-two ratio (8192 or 16384) might be more efficient. The numbers were explicitly a draft.\n\n## Sample code\n\nThe core accounting loop, adapted from the spec:\n\n```python\nPARTICLES_PER_GAS = 10_000\n\ndef charge(state, opcode):\n    if opcode.gas_fee:\n        state.gas_used += opcode.gas_fee\n    elif opcode.particle_fee:\n        state.particles_used += opcode.particle_fee\n        if state.particles_used \u003e= PARTICLES_PER_GAS:\n            state.gas_used += 1\n            state.particles_used %= PARTICLES_PER_GAS\n    if state.gas_used \u003e state.gas_limit:\n        raise OutOfGas()\n\n# e.g. ten DUP1s at 3,000 particles each = 30,000 particles = 3 gas (vs 30 today)\n```\n\n## Things to know\n\n- Status is **Stagnant**; it was never scheduled for a hard fork. It would require one, as it changes gas accounting.\n- The \"particle\" name comes from earlier Ewasm gas-costing work, but this proposal is about the EVM, not Ewasm.\n- Instead of making computation cheaper, Ethereum mostly raised the cost of state access ([EIP-1884](/eip-1884/), [EIP-2929](/eip-2929/)) to correct the same imbalance.\n- [EIP-2035](/eip-2035/) is the related, also stagnant, proposal on repricing `SLOAD`/`SSTORE` for stateless clients.\n"},"ja":{"lang":"ja","tldr":"パーティクルというガスより小さい単位（1 ガス = 10,000 パーティクル）を導入し、ADD や DUP のような安価な計算オペコードを 1 ガス未満で価格設定できるようにする提案。","tags":["gas","evm","opcodes","pricing","core"],"related":[2035,1884,2929],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2045/","markdown":"## 何を解決するのか\n\n最適化された EVM 実装のベンチマークから、純粋な計算（`ADD`、`MUL`、`DUP`、`SWAP` など）はストレージアクセス（`SLOAD`、`SSTORE`）に比べて割高だと示唆されました。計算を安くすれば、ガスリミットを上げずにブロックへ多くのトランザクションを収められ、ステートの肥大化も加速します。\n\nしかし下げる余地はほとんどありません。最小コストは 1 ガスで、これらのオペコードはすでに 2〜8 ガスです。3 ガスの `DUP` を 10 分の 1 にはできません。\n\nEIP-2045 はより細かい単位を導入し、コストを 1 ガス未満にできるようにします。\n\n## 仕組み\n\n- 新しいカウンター `particlesUsed` が `gasUsed` と並行して動きます。**1 ガス = 10,000 パーティクル**（`PARTICLES_PER_GAS`）です。\n- パーティクルで価格設定されたオペコードは `particlesUsed` に加算されます。10,000 に達するたびに 1 ガスが `gasUsed` に移され、端数はパーティクルのカウンターに残ります。\n- ガス単位で価格設定されたオペコードは従来どおりです。\n- 仕様が示す新しい価格案: `DUP`/`SWAP` は 3 ガス → 3,000 パーティクル（0.3 ガス）、`ADD`/`SUB` は 3 ガス → 6,000 パーティクル、`MUL` は 5 ガス → 5,000 パーティクルです。\n\nパーティクルは EVM 内部の詳細です。トランザクションのガスリミット、ブロックのガスリミット、ヘッダー、レシートはすべて整数のガスのままなので、ユーザーやほとんどのコントラクト作者は目にしません。\n\n仕様は、より高速な実装として 10,000 倍にスケールした単一のカウンターを保持し、最後に切り上げる方法があること、また 2 のべき乗の比率（8192 や 16384）のほうが効率的かもしれないことにも触れています。数値は明示的にドラフトでした。\n\n## サンプルコード\n\n仕様を基にした、中核となる課金ループ:\n\n```python\nPARTICLES_PER_GAS = 10_000\n\ndef charge(state, opcode):\n    if opcode.gas_fee:\n        state.gas_used += opcode.gas_fee\n    elif opcode.particle_fee:\n        state.particles_used += opcode.particle_fee\n        if state.particles_used \u003e= PARTICLES_PER_GAS:\n            state.gas_used += 1\n            state.particles_used %= PARTICLES_PER_GAS\n    if state.gas_used \u003e state.gas_limit:\n        raise OutOfGas()\n\n# e.g. ten DUP1s at 3,000 particles each = 30,000 particles = 3 gas (vs 30 today)\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、ハードフォークに予定されたことはありません。ガス計算を変更するため、実現にはハードフォークが必要です。\n- 「パーティクル」という名前は以前の Ewasm のガスコスト設計に由来しますが、この提案は Ewasm ではなく EVM に関するものです。\n- 計算を安くする代わりに、Ethereum は同じ不均衡を是正するため、主にステートアクセスのコストを引き上げました（[EIP-1884](/eip-1884/)、[EIP-2929](/eip-2929/)）。\n- [EIP-2035](/eip-2035/) は、ステートレスクライアント向けに `SLOAD`/`SSTORE` の価格を見直す関連提案で、こちらも Stagnant です。\n"},"ko":{"lang":"ko","tldr":"파티클이라는 가스보다 작은 단위(1 가스 = 10,000 파티클)를 제안해, ADD나 DUP 같은 저렴한 연산 opcode의 가격을 1 가스 미만으로 매길 수 있게 했다.","tags":["gas","evm","opcodes","pricing","core"],"related":[2035,1884,2929],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2045/","markdown":"## 어떤 문제를 해결하나요?\n\n최적화된 EVM 구현의 벤치마크는 순수 연산(`ADD`, `MUL`, `DUP`, `SWAP` 등)이 스토리지 접근(`SLOAD`, `SSTORE`)에 비해 비싸게 책정되어 있음을 시사했습니다. 연산을 싸게 하면 가스 한도를 올리지 않고도 블록에 더 많은 트랜잭션을 담을 수 있고, 이는 상태 증가 속도도 높입니다.\n\n하지만 줄일 여지가 거의 없습니다. 최소 비용이 1 가스인데 이 opcode들은 이미 2~8 가스입니다. 3 가스인 `DUP`을 10배 싸게 만들 수는 없습니다.\n\nEIP-2045는 더 세밀한 단위를 도입해 비용이 1 가스 아래로 내려갈 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n- 새 카운터 `particlesUsed`가 `gasUsed`와 나란히 동작합니다. **1 가스 = 10,000 파티클**(`PARTICLES_PER_GAS`)입니다.\n- 파티클로 가격이 매겨진 opcode는 `particlesUsed`에 더해집니다. 10,000에 도달할 때마다 1 가스가 `gasUsed`로 옮겨지고 나머지는 파티클 카운터에 남습니다.\n- 정수 가스로 가격이 매겨진 opcode는 이전과 같이 동작합니다.\n- 사양이 제안한 새 가격: `DUP`/`SWAP`은 3 가스 → 3,000 파티클(0.3 가스), `ADD`/`SUB`은 3 가스 → 6,000 파티클, `MUL`은 5 가스 → 5,000 파티클입니다.\n\n파티클은 EVM 내부 구현 세부 사항입니다. 트랜잭션 가스 한도, 블록 가스 한도, 헤더, 영수증은 모두 정수 가스로 유지되므로 사용자와 대부분의 컨트랙트 작성자는 이를 보지 못합니다.\n\n사양은 더 빠른 구현으로 10,000배로 스케일한 카운터 하나를 유지하다가 마지막에 올림하는 방법이 있고, 2의 거듭제곱 비율(8192 또는 16384)이 더 효율적일 수 있다고도 언급합니다. 숫자는 명시적으로 초안이었습니다.\n\n## 샘플 코드\n\n사양을 바탕으로 한 핵심 가스 계산 루프:\n\n```python\nPARTICLES_PER_GAS = 10_000\n\ndef charge(state, opcode):\n    if opcode.gas_fee:\n        state.gas_used += opcode.gas_fee\n    elif opcode.particle_fee:\n        state.particles_used += opcode.particle_fee\n        if state.particles_used \u003e= PARTICLES_PER_GAS:\n            state.gas_used += 1\n            state.particles_used %= PARTICLES_PER_GAS\n    if state.gas_used \u003e state.gas_limit:\n        raise OutOfGas()\n\n# e.g. ten DUP1s at 3,000 particles each = 30,000 particles = 3 gas (vs 30 today)\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며 하드 포크에 예정된 적이 없습니다. 가스 계산 방식을 바꾸므로 도입하려면 하드 포크가 필요합니다.\n- \"파티클\"이라는 이름은 앞서 진행된 Ewasm 가스 비용 작업에서 왔지만, 이 제안은 Ewasm이 아니라 EVM에 관한 것입니다.\n- 이더리움은 연산을 싸게 하는 대신, 같은 불균형을 바로잡기 위해 주로 상태 접근 비용을 올렸습니다([EIP-1884](/eip-1884/), [EIP-2929](/eip-2929/)).\n- [EIP-2035](/eip-2035/)는 스테이트리스 클라이언트를 위해 `SLOAD`/`SSTORE` 가격을 재조정하자는 관련 제안으로, 이 역시 Stagnant입니다.\n"},"zh":{"lang":"zh","tldr":"提议引入一个比 gas 更小的单位，称为 particle（1 gas = 10,000 particles），使 ADD、DUP 等廉价的计算类 opcode 的价格可以低于 1 gas。","tags":["gas","evm","opcodes","pricing","core"],"related":[2035,1884,2929],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2045/","markdown":"## 它解决什么问题？\n\n对优化后的 EVM 实现做的基准测试表明，纯计算（`ADD`、`MUL`、`DUP`、`SWAP` 等）相对于存储访问（`SLOAD`、`SSTORE`）定价偏高。让计算更便宜，就能在不提高 gas 上限的情况下让更多交易装进区块，这也会加快状态增长。\n\n但可压缩的空间很小：最低成本是 1 gas，而这些 opcode 已经只要 2–8 gas。当 `DUP` 只要 3 gas 时，你不可能让它便宜 10 倍。\n\nEIP-2045 引入了更精细的单位，使成本可以低于 1 gas。\n\n## 它如何运作\n\n- 新增计数器 `particlesUsed`，与 `gasUsed` 并行运行。**1 gas = 10,000 particles**（`PARTICLES_PER_GAS`）。\n- 以 particle 计价的 opcode 累加到 `particlesUsed`。每当它达到 10,000，就把 1 gas 转入 `gasUsed`，余数留在 particle 计数器中。\n- 以整数 gas 计价的 opcode 与以前一样。\n- 规范建议的新价格：`DUP`/`SWAP` 从 3 gas 改为 3,000 particles（0.3 gas）；`ADD`/`SUB` 从 3 gas 改为 6,000 particles；`MUL` 从 5 gas 改为 5,000 particles。\n\nparticle 是 EVM 内部细节。交易 gas 上限、区块 gas 上限、区块头和收据都仍以整数 gas 表示，因此用户和大多数合约作者不会看到它们。\n\n规范指出，更快的实现可以只保留一个放大 10,000 倍的计数器，并在最后向上取整，而且 2 的幂比例（8192 或 16384）可能更高效。这些数字明确只是草案。\n\n## 示例代码\n\n核心计费循环，改编自规范：\n\n```python\nPARTICLES_PER_GAS = 10_000\n\ndef charge(state, opcode):\n    if opcode.gas_fee:\n        state.gas_used += opcode.gas_fee\n    elif opcode.particle_fee:\n        state.particles_used += opcode.particle_fee\n        if state.particles_used \u003e= PARTICLES_PER_GAS:\n            state.gas_used += 1\n            state.particles_used %= PARTICLES_PER_GAS\n    if state.gas_used \u003e state.gas_limit:\n        raise OutOfGas()\n\n# e.g. ten DUP1s at 3,000 particles each = 30,000 particles = 3 gas (vs 30 today)\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**；它从未被排入硬分叉。由于改变了 gas 计费方式，实施它需要一次硬分叉。\n- \"particle\" 这个名称来自早期的 Ewasm gas 计价工作，但本提案针对的是 EVM，而非 Ewasm。\n- 以太坊并没有让计算变便宜，而是主要提高了状态访问的成本（[EIP-1884](/eip-1884/)、[EIP-2929](/eip-2929/)），以纠正同样的失衡。\n- [EIP-2035](/eip-2035/) 是相关的提案，同样处于 Stagnant，内容是为无状态客户端重新定价 `SLOAD`/`SSTORE`。\n"}}}
