{"eip":7623,"title":"Increase calldata cost","description":"Increase calldata cost to reduce maximum block size","authors":["Toni Wahrstätter (@nerolation)","Vitalik Buterin (@vbuterin)"],"status":"Final","type":"Standards Track","category":"Core","created":"2024-02-13","discussionsTo":"https://ethereum-magicians.org/t/eip-7623-increase-calldata-cost/18647","repo":"EIPs","label":"EIP-7623","officialUrl":"https://eips.ethereum.org/EIPS/eip-7623","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7623.md","url":"https://eips.huatuo.xyz/eip-7623/","tldr":{"en":"Adds a calldata floor price of 10/40 gas per zero/non-zero byte for data-heavy transactions, shrinking Ethereum's worst-case block size while leaving normal transactions' costs unchanged.","ja":"データ量の多いトランザクションに、ゼロバイト / 非ゼロバイトごとに 10 / 40 ガスの calldata 下限価格を加え、通常のトランザクションのコストは変えずに、Ethereum の最悪ケースのブロックサイズを小さくする。","ko":"데이터 비중이 큰 트랜잭션에 제로/논제로 바이트당 10/40 gas의 calldata 하한 가격을 도입해, 일반 트랜잭션 비용은 그대로 두면서 이더리움의 최악의 경우 블록 크기를 줄인다.","zh":"为数据量大的交易设定 calldata 价格下限（零字节/非零字节分别为 10/40 gas），缩小以太坊最坏情况下的区块大小，同时保持普通交易的成本不变。"},"tags":["gas","calldata","block-size","core","pectra"],"explainers":{"en":{"lang":"en","tldr":"Adds a calldata floor price of 10/40 gas per zero/non-zero byte for data-heavy transactions, shrinking Ethereum's worst-case block size while leaving normal transactions' costs unchanged.","tags":["gas","calldata","block-size","core","pectra"],"related":[2028,4844,1559,7976,3860],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7623/","markdown":"## What problem does it solve?\n\nCalldata has cost 4 gas per zero byte and 16 per non-zero byte since [EIP-2028](/eip-2028/). Average blocks are small (around 100 KB per the spec), but a block stuffed with calldata could reach about 1.79 MB, or 7.15 MB with zero bytes before compression. Clients and the network have to be ready for that worst case, which blocks raising the gas limit or adding more blobs.\n\nSince [EIP-4844](/eip-4844/), rollups have a dedicated, cheaper place for data: blobs. There is little reason left for calldata to be the cheap way to post bulk data, so EIP-7623 makes data-heavy transactions pay more without touching ordinary users.\n\n## How it works\n\nCalldata is counted in tokens: `tokens = zero_bytes + nonzero_bytes * 4`.\n\nThe gas used by a transaction becomes the larger of two numbers (on top of the base 21,000):\n\n- the normal cost: `4 * tokens + execution gas (+ creation costs)`, and\n- a floor: `10 * tokens`.\n\nIn other words, a transaction pays the floor of 10/40 gas per byte only if its calldata dominates its execution. A typical swap, transfer or mint spends enough on EVM execution that the floor never applies, so it pays exactly what it did before. A transaction that is mostly data, like a rollup posting batches in calldata, pays up to 2.5× more.\n\nThe floor must be covered by the gas limit up front: a transaction is invalid if its gas limit is below `21000 + 10 * tokens` (or below the usual intrinsic gas). Per the spec, this cuts the maximum execution payload size to roughly 0.72 MB.\n\n## Sample code\n\nThe new gas-used formula from the spec:\n\n```python\nSTANDARD_TOKEN_COST = 4\nTOTAL_COST_FLOOR_PER_TOKEN = 10\n\ntokens_in_calldata = zero_bytes + nonzero_bytes * 4\n\ntx_gas_used = 21000 + max(\n    STANDARD_TOKEN_COST * tokens_in_calldata\n    + execution_gas_used\n    + is_contract_creation * (32000 + INITCODE_WORD_COST * words(calldata)),\n    TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,\n)\n```\n\nChecking the minimum gas limit for a payload (TypeScript):\n\n```ts\nimport { getBytes } from \"ethers\";\n\nfunction floorGasLimit(data: string): bigint {\n  const bytes = getBytes(data);\n  const zeros = bytes.filter((b) =\u003e b === 0).length;\n  const tokens = BigInt(zeros + (bytes.length - zeros) * 4);\n  return 21000n + 10n * tokens;\n}\n```\n\n## Things to know\n\n- Status is Final; it went live on Ethereum mainnet in the Pectra upgrade.\n- Wallets and RPC `eth_estimateGas` must account for the floor. An estimate that ignores it can produce a gas limit that makes the transaction invalid.\n- Because `execution_gas_used` is after refunds, transactions that rely on large refunds can hit the floor.\n- Rollups that still post data as calldata pay more; blobs are the intended path.\n- [EIP-7976](/eip-7976/) proposes raising the floor further.\n"},"ja":{"lang":"ja","tldr":"データ量の多いトランザクションに、ゼロバイト / 非ゼロバイトごとに 10 / 40 ガスの calldata 下限価格を加え、通常のトランザクションのコストは変えずに、Ethereum の最悪ケースのブロックサイズを小さくする。","tags":["gas","calldata","block-size","core","pectra"],"related":[2028,4844,1559,7976,3860],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7623/","markdown":"## 何を解決するのか\n\ncalldata のコストは、[EIP-2028](/eip-2028/) 以来、ゼロバイトあたり 4 ガス、非ゼロバイトあたり 16 ガスです。平均的なブロックは小さい（仕様では約 100 KB）ものの、calldata で埋め尽くしたブロックは約 1.79 MB に達し得ます。圧縮前のゼロバイトなら 7.15 MB です。クライアントとネットワークはこの最悪ケースに備えなければならず、それがガスリミットの引き上げや blob の追加の妨げになっています。\n\n[EIP-4844](/eip-4844/) 以降、ロールアップには、データ用の専用で安価な場所である blob があります。大量のデータを投稿する安い手段が calldata である理由はほとんどなくなったため、EIP-7623 は、一般ユーザーには手を触れずに、データ量の多いトランザクションにより多く支払わせます。\n\n## 仕組み\n\ncalldata はトークン単位で数えます。`tokens = zero_bytes + nonzero_bytes * 4`。\n\nトランザクションが使用するガスは、（基本の 21,000 に加えて）次の 2 つの数値のうち大きい方になります。\n\n- 通常のコスト: `4 * tokens + execution gas (+ creation costs)`\n- 下限: `10 * tokens`\n\n言い換えると、トランザクションが 1 バイトあたり 10 / 40 ガスの下限を支払うのは、calldata が実行よりも支配的な場合だけです。典型的なスワップ、送金、ミントは EVM の実行に十分なガスを使うため、下限が適用されることはなく、これまでとまったく同じ金額を支払います。calldata でバッチを投稿するロールアップのような、大半がデータのトランザクションは、最大で 2.5 倍多く支払います。\n\n下限は、ガスリミットで事前に賄われなければなりません。ガスリミットが `21000 + 10 * tokens`（または通常の固有ガス）を下回るトランザクションは無効です。仕様によると、これにより実行ペイロードの最大サイズは約 0.72 MB まで削減されます。\n\n## サンプルコード\n\n仕様にある新しいガス使用量の式:\n\n```python\nSTANDARD_TOKEN_COST = 4\nTOTAL_COST_FLOOR_PER_TOKEN = 10\n\ntokens_in_calldata = zero_bytes + nonzero_bytes * 4\n\ntx_gas_used = 21000 + max(\n    STANDARD_TOKEN_COST * tokens_in_calldata\n    + execution_gas_used\n    + is_contract_creation * (32000 + INITCODE_WORD_COST * words(calldata)),\n    TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,\n)\n```\n\nペイロードに必要な最小ガスリミットを確認する（TypeScript）:\n\n```ts\nimport { getBytes } from \"ethers\";\n\nfunction floorGasLimit(data: string): bigint {\n  const bytes = getBytes(data);\n  const zeros = bytes.filter((b) =\u003e b === 0).length;\n  const tokens = BigInt(zeros + (bytes.length - zeros) * 4);\n  return 21000n + 10n * tokens;\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは Final で、Pectra アップグレードで Ethereum メインネットに導入されました。\n- ウォレットと RPC の `eth_estimateGas` は下限を考慮しなければなりません。それを無視した見積もりは、トランザクションを無効にするガスリミットを生み出す可能性があります。\n- `execution_gas_used` はリファンド後の値なので、大きなリファンドに頼るトランザクションは下限に達することがあります。\n- 今も calldata でデータを投稿しているロールアップはより多く支払います。blob が想定された経路です。\n- [EIP-7976](/eip-7976/) は、下限をさらに引き上げることを提案しています。\n"},"ko":{"lang":"ko","tldr":"데이터 비중이 큰 트랜잭션에 제로/논제로 바이트당 10/40 gas의 calldata 하한 가격을 도입해, 일반 트랜잭션 비용은 그대로 두면서 이더리움의 최악의 경우 블록 크기를 줄인다.","tags":["gas","calldata","block-size","core","pectra"],"related":[2028,4844,1559,7976,3860],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7623/","markdown":"## 어떤 문제를 해결하나요?\n\ncalldata 비용은 [EIP-2028](/eip-2028/) 이후 제로 바이트당 4 gas, 논제로 바이트당 16 gas입니다. 평균적인 블록은 작지만(명세에 따르면 약 100 KB), calldata로 가득 채운 블록은 약 1.79 MB, 압축 전 제로 바이트로 채우면 7.15 MB에 이를 수 있습니다. 클라이언트와 네트워크는 이 최악의 경우에 대비해야 하며, 이것이 gas 한도를 올리거나 blob을 더 늘리는 데 걸림돌이 됩니다.\n\n[EIP-4844](/eip-4844/) 이후 롤업에는 데이터를 위한 전용의 더 저렴한 공간인 blob이 생겼습니다. 대량의 데이터를 올리는 저렴한 방법이 calldata여야 할 이유가 거의 없어졌으므로, EIP-7623은 일반 사용자는 건드리지 않고 데이터 비중이 큰 트랜잭션이 더 많이 내도록 합니다.\n\n## 어떻게 동작하나요?\n\ncalldata는 토큰 단위로 셉니다. `tokens = zero_bytes + nonzero_bytes * 4`.\n\n트랜잭션이 사용하는 gas는 (기본 21,000에 더해) 다음 두 값 중 큰 쪽이 됩니다.\n\n- 일반 비용: `4 * tokens + execution gas (+ creation costs)`, 그리고\n- 하한: `10 * tokens`.\n\n다시 말해 트랜잭션은 calldata가 실행보다 지배적일 때만 바이트당 10/40 gas의 하한을 냅니다. 일반적인 스왑, 전송, 민팅은 EVM 실행에 충분한 gas를 쓰므로 하한이 적용되지 않으며, 이전과 똑같은 금액을 냅니다. calldata로 배치를 올리는 롤업처럼 대부분이 데이터인 트랜잭션은 최대 2.5배를 더 냅니다.\n\n하한은 gas 한도에서 미리 충당되어야 합니다. gas 한도가 `21000 + 10 * tokens`(또는 평소의 고유 gas)보다 낮은 트랜잭션은 유효하지 않습니다. 명세에 따르면 이로써 실행 페이로드의 최대 크기가 약 0.72 MB로 줄어듭니다.\n\n## 샘플 코드\n\n명세의 새로운 gas 사용량 공식:\n\n```python\nSTANDARD_TOKEN_COST = 4\nTOTAL_COST_FLOOR_PER_TOKEN = 10\n\ntokens_in_calldata = zero_bytes + nonzero_bytes * 4\n\ntx_gas_used = 21000 + max(\n    STANDARD_TOKEN_COST * tokens_in_calldata\n    + execution_gas_used\n    + is_contract_creation * (32000 + INITCODE_WORD_COST * words(calldata)),\n    TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,\n)\n```\n\n페이로드에 필요한 최소 gas 한도 확인하기(TypeScript):\n\n```ts\nimport { getBytes } from \"ethers\";\n\nfunction floorGasLimit(data: string): bigint {\n  const bytes = getBytes(data);\n  const zeros = bytes.filter((b) =\u003e b === 0).length;\n  const tokens = BigInt(zeros + (bytes.length - zeros) * 4);\n  return 21000n + 10n * tokens;\n}\n```\n\n## 알아둘 점\n\n- 상태는 Final이며, Pectra 업그레이드에서 이더리움 메인넷에 적용되었습니다.\n- 지갑과 RPC의 `eth_estimateGas`는 하한을 반영해야 합니다. 이를 무시한 추정치는 트랜잭션을 무효로 만드는 gas 한도를 낼 수 있습니다.\n- `execution_gas_used`는 환급 이후의 값이므로, 큰 환급에 의존하는 트랜잭션은 하한에 걸릴 수 있습니다.\n- 여전히 calldata로 데이터를 올리는 롤업은 더 많이 냅니다. 의도된 경로는 blob입니다.\n- [EIP-7976](/eip-7976/)은 하한을 더 올리자고 제안합니다.\n"},"zh":{"lang":"zh","tldr":"为数据量大的交易设定 calldata 价格下限（零字节/非零字节分别为 10/40 gas），缩小以太坊最坏情况下的区块大小，同时保持普通交易的成本不变。","tags":["gas","calldata","block-size","core","pectra"],"related":[2028,4844,1559,7976,3860],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7623/","markdown":"## 它解决什么问题？\n\n自 [EIP-2028](/eip-2028/) 以来，calldata 的成本一直是每个零字节 4 gas、每个非零字节 16 gas。平均区块很小（规范中约为 100 KB），但一个塞满 calldata 的区块可达约 1.79 MB，若按压缩前的零字节算则为 7.15 MB。客户端和网络必须为这种最坏情况做好准备，而这阻碍了提高 gas 上限或增加更多 blob。\n\n自 [EIP-4844](/eip-4844/) 以来，rollup 有了专门的、更便宜的数据存放处：blob。calldata 已经没有太多理由继续作为发布大量数据的廉价方式，因此 EIP-7623 让数据量大的交易多付一些费用，而不触及普通用户。\n\n## 它如何运作\n\ncalldata 按 token 计量：`tokens = zero_bytes + nonzero_bytes * 4`。\n\n一笔交易使用的 gas 取下面两个数中较大的一个（在基础的 21,000 之上）：\n\n- 常规成本：`4 * tokens + execution gas (+ creation costs)`，以及\n- 一个下限：`10 * tokens`。\n\n换句话说，只有当 calldata 在交易中占主导、超过执行部分时，交易才会按每字节 10/40 gas 的下限付费。典型的兑换、转账或铸造在 EVM 执行上花费足够多，下限根本不会生效，所以付的费用与以前完全一样。而主要由数据构成的交易，比如用 calldata 发布批次的 rollup，最多要多付 2.5 倍。\n\n下限必须由 gas 上限预先覆盖：如果交易的 gas 上限低于 `21000 + 10 * tokens`（或低于通常的内在 gas），则该交易无效。根据规范，这会把最大执行负载大小削减到约 0.72 MB。\n\n## 示例代码\n\n规范中新的 gas 使用量公式：\n\n```python\nSTANDARD_TOKEN_COST = 4\nTOTAL_COST_FLOOR_PER_TOKEN = 10\n\ntokens_in_calldata = zero_bytes + nonzero_bytes * 4\n\ntx_gas_used = 21000 + max(\n    STANDARD_TOKEN_COST * tokens_in_calldata\n    + execution_gas_used\n    + is_contract_creation * (32000 + INITCODE_WORD_COST * words(calldata)),\n    TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata,\n)\n```\n\n检查某个负载所需的最小 gas 上限（TypeScript）：\n\n```ts\nimport { getBytes } from \"ethers\";\n\nfunction floorGasLimit(data: string): bigint {\n  const bytes = getBytes(data);\n  const zeros = bytes.filter((b) =\u003e b === 0).length;\n  const tokens = BigInt(zeros + (bytes.length - zeros) * 4);\n  return 21000n + 10n * tokens;\n}\n```\n\n## 需要注意\n\n- 状态为 Final；它已在 Pectra 升级中于以太坊主网上线。\n- 钱包和 RPC 的 `eth_estimateGas` 必须考虑这个下限。忽略它的估算可能给出一个会使交易无效的 gas 上限。\n- 由于 `execution_gas_used` 是在退款之后计算的，依赖大额退款的交易可能触及下限。\n- 仍然以 calldata 发布数据的 rollup 要多付费；blob 才是预期的路径。\n- [EIP-7976](/eip-7976/) 提议进一步提高这个下限。\n"}},"requiredBy":[2780,7600,7782,7886,7976,7981,8037,8131,8279,8311]}
