{"eip":5806,"title":"Delegate transaction","description":"Adds a new transaction type that allows EOAs to execute arbitrary code through delegation","authors":["Hadrien Croubois (@Amxx)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2022-10-20","requires":[2718,2930],"discussionsTo":"https://ethereum-magicians.org/t/eip-5806-delegate-transaction/11409","repo":"EIPs","label":"EIP-5806","officialUrl":"https://eips.ethereum.org/EIPS/eip-5806","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5806.md","url":"https://eips.huatuo.xyz/eip-5806/","tldr":{"en":"A proposed transaction type that lets a regular EOA delegatecall a contract for one transaction, so it can batch calls and run arbitrary logic as itself without becoming a smart wallet.","ja":"通常の EOA が 1 つのトランザクションの間だけコントラクトを delegatecall できるようにするトランザクションタイプの提案。スマートウォレットにならずに、呼び出しをバッチ化し、自分自身として任意のロジックを実行できる。","ko":"일반 EOA가 하나의 트랜잭션 동안 컨트랙트를 delegatecall할 수 있게 하는 트랜잭션 유형 제안. 스마트 지갑이 되지 않고도 호출을 일괄 처리하고 자기 자신으로서 임의의 로직을 실행할 수 있다.","zh":"一种拟议的交易类型，允许普通 EOA 在一笔交易中对某个合约执行 delegatecall，从而可以批量调用并以自身身份运行任意逻辑，而无需变成智能钱包。"},"tags":["eoa","transactions","delegatecall","batching","core"],"explainers":{"en":{"lang":"en","tldr":"A proposed transaction type that lets a regular EOA delegatecall a contract for one transaction, so it can batch calls and run arbitrary logic as itself without becoming a smart wallet.","tags":["eoa","transactions","delegatecall","batching","core"],"related":[7702,2718,7,3074,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5806/","markdown":"## What problem does it solve?\n\nAn externally owned account (EOA) can do only two things: send a call or deploy a contract. It cannot run custom logic as itself. That is why approving and then swapping a token takes two separate transactions, each with its own 21,000 gas overhead and fee, and with a window in which the open approval can be abused.\n\nSmart contract wallets solve this, but most users still hold EOAs, and some assets cannot be moved to a new address. EIP-5806 proposes a small change: let an EOA perform a **delegate call** (the same mechanism contracts got in [EIP-7](/eip-7/)) to a contract of its choosing, for the duration of one transaction. It explicitly does not aim to be a full account-abstraction design.\n\n## How it works\n\n- A new [EIP-2718](/eip-2718/) typed transaction (type number left as TBD) with the payload:\n  `rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, y_parity, r, s])`\n- Fee fields follow EIP-1559 semantics. There is **no `value` field**, and `destination` must be a real address (it cannot be a contract creation).\n- Intrinsic gas is the same as an [EIP-2930](/eip-2930/) transaction.\n- Execution runs the code at `destination` **in the context of the sender**: `address(this)` is the EOA, events are emitted from the EOA, and any outgoing `CALL` has the EOA as `msg.sender`.\n- For safety, some opcodes throw when executed directly in the EOA context:\n  - `SSTORE`: no storage on EOAs (avoids layout conflicts and future migration issues).\n  - `CREATE`, `CREATE2`, `SELFDESTRUCT`: these could change the EOA's nonce and break the \"consecutive nonces\" assumption.\n  Contracts called *from* the delegated code are unaffected and may use these normally.\n\n## Sample code\n\nThe typical use is batching through a multicall-style contract. The delegated code runs as the EOA, so each sub-call's `msg.sender` is the user:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// Target for a delegate transaction. Uses no SSTORE/CREATE, as required.\ncontract Batch {\n    struct Call { address target; bytes data; }\n\n    function run(Call[] calldata calls) external {\n        for (uint256 i = 0; i \u003c calls.length; i++) {\n            (bool ok, bytes memory ret) = calls[i].target.call(calls[i].data);\n            if (!ok) assembly { revert(add(ret, 32), mload(ret)) }\n        }\n    }\n}\n```\n\nConceptual transaction (pseudocode; the type byte was never assigned):\n\n```text\ntx = DelegateTx(\n  chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n  destination = Batch,\n  data = run([ (token, approve(router, amt)), (router, swap(...)) ]),\n  access_list = []\n)\n```\n\n## Things to know\n\n- Status is **Stagnant**. It was never scheduled for a network upgrade.\n- The goal of \"let EOAs run code\" was ultimately met by [EIP-7702](/eip-7702/), which sets a delegation designator on the EOA instead of adding a one-shot delegate-call transaction. Use 7702 (or [ERC-4337](/eip-4337/) smart accounts) for real deployments.\n- Compared with [EIP-3074](/eip-3074/), the user signs a whole transaction rather than a reusable authorization, so wallets can simulate exactly what will run.\n- A delegate transaction gives the target code full power over the signer's assets. Wallets should only allow well-known, audited targets.\n"},"ja":{"lang":"ja","tldr":"通常の EOA が 1 つのトランザクションの間だけコントラクトを delegatecall できるようにするトランザクションタイプの提案。スマートウォレットにならずに、呼び出しをバッチ化し、自分自身として任意のロジックを実行できる。","tags":["eoa","transactions","delegatecall","batching","core"],"related":[7702,2718,7,3074,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5806/","markdown":"## 何を解決するのか\n\n外部所有アカウント（EOA）にできることは 2 つだけです。コールを送ることと、コントラクトをデプロイすることです。自分自身として独自のロジックを実行することはできません。そのため、トークンの approve とスワップには 2 つの別々のトランザクションが必要で、それぞれに 21,000 ガスのオーバーヘッドと手数料がかかり、しかも開いた approve が悪用されうる時間の窓が生じます。\n\nスマートコントラクトウォレットはこれを解決しますが、ほとんどのユーザーは依然として EOA を保有しており、新しいアドレスに移せない資産もあります。EIP-5806 は小さな変更を提案しています。EOA が、1 つのトランザクションの間、自分で選んだコントラクトへの**デリゲートコール**（コントラクトが [EIP-7](/eip-7/) で得たのと同じ仕組み）を実行できるようにするというものです。完全なアカウント抽象化の設計を目指すものではないと明示されています。\n\n## 仕組み\n\n- 新しい [EIP-2718](/eip-2718/) のタイプ付きトランザクション（タイプ番号は TBD のまま）で、ペイロードは次のとおりです。\n  `rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, y_parity, r, s])`\n- 手数料フィールドは EIP-1559 の意味論に従います。`value` フィールドは**ありません**。`destination` は実在のアドレスでなければなりません（コントラクト作成にはできません）。\n- 固有ガスは [EIP-2930](/eip-2930/) のトランザクションと同じです。\n- 実行は `destination` のコードを**送信者のコンテキストで**走らせます。`address(this)` は EOA であり、イベントは EOA から emit され、外向きの `CALL` は EOA を `msg.sender` にします。\n- 安全のため、EOA のコンテキストで直接実行されると一部のオペコードは例外を投げます。\n  - `SSTORE`: EOA にストレージはありません（レイアウトの衝突や将来の移行の問題を避けるため）。\n  - `CREATE`、`CREATE2`、`SELFDESTRUCT`: EOA の nonce を変更し、「連続した nonce」という前提を壊しうるためです。\n  デリゲートされたコードから呼び出される*先の*コントラクトは影響を受けず、これらを通常どおり使えます。\n\n## サンプルコード\n\n典型的な用途は、multicall 方式のコントラクトを通じたバッチ処理です。デリゲートされたコードは EOA として動作するため、各サブコールの `msg.sender` はユーザーになります。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// Target for a delegate transaction. Uses no SSTORE/CREATE, as required.\ncontract Batch {\n    struct Call { address target; bytes data; }\n\n    function run(Call[] calldata calls) external {\n        for (uint256 i = 0; i \u003c calls.length; i++) {\n            (bool ok, bytes memory ret) = calls[i].target.call(calls[i].data);\n            if (!ok) assembly { revert(add(ret, 32), mload(ret)) }\n        }\n    }\n}\n```\n\n概念的なトランザクション（疑似コード。タイプのバイトは割り当てられませんでした）:\n\n```text\ntx = DelegateTx(\n  chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n  destination = Batch,\n  data = run([ (token, approve(router, amt)), (router, swap(...)) ]),\n  access_list = []\n)\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。ネットワークアップグレードに組み込まれる予定は一度もありませんでした。\n- 「EOA にコードを実行させる」という目標は、最終的には [EIP-7702](/eip-7702/) によって達成されました。これは 1 回限りのデリゲートコールのトランザクションを追加する代わりに、EOA にデリゲーション指定子を設定します。実際のデプロイには 7702（または [ERC-4337](/eip-4337/) のスマートアカウント）を使ってください。\n- [EIP-3074](/eip-3074/) と比べると、ユーザーは再利用可能な認可ではなくトランザクション全体に署名するため、ウォレットは何が実行されるかを正確にシミュレートできます。\n- デリゲートトランザクションは、対象コードに署名者の資産に対する完全な権限を与えます。ウォレットは、よく知られた監査済みの対象だけを許可すべきです。\n"},"ko":{"lang":"ko","tldr":"일반 EOA가 하나의 트랜잭션 동안 컨트랙트를 delegatecall할 수 있게 하는 트랜잭션 유형 제안. 스마트 지갑이 되지 않고도 호출을 일괄 처리하고 자기 자신으로서 임의의 로직을 실행할 수 있다.","tags":["eoa","transactions","delegatecall","batching","core"],"related":[7702,2718,7,3074,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5806/","markdown":"## 어떤 문제를 해결하나요?\n\n외부 소유 계정(EOA)이 할 수 있는 일은 두 가지뿐입니다. 호출을 보내거나 컨트랙트를 배포하는 것입니다. 자기 자신으로서 사용자 정의 로직을 실행할 수는 없습니다. 그래서 토큰을 approve한 뒤 스왑하려면 두 개의 별도 트랜잭션이 필요하고, 각각 21,000 가스의 오버헤드와 수수료가 들며, 열려 있는 approve가 악용될 수 있는 시간 틈도 생깁니다.\n\n스마트 컨트랙트 지갑이 이를 해결하지만, 대부분의 사용자는 여전히 EOA를 갖고 있고 일부 자산은 새 주소로 옮길 수 없습니다. EIP-5806은 작은 변경을 제안합니다. EOA가 하나의 트랜잭션 동안 자신이 고른 컨트랙트에 **delegate call**([EIP-7](/eip-7/)에서 컨트랙트가 얻은 것과 같은 메커니즘)을 수행하게 하자는 것입니다. 완전한 계정 추상화 설계를 목표로 하지 않음을 명시합니다.\n\n## 어떻게 동작하나요?\n\n- 새로운 [EIP-2718](/eip-2718/) 타입 트랜잭션(타입 번호는 TBD로 남아 있음)이며 페이로드는 다음과 같습니다.\n  `rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, y_parity, r, s])`\n- 수수료 필드는 EIP-1559의 의미를 따릅니다. `value` 필드는 **없으며**, `destination`은 실제 주소여야 합니다(컨트랙트 생성일 수 없음).\n- 고유 가스(intrinsic gas)는 [EIP-2930](/eip-2930/) 트랜잭션과 같습니다.\n- 실행은 `destination`의 코드를 **발신자의 컨텍스트에서** 실행합니다. `address(this)`는 EOA이고, 이벤트는 EOA에서 emit되며, 나가는 모든 `CALL`은 EOA를 `msg.sender`로 가집니다.\n- 안전을 위해 일부 opcode는 EOA 컨텍스트에서 직접 실행되면 예외를 던집니다.\n  - `SSTORE`: EOA에는 스토리지가 없습니다(레이아웃 충돌과 향후 마이그레이션 문제를 피하기 위해).\n  - `CREATE`, `CREATE2`, `SELFDESTRUCT`: EOA의 nonce를 바꿔 \"연속된 nonce\"라는 가정을 깨뜨릴 수 있습니다.\n  위임된 코드에서 *호출되는* 컨트랙트는 영향을 받지 않으며 이들을 정상적으로 사용할 수 있습니다.\n\n## 샘플 코드\n\n전형적인 사용처는 multicall 방식의 컨트랙트를 통한 일괄 처리입니다. 위임된 코드는 EOA로서 실행되므로 각 하위 호출의 `msg.sender`는 사용자입니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// Target for a delegate transaction. Uses no SSTORE/CREATE, as required.\ncontract Batch {\n    struct Call { address target; bytes data; }\n\n    function run(Call[] calldata calls) external {\n        for (uint256 i = 0; i \u003c calls.length; i++) {\n            (bool ok, bytes memory ret) = calls[i].target.call(calls[i].data);\n            if (!ok) assembly { revert(add(ret, 32), mload(ret)) }\n        }\n    }\n}\n```\n\n개념적인 트랜잭션(의사 코드. 타입 바이트는 할당된 적이 없음):\n\n```text\ntx = DelegateTx(\n  chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n  destination = Batch,\n  data = run([ (token, approve(router, amt)), (router, swap(...)) ]),\n  access_list = []\n)\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 네트워크 업그레이드에 포함되도록 예정된 적이 없습니다.\n- \"EOA가 코드를 실행하게 한다\"는 목표는 결국 [EIP-7702](/eip-7702/)로 달성되었으며, 이는 일회성 delegate call 트랜잭션을 추가하는 대신 EOA에 위임 지정자를 설정합니다. 실제 배포에는 7702(또는 [ERC-4337](/eip-4337/) 스마트 계정)를 사용하세요.\n- [EIP-3074](/eip-3074/)와 비교하면 사용자는 재사용 가능한 인가가 아니라 트랜잭션 전체에 서명하므로, 지갑이 무엇이 실행될지 정확히 시뮬레이션할 수 있습니다.\n- delegate 트랜잭션은 대상 코드에 서명자의 자산에 대한 완전한 권한을 줍니다. 지갑은 잘 알려져 있고 감사를 거친 대상만 허용해야 합니다.\n"},"zh":{"lang":"zh","tldr":"一种拟议的交易类型，允许普通 EOA 在一笔交易中对某个合约执行 delegatecall，从而可以批量调用并以自身身份运行任意逻辑，而无需变成智能钱包。","tags":["eoa","transactions","delegatecall","batching","core"],"related":[7702,2718,7,3074,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5806/","markdown":"## 它解决什么问题？\n\n外部拥有账户（EOA）只能做两件事：发送调用或部署合约。它无法以自身身份运行自定义逻辑。这就是为什么授权（approve）再兑换（swap）一种代币需要两笔独立的交易，每笔都有自己的 21,000 gas 开销和手续费，并且在这期间存在一个已开启的授权可能被滥用的窗口。\n\n智能合约钱包可以解决这个问题，但大多数用户仍然持有 EOA，而且有些资产无法转移到新地址。EIP-5806 提出了一个小改动：让 EOA 在一笔交易期间，对其选定的合约执行**委托调用**（delegate call，合约在 [EIP-7](/eip-7/) 中获得的同一机制）。它明确不以成为完整的账户抽象设计为目标。\n\n## 它如何运作\n\n- 一种新的 [EIP-2718](/eip-2718/) 类型化交易（类型编号待定），载荷为：\n  `rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, data, access_list, y_parity, r, s])`\n- 费用字段遵循 EIP-1559 的语义。**没有 `value` 字段**，并且 `destination` 必须是真实地址（不能是合约创建）。\n- 固有 gas 与 [EIP-2930](/eip-2930/) 交易相同。\n- 执行时在**发送者的上下文中**运行 `destination` 处的代码：`address(this)` 是该 EOA，事件从该 EOA 发出，任何对外的 `CALL` 都以该 EOA 作为 `msg.sender`。\n- 出于安全考虑，有些操作码在 EOA 上下文中直接执行时会抛出异常：\n  - `SSTORE`：EOA 上没有存储（避免存储布局冲突和未来的迁移问题）。\n  - `CREATE`、`CREATE2`、`SELFDESTRUCT`：这些可能改变 EOA 的 nonce，破坏\"nonce 连续\"的假设。\n  被委托代码*所调用的*合约不受影响，可以正常使用这些操作码。\n\n## 示例代码\n\n典型用法是通过 multicall 风格的合约进行批处理。被委托的代码以 EOA 身份运行，因此每个子调用的 `msg.sender` 都是用户：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\n/// Target for a delegate transaction. Uses no SSTORE/CREATE, as required.\ncontract Batch {\n    struct Call { address target; bytes data; }\n\n    function run(Call[] calldata calls) external {\n        for (uint256 i = 0; i \u003c calls.length; i++) {\n            (bool ok, bytes memory ret) = calls[i].target.call(calls[i].data);\n            if (!ok) assembly { revert(add(ret, 32), mload(ret)) }\n        }\n    }\n}\n```\n\n概念性的交易（伪代码；类型字节从未被分配）：\n\n```text\ntx = DelegateTx(\n  chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n  destination = Batch,\n  data = run([ (token, approve(router, amt)), (router, swap(...)) ]),\n  access_list = []\n)\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。它从未被排入任何网络升级。\n- \"让 EOA 运行代码\"这一目标最终由 [EIP-7702](/eip-7702/) 实现，它在 EOA 上设置一个委托标识符，而不是新增一次性的委托调用交易。实际部署请使用 7702（或 [ERC-4337](/eip-4337/) 智能账户）。\n- 与 [EIP-3074](/eip-3074/) 相比，用户签署的是整笔交易，而不是可重复使用的授权，因此钱包可以精确模拟将要运行的内容。\n- 委托交易会让目标代码对签名者的资产拥有完全的控制权。钱包应当只允许众所周知、经过审计的目标。\n"}}}
