{"eip":1109,"title":"PRECOMPILEDCALL opcode (Remove CALL costs for precompiled contracts)","description":"This EIP creates a specific opcode named PRECOMPILEDCALL to call Precompiled contracts without the costs of a normal CALL.","authors":["Jordi Baylina (@jbaylina)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2018-05-22","discussionsTo":"https://ethereum-magicians.org/t/eip-1109-remove-call-costs-for-precompiled-contracts/447","repo":"EIPs","label":"EIP-1109","officialUrl":"https://eips.ethereum.org/EIPS/eip-1109","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1109.md","url":"https://eips.huatuo.xyz/eip-1109/","tldr":{"en":"Proposed a PRECOMPILEDCALL opcode (0xfb) that calls precompiled contracts without the overhead of a regular CALL, so cheap precompiles could cost less than the CALL fee itself; it was never adopted.","ja":"通常の CALL のオーバーヘッドなしにプリコンパイル済みコントラクトを呼び出す PRECOMPILEDCALL opcode（0xfb）を提案し、安価なプリコンパイルのコストを CALL の手数料自体より小さくできるようにした。採用されなかった。","ko":"일반 CALL의 오버헤드 없이 프리컴파일 컨트랙트를 호출하는 PRECOMPILEDCALL opcode(0xfb)를 제안하여, 저렴한 프리컴파일의 비용이 CALL 수수료 자체보다 낮아질 수 있게 하려 했다. 채택되지 않았다.","zh":"提议增加一个 PRECOMPILEDCALL 操作码（0xfb），无需普通 CALL 的开销即可调用预编译合约，使廉价预编译的成本可以低于 CALL 本身的费用；它从未被采纳。"},"tags":["evm","opcode","precompile","gas","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed a PRECOMPILEDCALL opcode (0xfb) that calls precompiled contracts without the overhead of a regular CALL, so cheap precompiles could cost less than the CALL fee itself; it was never adopted.","tags":["evm","opcode","precompile","gas","core"],"related":[1108,2046,2929,1352],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-1109/","markdown":"## What problem does it solve?\n\nPrecompiled contracts (SHA-256, ecrecover, elliptic-curve operations and so on) live at fixed low addresses and each has its own gas price. To use one, a contract has to issue an ordinary `CALL` or `STATICCALL`, and at the time that call alone cost 700 gas before the precompile's own fee.\n\nThe spec's example: SHA-256 costs 60 gas and the alt_bn128 addition was being cut to 50 gas in [EIP-1108](/eip-1108/), yet each call still paid 700 gas of call overhead. That made it impossible to offer any precompile whose effective cost was below 700 gas, even when the underlying work was trivial.\n\n## How it works\n\nThe proposal adds a dedicated opcode:\n\n- **Opcode** `0xfb`, named `PRECOMPILEDCALL` (the next free slot after `STATICCALL`).\n- **Gas**: 2 (`Gbase`) plus the precompile's own price. There is no separate gas argument, because precompiles do not run EVM code and their cost is known up front.\n- **Stack in** (5 words): precompile address, input memory offset, input length, output memory offset, output length.\n- **Stack out** (1 word): `1` on success, `0` if the address is not a defined precompile or the precompile itself fails (for example on invalid input).\n- If there is not enough gas for 2 plus the precompile's cost, execution stops with out-of-gas.\n- Calling a normal contract or account with `PRECOMPILEDCALL` is treated as an undefined precompile: nothing executes and the result is `0`.\n\nExisting `CALL`s to precompiles keep working exactly as before, so the change is backwards compatible.\n\n## Sample code\n\nIllustrative EVM assembly: hash 32 bytes at memory 0 with the SHA-256 precompile (address `0x02`) and write the result to memory 32. This opcode does not exist on any network, so it will not assemble with real tools.\n\n```text\nPUSH1 0x20      // output length\nPUSH1 0x20      // output offset\nPUSH1 0x20      // input length\nPUSH1 0x00      // input offset\nPUSH1 0x02      // precompile address (SHA-256)\nPRECOMPILEDCALL // 0xfb; pushes 1 on success, 0 on failure\n```\n\nCompared with today's equivalent, which needs a gas argument and pays the call overhead:\n\n```solidity\n(bool ok, bytes memory out) = address(0x02).staticcall(abi.encodePacked(data));\n```\n\n## Things to know\n\n- Status is **Stagnant**. The opcode was never included in a hard fork, and `0xfb` is not assigned to it.\n- A similar goal was later pursued in [EIP-2046](/eip-2046/), which proposed cutting the base cost of `STATICCALL` to precompiles from 700 to 40 gas instead of adding an opcode.\n- Under [EIP-2929](/eip-2929/) (Berlin), precompile addresses are always treated as \"warm\", so calling one today costs far less than the 700 gas this EIP was reacting to.\n- The spec leaves the activation block as a placeholder and lists test cases but no implementation.\n"},"ja":{"lang":"ja","tldr":"通常の CALL のオーバーヘッドなしにプリコンパイル済みコントラクトを呼び出す PRECOMPILEDCALL opcode（0xfb）を提案し、安価なプリコンパイルのコストを CALL の手数料自体より小さくできるようにした。採用されなかった。","tags":["evm","opcode","precompile","gas","core"],"related":[1108,2046,2929,1352],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-1109/","markdown":"## 何を解決するのか\n\nプリコンパイル済みコントラクト（SHA-256、ecrecover、楕円曲線演算など）は固定の小さなアドレスにあり、それぞれ独自のガス価格を持ちます。これらを使うには、コントラクトは通常の `CALL` または `STATICCALL` を発行する必要があり、当時はその呼び出しだけで、プリコンパイル自体の手数料の前に 700 ガスかかりました。\n\n仕様の例では、SHA-256 は 60 ガス、alt_bn128 の加算は [EIP-1108](/eip-1108/) で 50 ガスに引き下げられようとしていましたが、それでも各呼び出しには 700 ガスの呼び出しオーバーヘッドがかかっていました。そのため、基礎となる処理が些細なものであっても、実効コストが 700 ガスを下回るプリコンパイルを提供することは不可能でした。\n\n## 仕組み\n\nこの提案は専用の opcode を追加します。\n\n- **Opcode** `0xfb`、名前は `PRECOMPILEDCALL`（`STATICCALL` の次の空きスロット）。\n- **ガス**: 2（`Gbase`）にプリコンパイル自体の価格を加えたもの。プリコンパイルは EVM コードを実行せず、コストが事前にわかっているため、別途ガス引数はありません。\n- **スタック入力**（5 ワード）: プリコンパイルのアドレス、入力のメモリオフセット、入力の長さ、出力のメモリオフセット、出力の長さ。\n- **スタック出力**（1 ワード）: 成功なら `1`。アドレスが定義済みのプリコンパイルでない場合、またはプリコンパイル自体が失敗した場合（たとえば入力が不正な場合）は `0`。\n- 2 にプリコンパイルのコストを加えた分のガスがなければ、実行は out-of-gas で停止します。\n- 通常のコントラクトやアカウントに `PRECOMPILEDCALL` を使うと、未定義のプリコンパイルとして扱われます。何も実行されず、結果は `0` です。\n\nプリコンパイルへの既存の `CALL` はこれまでとまったく同じように動作するため、この変更は後方互換です。\n\n## サンプルコード\n\n説明用の EVM アセンブリ。メモリ 0 にある 32 バイトを SHA-256 プリコンパイル（アドレス `0x02`）でハッシュし、結果をメモリ 32 に書き込みます。この opcode はどのネットワークにも存在しないため、実際のツールではアセンブルできません。\n\n```text\nPUSH1 0x20      // output length\nPUSH1 0x20      // output offset\nPUSH1 0x20      // input length\nPUSH1 0x00      // input offset\nPUSH1 0x02      // precompile address (SHA-256)\nPRECOMPILEDCALL // 0xfb; pushes 1 on success, 0 on failure\n```\n\nガス引数が必要で、呼び出しオーバーヘッドを支払う、現在の同等の書き方と比べてみてください。\n\n```solidity\n(bool ok, bytes memory out) = address(0x02).staticcall(abi.encodePacked(data));\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。この opcode はハードフォークに含まれたことがなく、`0xfb` もこれには割り当てられていません。\n- 同様の目標は、後に [EIP-2046](/eip-2046/) で追求されました。これは、opcode を追加する代わりに、プリコンパイルへの `STATICCALL` の基本コストを 700 から 40 ガスに引き下げることを提案しました。\n- [EIP-2929](/eip-2929/)（Berlin）では、プリコンパイルのアドレスは常に「ウォーム」として扱われるため、現在はプリコンパイルの呼び出しに、この EIP が対応しようとした 700 ガスよりはるかに少ないコストしかかかりません。\n- 仕様は有効化ブロックをプレースホルダーのままにしており、テストケースは載せていますが、実装はありません。\n"},"ko":{"lang":"ko","tldr":"일반 CALL의 오버헤드 없이 프리컴파일 컨트랙트를 호출하는 PRECOMPILEDCALL opcode(0xfb)를 제안하여, 저렴한 프리컴파일의 비용이 CALL 수수료 자체보다 낮아질 수 있게 하려 했다. 채택되지 않았다.","tags":["evm","opcode","precompile","gas","core"],"related":[1108,2046,2929,1352],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-1109/","markdown":"## 어떤 문제를 해결하나요?\n\n프리컴파일 컨트랙트(SHA-256, ecrecover, 타원곡선 연산 등)는 고정된 낮은 주소에 있고 각각 자체 가스 가격이 있습니다. 이를 사용하려면 컨트랙트가 일반 `CALL`이나 `STATICCALL`을 실행해야 하는데, 당시에는 그 호출만으로도 프리컴파일 자체 수수료 이전에 700 가스가 들었습니다.\n\n명세의 예시를 보면 SHA-256은 60 가스이고 alt_bn128 덧셈은 [EIP-1108](/eip-1108/)에서 50 가스로 줄어들 예정이었지만, 호출마다 700 가스의 호출 오버헤드는 여전히 냈습니다. 그 결과 기반 작업이 사소하더라도 실효 비용이 700 가스 미만인 프리컴파일은 제공할 수 없었습니다.\n\n## 어떻게 동작하나요?\n\n이 제안은 전용 opcode를 추가합니다.\n\n- **Opcode** `0xfb`, 이름은 `PRECOMPILEDCALL`(`STATICCALL` 다음의 빈 슬롯).\n- **가스**: 2(`Gbase`)에 프리컴파일 자체 가격을 더한 값. 프리컴파일은 EVM 코드를 실행하지 않고 비용이 미리 알려져 있으므로 별도의 가스 인자는 없습니다.\n- **스택 입력**(5 워드): 프리컴파일 주소, 입력 메모리 오프셋, 입력 길이, 출력 메모리 오프셋, 출력 길이.\n- **스택 출력**(1 워드): 성공하면 `1`, 주소가 정의된 프리컴파일이 아니거나 프리컴파일 자체가 실패하면(예: 잘못된 입력) `0`.\n- 2에 프리컴파일 비용을 더한 만큼의 가스가 없으면 실행은 out-of-gas로 중단됩니다.\n- 일반 컨트랙트나 계정에 `PRECOMPILEDCALL`을 쓰면 정의되지 않은 프리컴파일로 취급됩니다. 아무것도 실행되지 않고 결과는 `0`입니다.\n\n프리컴파일에 대한 기존 `CALL`은 이전과 똑같이 동작하므로 이 변경은 하위 호환됩니다.\n\n## 샘플 코드\n\n설명용 EVM 어셈블리. 메모리 0의 32바이트를 SHA-256 프리컴파일(주소 `0x02`)로 해시하고 결과를 메모리 32에 씁니다. 이 opcode는 어떤 네트워크에도 존재하지 않으므로 실제 도구로는 어셈블되지 않습니다.\n\n```text\nPUSH1 0x20      // output length\nPUSH1 0x20      // output offset\nPUSH1 0x20      // input length\nPUSH1 0x00      // input offset\nPUSH1 0x02      // precompile address (SHA-256)\nPRECOMPILEDCALL // 0xfb; pushes 1 on success, 0 on failure\n```\n\n가스 인자가 필요하고 호출 오버헤드를 내는 오늘날의 동등한 코드와 비교해 보세요.\n\n```solidity\n(bool ok, bytes memory out) = address(0x02).staticcall(abi.encodePacked(data));\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 이 opcode는 어떤 하드 포크에도 포함된 적이 없고 `0xfb`도 여기에 할당되지 않았습니다.\n- 비슷한 목표는 나중에 [EIP-2046](/eip-2046/)에서 추구되었습니다. 이 제안은 opcode를 추가하는 대신 프리컴파일에 대한 `STATICCALL`의 기본 비용을 700에서 40 가스로 낮추자고 했습니다.\n- [EIP-2929](/eip-2929/)(Berlin)에서는 프리컴파일 주소를 항상 \"웜\"으로 취급하므로, 오늘날 프리컴파일을 호출하는 비용은 이 EIP가 대응하려던 700 가스보다 훨씬 적습니다.\n- 명세는 활성화 블록을 자리 표시자로 남겨 두었고, 테스트 케이스는 나열하지만 구현은 없습니다.\n"},"zh":{"lang":"zh","tldr":"提议增加一个 PRECOMPILEDCALL 操作码（0xfb），无需普通 CALL 的开销即可调用预编译合约，使廉价预编译的成本可以低于 CALL 本身的费用；它从未被采纳。","tags":["evm","opcode","precompile","gas","core"],"related":[1108,2046,2929,1352],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-1109/","markdown":"## 它解决什么问题？\n\n预编译合约（SHA-256、ecrecover、椭圆曲线运算等）位于固定的低地址，各有自己的 gas 价格。要使用它们，合约必须发出普通的 `CALL` 或 `STATICCALL`，而当时仅这一次调用就要花 700 gas，还不算预编译本身的费用。\n\n规范中的例子：SHA-256 的价格是 60 gas，alt_bn128 的加法在 [EIP-1108](/eip-1108/) 中被降到 50 gas，但每次调用仍要支付 700 gas 的调用开销。这使得任何有效成本低于 700 gas 的预编译都无法提供，即使其底层工作微不足道。\n\n## 它如何运作\n\n该提案增加了一个专用的操作码：\n\n- **操作码** `0xfb`，名为 `PRECOMPILEDCALL`（`STATICCALL` 之后的下一个空闲位置）。\n- **Gas**：2（`Gbase`）加上预编译自身的价格。没有单独的 gas 参数，因为预编译不运行 EVM 代码，其成本事先已知。\n- **栈输入**（5 个字）：预编译地址、输入内存偏移、输入长度、输出内存偏移、输出长度。\n- **栈输出**（1 个字）：成功为 `1`；如果该地址不是已定义的预编译，或预编译本身失败（例如输入无效），则为 `0`。\n- 如果 gas 不足以支付 2 加预编译的成本，执行会因 out-of-gas 而停止。\n- 对普通合约或账户使用 `PRECOMPILEDCALL` 会被视为未定义的预编译：什么都不执行，结果为 `0`。\n\n对预编译的现有 `CALL` 仍和以前完全一样地工作，因此这一变更向后兼容。\n\n## 示例代码\n\n示意性的 EVM 汇编：用 SHA-256 预编译（地址 `0x02`）对内存 0 处的 32 字节求哈希，并把结果写入内存 32。该操作码在任何网络上都不存在，所以无法用真实工具汇编。\n\n```text\nPUSH1 0x20      // output length\nPUSH1 0x20      // output offset\nPUSH1 0x20      // input length\nPUSH1 0x00      // input offset\nPUSH1 0x02      // precompile address (SHA-256)\nPRECOMPILEDCALL // 0xfb; pushes 1 on success, 0 on failure\n```\n\n对比今天的等价写法，它需要 gas 参数并要支付调用开销：\n\n```solidity\n(bool ok, bytes memory out) = address(0x02).staticcall(abi.encodePacked(data));\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。该操作码从未被纳入硬分叉，`0xfb` 也没有分配给它。\n- 后来的 [EIP-2046](/eip-2046/) 追求类似的目标，它提议不增加操作码，而是把对预编译的 `STATICCALL` 的基础成本从 700 降到 40 gas。\n- 在 [EIP-2929](/eip-2929/)（Berlin）下，预编译地址始终被视为“热”，因此如今调用一个预编译的成本远低于这份 EIP 当年所针对的 700 gas。\n- 规范把激活区块留作占位符，并列出了测试用例，但没有实现。\n"}},"requiredBy":[1962,2539]}
