{"eip":5065,"title":"Instruction for transferring ether","description":"Instruction for just transferring ether without transferring the flow of execution","authors":["Mudit Gupta (@maxsam4)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2022-04-30","requires":[2929],"discussionsTo":"https://ethereum-magicians.org/t/eip-5065-instruction-for-transferring-ether/9107","repo":"EIPs","label":"EIP-5065","officialUrl":"https://eips.ethereum.org/EIPS/eip-5065","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5065.md","url":"https://eips.huatuo.xyz/eip-5065/","tldr":{"en":"Proposed a new EVM instruction that sends ETH to an address without calling it, so contracts can pay untrusted recipients with no re-entrancy risk.","ja":"アドレスを呼び出さずに ETH を送る新しい EVM 命令の提案。コントラクトが信頼できない受取先へ、再入のリスクなしに支払えるようにする。","ko":"주소를 호출하지 않고 ETH를 보내는 새로운 EVM 명령어 제안. 컨트랙트가 신뢰할 수 없는 수신자에게 재진입 위험 없이 대금을 지급할 수 있다.","zh":"建议新增一条 EVM 指令，向某个地址发送 ETH 而不调用它，让合约可以向不可信的接收方付款，且没有重入风险。"},"tags":["evm","opcodes","eth-transfer","reentrancy","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed a new EVM instruction that sends ETH to an address without calling it, so contracts can pay untrusted recipients with no re-entrancy risk.","tags":["evm","opcodes","eth-transfer","reentrancy","core"],"related":[2929,6780,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5065/","markdown":"## What problem does it solve?\n\nIn today's EVM, sending ETH from a contract (`CALL` with value, Solidity's `transfer`, `send` or `.call{value: ...}`) also hands execution to the recipient. If the recipient is a contract, its code runs, and it can re-enter the sender. That is the root of many re-entrancy bugs, and the reason contracts use re-entrancy guards and the checks-effects-interactions pattern.\n\nThe only way to move ETH without triggering any code is a hack: deploy a throwaway contract, fund it, and have it `SELFDESTRUCT` to the recipient. That works but is expensive. Most of the time the sender just wants to pay, not to call.\n\n## How it works\n\nEIP-5065 adds an instruction, `AIRDROP`, that transfers ETH and does nothing else, much as `SELFDESTRUCT` credits its beneficiary without calling it.\n\n- **Stack inputs**: `address` (recipient) and `value` (wei).\n- **Effect**: move `value` wei from the current contract to `address`. No code runs at the destination.\n- **Opcode**: the spec writes `0xFG`, a placeholder; no byte was assigned.\n\n**Gas** = static cost + address access cost + new-account cost:\n\n| Part | Cost |\n| --- | --- |\n| Static | 6700 |\n| Address access ([EIP-2929](/eip-2929/)) | 2600 if cold, 100 if warm |\n| Value to an empty account | 25000 if `value \u003e 0` and the target has zero balance, zero nonce and no code |\n\nThe static 6700 comes from `CALL`'s 9000 charge for a non-zero value transfer minus the 2300 stipend that `CALL` passes to the recipient; with no call, there is no stipend.\n\n## Sample code\n\nToday, without the opcode, the safest pattern is checks-effects-interactions plus a pull-payment design:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Payouts {\n    mapping(address =\u003e uint256) public owed;\n\n    function withdraw() external {\n        uint256 amount = owed[msg.sender];\n        owed[msg.sender] = 0;                         // effect before interaction\n        (bool ok, ) = msg.sender.call{value: amount}(\"\"); // recipient code runs here\n        require(ok, \"send failed\");\n    }\n}\n```\n\nWith EIP-5065 the interaction would carry no control-flow risk (hypothetical; no compiler supports it):\n\n```text\nPUSH32 \u003camount\u003e     ; value\nPUSH20 \u003crecipient\u003e  ; address (top of stack)\nAIRDROP             ; credit balance, no call, no re-entrancy\n```\n\n## Things to know\n\n- Status: **Stagnant**. No opcode number was assigned, and the spec's test cases are still TODO.\n- A recipient contract cannot reject or react to the payment, the same as with `SELFDESTRUCT` or validator withdrawals today. Contracts already must not assume their balance only changes via `receive`.\n- The spec says the stack inputs are `address` and `value` but does not fix their order; the snippet above is only illustrative.\n- After [EIP-6780](/eip-6780/), `SELFDESTRUCT` outside the creating transaction only sends ETH, but it still requires deploying a helper contract per payment, so the motivation for a cheap native opcode remains.\n"},"ja":{"lang":"ja","tldr":"アドレスを呼び出さずに ETH を送る新しい EVM 命令の提案。コントラクトが信頼できない受取先へ、再入のリスクなしに支払えるようにする。","tags":["evm","opcodes","eth-transfer","reentrancy","core"],"related":[2929,6780,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5065/","markdown":"## 何を解決するのか\n\n現在の EVM では、コントラクトから ETH を送る操作（value 付きの `CALL`、Solidity の `transfer`、`send`、`.call{value: ...}`）は、同時に受取側へ実行を渡します。受取側がコントラクトなら、そのコードが実行され、送信側へ再入できます。これが多くの再入バグの根本であり、コントラクトが再入ガードや checks-effects-interactions パターンを使う理由です。\n\nコードを一切発火させずに ETH を動かす唯一の方法はハックです。使い捨てのコントラクトをデプロイして資金を入れ、受取先へ `SELFDESTRUCT` させます。動きますが高価です。たいていの場合、送信側は呼び出したいのではなく、支払いたいだけです。\n\n## 仕組み\n\nEIP-5065 は、ETH を送る以外に何もしない命令 `AIRDROP` を追加します。`SELFDESTRUCT` が受益者を呼び出さずに残高を加算するのとよく似ています。\n\n- **スタック入力**: `address`（受取先）と `value`（wei）。\n- **効果**: 現在のコントラクトから `address` へ `value` wei を移します。宛先ではコードが実行されません。\n- **Opcode**: 仕様は `0xFG` と書いていますが、これはプレースホルダーで、バイト値は割り当てられていません。\n\n**ガス** = 静的コスト + アドレスアクセスコスト + 新規アカウントコスト:\n\n| 項目 | コスト |\n| --- | --- |\n| 静的 | 6700 |\n| アドレスアクセス（[EIP-2929](/eip-2929/)） | cold なら 2600、warm なら 100 |\n| 空のアカウントへの value | `value \u003e 0` で、宛先の残高が 0、nonce が 0、コードなしの場合に 25000 |\n\n静的な 6700 は、value が 0 でない送金に対する `CALL` の 9000 から、`CALL` が受取側に渡す 2300 のスタイペンドを引いたものです。呼び出しがないので、スタイペンドはありません。\n\n## サンプルコード\n\nこの opcode がない現在、最も安全なパターンは checks-effects-interactions にプルペイメント設計を組み合わせたものです。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Payouts {\n    mapping(address =\u003e uint256) public owed;\n\n    function withdraw() external {\n        uint256 amount = owed[msg.sender];\n        owed[msg.sender] = 0;                         // effect before interaction\n        (bool ok, ) = msg.sender.call{value: amount}(\"\"); // recipient code runs here\n        require(ok, \"send failed\");\n    }\n}\n```\n\nEIP-5065 があれば、このやり取りは制御フローのリスクを伴いません（仮定の話で、これをサポートするコンパイラはありません）。\n\n```text\nPUSH32 \u003camount\u003e     ; value\nPUSH20 \u003crecipient\u003e  ; address (top of stack)\nAIRDROP             ; credit balance, no call, no re-entrancy\n```\n\n## 知っておくべきこと\n\n- ステータス: **Stagnant**。opcode 番号は割り当てられず、仕様のテストケースも TODO のままです。\n- 受取先のコントラクトは、現在の `SELFDESTRUCT` やバリデーターの出金と同様に、支払いを拒否したり反応したりできません。コントラクトは、残高が `receive` 経由でのみ変化すると仮定してはならないことになっています。\n- 仕様はスタック入力が `address` と `value` だと述べていますが、その順序は定めていません。上のスニペットは説明用にすぎません。\n- [EIP-6780](/eip-6780/) の後、作成トランザクション外での `SELFDESTRUCT` は ETH を送るだけですが、支払いごとにヘルパーコントラクトをデプロイする必要があるため、安価なネイティブ opcode の動機は残ります。\n"},"ko":{"lang":"ko","tldr":"주소를 호출하지 않고 ETH를 보내는 새로운 EVM 명령어 제안. 컨트랙트가 신뢰할 수 없는 수신자에게 재진입 위험 없이 대금을 지급할 수 있다.","tags":["evm","opcodes","eth-transfer","reentrancy","core"],"related":[2929,6780,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5065/","markdown":"## 어떤 문제를 해결하나요?\n\n오늘날의 EVM에서 컨트랙트가 ETH를 보내는 것(value가 있는 `CALL`, Solidity의 `transfer`, `send`, `.call{value: ...}`)은 수신자에게 실행 권한도 넘깁니다. 수신자가 컨트랙트라면 그 코드가 실행되고 송신자에게 재진입할 수 있습니다. 이것이 많은 재진입 버그의 근본 원인이며, 컨트랙트가 재진입 방지 장치와 checks-effects-interactions 패턴을 쓰는 이유입니다.\n\n어떤 코드도 실행시키지 않고 ETH를 옮기는 유일한 방법은 편법입니다. 일회용 컨트랙트를 배포해 자금을 넣고, 수신자에게 `SELFDESTRUCT`하게 합니다. 동작은 하지만 비쌉니다. 대부분의 경우 송신자는 호출이 아니라 그냥 지급을 원할 뿐입니다.\n\n## 어떻게 동작하나요?\n\nEIP-5065는 ETH를 이전하는 것 외에는 아무것도 하지 않는 명령어 `AIRDROP`을 추가합니다. `SELFDESTRUCT`가 수혜자를 호출하지 않고 잔액을 입금하는 것과 비슷합니다.\n\n- **스택 입력**: `address`(수신자)와 `value`(wei).\n- **효과**: 현재 컨트랙트에서 `address`로 `value` wei를 옮깁니다. 목적지에서는 코드가 실행되지 않습니다.\n- **Opcode**: 명세는 `0xFG`라고 쓰는데 이는 자리 표시자이며, 바이트 값은 할당되지 않았습니다.\n\n**가스** = 정적 비용 + 주소 접근 비용 + 새 계정 비용:\n\n| 항목 | 비용 |\n| --- | --- |\n| 정적 | 6700 |\n| 주소 접근([EIP-2929](/eip-2929/)) | cold면 2600, warm이면 100 |\n| 빈 계정으로의 value | `value \u003e 0`이고 대상의 잔액이 0, nonce가 0, 코드가 없으면 25000 |\n\n정적 6700은 value가 0이 아닌 전송에 대한 `CALL`의 9000에서, `CALL`이 수신자에게 넘기는 2300 스타이펜드(stipend)를 뺀 값입니다. 호출이 없으므로 스타이펜드도 없습니다.\n\n## 샘플 코드\n\n이 opcode가 없는 지금, 가장 안전한 패턴은 checks-effects-interactions에 풀 결제(pull-payment) 설계를 더한 것입니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Payouts {\n    mapping(address =\u003e uint256) public owed;\n\n    function withdraw() external {\n        uint256 amount = owed[msg.sender];\n        owed[msg.sender] = 0;                         // effect before interaction\n        (bool ok, ) = msg.sender.call{value: amount}(\"\"); // recipient code runs here\n        require(ok, \"send failed\");\n    }\n}\n```\n\nEIP-5065가 있다면 이 상호작용은 제어 흐름 위험을 동반하지 않을 것입니다(가정이며, 이를 지원하는 컴파일러는 없습니다).\n\n```text\nPUSH32 \u003camount\u003e     ; value\nPUSH20 \u003crecipient\u003e  ; address (top of stack)\nAIRDROP             ; credit balance, no call, no re-entrancy\n```\n\n## 알아둘 점\n\n- 상태: **Stagnant**. opcode 번호는 할당되지 않았고 명세의 테스트 케이스도 여전히 TODO입니다.\n- 수신 컨트랙트는 오늘날의 `SELFDESTRUCT`나 검증자 출금과 마찬가지로 지급을 거부하거나 반응할 수 없습니다. 컨트랙트는 이미 자신의 잔액이 `receive`를 통해서만 변한다고 가정해서는 안 됩니다.\n- 명세는 스택 입력이 `address`와 `value`라고 말하지만 순서는 고정하지 않습니다. 위 스니펫은 설명용일 뿐입니다.\n- [EIP-6780](/eip-6780/) 이후 생성 트랜잭션 밖에서의 `SELFDESTRUCT`는 ETH만 보내지만, 여전히 지급마다 헬퍼 컨트랙트를 배포해야 하므로 저렴한 네이티브 opcode의 동기는 남아 있습니다.\n"},"zh":{"lang":"zh","tldr":"建议新增一条 EVM 指令，向某个地址发送 ETH 而不调用它，让合约可以向不可信的接收方付款，且没有重入风险。","tags":["evm","opcodes","eth-transfer","reentrancy","core"],"related":[2929,6780,4758],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5065/","markdown":"## 它解决什么问题？\n\n在当今的 EVM 中，从合约发送 ETH（带 value 的 `CALL`、Solidity 的 `transfer`、`send` 或 `.call{value: ...}`）同时也会把执行权交给接收方。如果接收方是合约，它的代码会运行，并且可以重入发送方。这是许多重入漏洞的根源，也是合约使用重入保护和 checks-effects-interactions 模式的原因。\n\n在不触发任何代码的情况下转移 ETH，唯一的办法是一种变通手段：部署一个一次性合约，给它充值，再让它 `SELFDESTRUCT` 到接收方。这样可行，但很昂贵。大多数时候，发送方只是想付款，而不是想调用。\n\n## 它如何运作\n\nEIP-5065 新增了一条指令 `AIRDROP`，它只转移 ETH，不做其他任何事，就像 `SELFDESTRUCT` 在不调用受益人的情况下为其入账一样。\n\n- **栈输入**：`address`（接收方）和 `value`（wei）。\n- **效果**：把 `value` wei 从当前合约转给 `address`。目的地不运行任何代码。\n- **操作码**：规范写的是 `0xFG`，这是占位符，并未分配字节值。\n\n**Gas** = 静态成本 + 地址访问成本 + 新账户成本：\n\n| 部分 | 成本 |\n| --- | --- |\n| 静态 | 6700 |\n| 地址访问（[EIP-2929](/eip-2929/)） | 冷访问 2600，热访问 100 |\n| 向空账户转 value | 当 `value \u003e 0` 且目标账户余额为零、nonce 为零、没有代码时为 25000 |\n\n静态的 6700 来自 `CALL` 对非零 value 转账收取的 9000，减去 `CALL` 传给接收方的 2300 津贴（stipend）；没有调用，也就没有津贴。\n\n## 示例代码\n\n在没有这条操作码的今天，最安全的写法是 checks-effects-interactions 加上拉取式付款（pull-payment）设计：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract Payouts {\n    mapping(address =\u003e uint256) public owed;\n\n    function withdraw() external {\n        uint256 amount = owed[msg.sender];\n        owed[msg.sender] = 0;                         // effect before interaction\n        (bool ok, ) = msg.sender.call{value: amount}(\"\"); // recipient code runs here\n        require(ok, \"send failed\");\n    }\n}\n```\n\n有了 EIP-5065，这次交互将不带控制流风险（假设性的，目前没有编译器支持）：\n\n```text\nPUSH32 \u003camount\u003e     ; value\nPUSH20 \u003crecipient\u003e  ; address (top of stack)\nAIRDROP             ; credit balance, no call, no re-entrancy\n```\n\n## 需要注意\n\n- 状态：**Stagnant**。没有分配操作码编号，规范的测试用例也仍是 TODO。\n- 接收方合约无法拒绝或响应这笔付款，就像今天的 `SELFDESTRUCT` 或验证者提款一样。合约本来就不能假设自己的余额只会通过 `receive` 变化。\n- 规范说栈输入是 `address` 和 `value`，但没有规定它们的顺序；上面的代码片段只是示意。\n- 在 [EIP-6780](/eip-6780/) 之后，在创建交易之外使用 `SELFDESTRUCT` 只会发送 ETH，但每笔付款仍然需要部署一个辅助合约，因此对廉价原生操作码的需求依然存在。\n"}}}
