{"eip":7779,"title":"Interoperable Delegated Accounts","description":"Interface for delegated externally owned accounts to enable better redelegation between wallets.","authors":["David Kim (@PowerStream3604)","Richard Meissner (@rmeissner)","Akshay Patel (@akshay-ap)","Joshua Kim (@LightningHun)","Fangting (@trinity-0111)","Yoav Weiss (@yoavw)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-10-02","requires":[7201,7702],"discussionsTo":"https://ethereum-magicians.org/t/erc-7779-interoperable-delegated-account/21237","repo":"ERCs","label":"ERC-7779","officialUrl":"https://eips.ethereum.org/EIPS/eip-7779","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7779.md","url":"https://eips.huatuo.xyz/eip-7779/","tldr":{"en":"Draft interface for EIP-7702 delegated EOAs to report which storage areas they use and optionally clean up, so users can switch wallet implementations without storage collisions.","ja":"EIP-7702 で委任された EOA が、使用しているストレージ領域を報告し、任意でクリーンアップできるようにするインターフェースのドラフト。ユーザーがストレージの衝突なしにウォレット実装を切り替えられるようにする。","ko":"EIP-7702로 위임된 EOA가 자신이 사용하는 스토리지 영역을 보고하고, 선택적으로 정리할 수 있게 하는 인터페이스 초안. 사용자가 스토리지 충돌 없이 지갑 구현을 바꿀 수 있게 한다.","zh":"草案接口：让 EIP-7702 委托的 EOA 报告自己使用了哪些存储区域，并可选地进行清理，使用户在切换钱包实现时不会发生存储冲突。"},"tags":["account-abstraction","eip-7702","wallets","storage","interoperability"],"explainers":{"en":{"lang":"en","tldr":"Draft interface for EIP-7702 delegated EOAs to report which storage areas they use and optionally clean up, so users can switch wallet implementations without storage collisions.","tags":["account-abstraction","eip-7702","wallets","storage","interoperability"],"related":[7702,7201,2535],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7779/","markdown":"## What problem does it solve?\n\nWith [EIP-7702](/eip-7702/), an EOA can point its code at a smart-account implementation and gain features such as batching and gas sponsorship. The account's **storage**, however, stays with the address. If a user moves from Wallet A's implementation to Wallet B's, B's code runs on top of whatever A left in storage.\n\nIf the two layouts overlap, the result can be a locked account, broken logic, or a hidden extra signer left behind on purpose. EOA users are used to moving their seed phrase between wallets freely; ERC-7779 tries to keep that freedom for delegated EOAs.\n\n## How it works\n\nTwo interfaces:\n\n**`IInteroperableDelegatedAccount`** (required)\n\n- `accountId()` returns a free-form name for the implementation, for example a version plus wallet name. A new wallet can show \"migrate from Wallet A to Wallet B\".\n- `accountStorageBases()` returns every base storage slot this address has used, across all implementations it has been delegated to.\n  - Bases must be computed with `keccak256` (namespaced storage in the style of [ERC-7201](/eip-7201/)).\n  - The list is an append-only `bytes32[]` stored at `keccak(keccak('InteroperableDelegatedAccount.ERC.Storage') - 1) \u0026 ~0xff`. Each new implementation appends its base when it is initialised.\n  - An implementation using an external storage contract returns the ERC number repeated as a prefix followed by that contract's address.\n\n**`IRedelegableDelegatedAccount`** (optional)\n\n- `onRedelegation()` is called by the owner before switching implementations. It should clear as much of the account's storage as practical and run any wallet-specific preparation.\n\nA wallet about to redelegate reads the storage bases, checks that its own base does not collide, inspects suspicious values if it does, and can refuse the delegation.\n\n## Sample code\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IInteroperableDelegatedAccount {\n    function accountId() external view returns (string memory);\n    function accountStorageBases() external view returns (bytes32[] memory);\n}\n\ninterface IRedelegableDelegatedAccount {\n    function onRedelegation() external returns (bool);\n}\n```\n\nA wallet checking an address before redelegating (ethers v6):\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst acct = new Contract(eoa, [\n  \"function accountId() view returns (string)\",\n  \"function accountStorageBases() view returns (bytes32[])\",\n], provider);\n\nconst myBase = keccak256(toUtf8Bytes(\"WalletB.Account.v1\")); // whatever your impl uses\nconst [id, bases] = await Promise.all([acct.accountId(), acct.accountStorageBases()]);\nif (bases.includes(myBase)) {\n  console.warn(`Storage base already used by ${id}; inspect storage before delegating`);\n}\n```\n\n## Things to know\n\n- Status is **Draft**.\n- Compliance cannot be enforced by the protocol. A malicious implementation can lie about its storage bases or leave data behind. The spec recommends confirming the account runs a known, audited implementation and scanning storage where it matters.\n- `onRedelegation()` must authenticate the owner and must not reset replay protection (nonces), or old signatures could be replayed.\n- After cleanup, the old initializer must not be callable by anyone else, otherwise an attacker could re-initialise the account.\n- The approach is borrowed from practices such as Diamond facet storage checks ([ERC-2535](/eip-2535/)) and applies to any contract using custom storage slots, not only 7702 accounts.\n"},"ja":{"lang":"ja","tldr":"EIP-7702 で委任された EOA が、使用しているストレージ領域を報告し、任意でクリーンアップできるようにするインターフェースのドラフト。ユーザーがストレージの衝突なしにウォレット実装を切り替えられるようにする。","tags":["account-abstraction","eip-7702","wallets","storage","interoperability"],"related":[7702,7201,2535],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7779/","markdown":"## 何を解決するのか\n\n[EIP-7702](/eip-7702/) を使うと、EOA は自分のコードをスマートアカウントの実装に向け、バッチ処理や gas スポンサーなどの機能を得られます。ただし、アカウントの**ストレージ**はアドレスに残ったままです。ユーザーがウォレット A の実装からウォレット B の実装に移ると、B のコードは A がストレージに残したものの上で動くことになります。\n\n2 つのレイアウトが重なると、アカウントがロックされる、ロジックが壊れる、意図的に隠された追加の署名者が残される、といった結果になりえます。EOA のユーザーはシードフレーズをウォレット間で自由に移すことに慣れています。ERC-7779 は、委任された EOA にもその自由を保とうとするものです。\n\n## 仕組み\n\n2 つのインターフェースがあります。\n\n**`IInteroperableDelegatedAccount`**（必須）\n\n- `accountId()` は実装の自由形式の名前（たとえばバージョンとウォレット名）を返します。新しいウォレットは「ウォレット A からウォレット B へ移行」と表示できます。\n- `accountStorageBases()` は、このアドレスがこれまでに委任されたすべての実装にわたって使用した、ベースとなるストレージスロットをすべて返します。\n  - ベースは `keccak256` で計算しなければなりません（[ERC-7201](/eip-7201/) 形式の名前空間付きストレージ）。\n  - リストは追記専用の `bytes32[]` で、`keccak(keccak('InteroperableDelegatedAccount.ERC.Storage') - 1) \u0026 ~0xff` に保存されます。各実装は初期化されるときに自分のベースを追加します。\n  - 外部のストレージコントラクトを使う実装は、ERC 番号をプレフィックスとして繰り返したものに、そのコントラクトのアドレスを続けて返します。\n\n**`IRedelegableDelegatedAccount`**（任意）\n\n- `onRedelegation()` は、実装を切り替える前に所有者から呼び出されます。実用上可能な範囲でアカウントのストレージをできるだけクリアし、ウォレット固有の準備を実行するべきです。\n\n再委任しようとしているウォレットは、ストレージのベースを読み取り、自分のベースが衝突しないことを確認し、衝突する場合は疑わしい値を調べ、委任を拒否することもできます。\n\n## サンプルコード\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IInteroperableDelegatedAccount {\n    function accountId() external view returns (string memory);\n    function accountStorageBases() external view returns (bytes32[] memory);\n}\n\ninterface IRedelegableDelegatedAccount {\n    function onRedelegation() external returns (bool);\n}\n```\n\n再委任の前にウォレットがアドレスをチェックする例（ethers v6）:\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst acct = new Contract(eoa, [\n  \"function accountId() view returns (string)\",\n  \"function accountStorageBases() view returns (bytes32[])\",\n], provider);\n\nconst myBase = keccak256(toUtf8Bytes(\"WalletB.Account.v1\")); // whatever your impl uses\nconst [id, bases] = await Promise.all([acct.accountId(), acct.accountStorageBases()]);\nif (bases.includes(myBase)) {\n  console.warn(`Storage base already used by ${id}; inspect storage before delegating`);\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。\n- 準拠をプロトコルで強制することはできません。悪意のある実装は、ストレージのベースについて嘘をついたり、データを残したままにしたりできます。仕様は、アカウントが既知の監査済みの実装で動いていることを確認し、重要な場面ではストレージをスキャンすることを推奨しています。\n- `onRedelegation()` は所有者を認証しなければならず、リプレイ保護（nonce）をリセットしてはいけません。さもないと、古い署名がリプレイされる可能性があります。\n- クリーンアップの後、古い初期化関数が他の誰にも呼び出せないようにしなければなりません。さもないと、攻撃者がアカウントを再初期化できてしまいます。\n- このアプローチは、Diamond の facet ストレージチェック（[ERC-2535](/eip-2535/)）などの慣行から借りたもので、7702 アカウントに限らず、カスタムストレージスロットを使うあらゆるコントラクトに当てはまります。\n"},"ko":{"lang":"ko","tldr":"EIP-7702로 위임된 EOA가 자신이 사용하는 스토리지 영역을 보고하고, 선택적으로 정리할 수 있게 하는 인터페이스 초안. 사용자가 스토리지 충돌 없이 지갑 구현을 바꿀 수 있게 한다.","tags":["account-abstraction","eip-7702","wallets","storage","interoperability"],"related":[7702,7201,2535],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7779/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-7702](/eip-7702/)를 쓰면 EOA가 자신의 코드를 스마트 계정 구현으로 향하게 해 배치 처리나 가스 스폰서십 같은 기능을 얻을 수 있습니다. 하지만 계정의 **스토리지**는 주소에 그대로 남습니다. 사용자가 지갑 A의 구현에서 지갑 B의 구현으로 옮기면, B의 코드는 A가 스토리지에 남긴 내용 위에서 실행됩니다.\n\n두 레이아웃이 겹치면 계정이 잠기거나, 로직이 깨지거나, 의도적으로 숨겨 둔 추가 서명자가 남을 수 있습니다. EOA 사용자는 시드 구문을 지갑 사이에서 자유롭게 옮기는 데 익숙합니다. ERC-7779는 위임된 EOA에도 그 자유를 지켜 주려는 시도입니다.\n\n## 어떻게 동작하나요?\n\n인터페이스는 두 가지입니다.\n\n**`IInteroperableDelegatedAccount`**(필수)\n\n- `accountId()`는 구현의 자유 형식 이름(예: 버전과 지갑 이름)을 반환합니다. 새 지갑은 \"지갑 A에서 지갑 B로 마이그레이션\"을 표시할 수 있습니다.\n- `accountStorageBases()`는 이 주소가 위임되었던 모든 구현에 걸쳐 사용한 기본 스토리지 슬롯을 전부 반환합니다.\n  - 기본 슬롯은 `keccak256`으로 계산해야 합니다([ERC-7201](/eip-7201/) 방식의 네임스페이스 스토리지).\n  - 목록은 추가만 가능한 `bytes32[]`이며 `keccak(keccak('InteroperableDelegatedAccount.ERC.Storage') - 1) \u0026 ~0xff`에 저장됩니다. 각 새 구현은 초기화될 때 자신의 기본 슬롯을 추가합니다.\n  - 외부 스토리지 컨트랙트를 쓰는 구현은 ERC 번호를 접두어로 반복한 값 뒤에 그 컨트랙트의 주소를 붙여 반환합니다.\n\n**`IRedelegableDelegatedAccount`**(선택)\n\n- `onRedelegation()`은 소유자가 구현을 바꾸기 전에 호출합니다. 현실적으로 가능한 한 계정의 스토리지를 비우고, 지갑별 준비 작업을 실행해야 합니다.\n\n재위임하려는 지갑은 스토리지 기본 슬롯을 읽고, 자신의 기본 슬롯이 충돌하지 않는지 확인하며, 충돌하면 의심스러운 값을 살펴보고 위임을 거부할 수 있습니다.\n\n## 샘플 코드\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IInteroperableDelegatedAccount {\n    function accountId() external view returns (string memory);\n    function accountStorageBases() external view returns (bytes32[] memory);\n}\n\ninterface IRedelegableDelegatedAccount {\n    function onRedelegation() external returns (bool);\n}\n```\n\n재위임 전에 지갑이 주소를 확인하는 예(ethers v6):\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst acct = new Contract(eoa, [\n  \"function accountId() view returns (string)\",\n  \"function accountStorageBases() view returns (bytes32[])\",\n], provider);\n\nconst myBase = keccak256(toUtf8Bytes(\"WalletB.Account.v1\")); // whatever your impl uses\nconst [id, bases] = await Promise.all([acct.accountId(), acct.accountStorageBases()]);\nif (bases.includes(myBase)) {\n  console.warn(`Storage base already used by ${id}; inspect storage before delegating`);\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다.\n- 준수 여부는 프로토콜이 강제할 수 없습니다. 악의적인 구현은 자신의 스토리지 기본 슬롯을 속이거나 데이터를 남겨 둘 수 있습니다. 스펙은 계정이 알려진 감사된 구현을 실행하는지 확인하고, 중요한 곳에서는 스토리지를 스캔할 것을 권장합니다.\n- `onRedelegation()`은 소유자를 인증해야 하며, 재생 방지(nonce)를 초기화해서는 안 됩니다. 그렇지 않으면 오래된 서명이 재생될 수 있습니다.\n- 정리 후에는 예전 initializer를 다른 누구도 호출할 수 없어야 합니다. 그렇지 않으면 공격자가 계정을 재초기화할 수 있습니다.\n- 이 접근은 Diamond facet 스토리지 검사([ERC-2535](/eip-2535/)) 같은 관행에서 빌려 온 것으로, 7702 계정뿐 아니라 커스텀 스토리지 슬롯을 쓰는 모든 컨트랙트에 적용됩니다.\n"},"zh":{"lang":"zh","tldr":"草案接口：让 EIP-7702 委托的 EOA 报告自己使用了哪些存储区域，并可选地进行清理，使用户在切换钱包实现时不会发生存储冲突。","tags":["account-abstraction","eip-7702","wallets","storage","interoperability"],"related":[7702,7201,2535],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7779/","markdown":"## 它解决什么问题？\n\n借助 [EIP-7702](/eip-7702/)，EOA 可以把自己的代码指向某个智能账户实现，获得批量交易、gas 代付等功能。然而账户的**存储**仍然属于该地址。如果用户从钱包 A 的实现迁移到钱包 B 的实现，B 的代码就会在 A 留在存储里的内容之上运行。\n\n如果两者的布局有重叠，结果可能是账户被锁死、逻辑损坏，或者留下一个被故意隐藏的额外签名者。EOA 用户习惯在不同钱包之间自由迁移助记词；ERC-7779 试图为被委托的 EOA 保留这种自由。\n\n## 它如何运作\n\n两个接口：\n\n**`IInteroperableDelegatedAccount`**（必需）\n\n- `accountId()` 返回实现的自由格式名称，例如版本加钱包名称。新钱包可以显示\"从钱包 A 迁移到钱包 B\"。\n- `accountStorageBases()` 返回该地址在它被委托过的所有实现中用过的每一个基础存储槽。\n  - 基础槽必须用 `keccak256` 计算（采用 [ERC-7201](/eip-7201/) 风格的命名空间存储）。\n  - 该列表是一个只追加的 `bytes32[]`，存放在 `keccak(keccak('InteroperableDelegatedAccount.ERC.Storage') - 1) \u0026 ~0xff`。每个新实现在初始化时追加自己的基础槽。\n  - 使用外部存储合约的实现，返回重复作为前缀的 ERC 编号，后面跟着该合约的地址。\n\n**`IRedelegableDelegatedAccount`**（可选）\n\n- `onRedelegation()` 由所有者在切换实现之前调用。它应当在可行范围内尽可能清空账户的存储，并执行钱包特定的准备工作。\n\n准备重新委托的钱包会读取存储基础槽，检查自己的基础槽是否冲突；如有冲突，则检查可疑的值，并且可以拒绝这次委托。\n\n## 示例代码\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ninterface IInteroperableDelegatedAccount {\n    function accountId() external view returns (string memory);\n    function accountStorageBases() external view returns (bytes32[] memory);\n}\n\ninterface IRedelegableDelegatedAccount {\n    function onRedelegation() external returns (bool);\n}\n```\n\n钱包在重新委托之前检查某个地址（ethers v6）：\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst acct = new Contract(eoa, [\n  \"function accountId() view returns (string)\",\n  \"function accountStorageBases() view returns (bytes32[])\",\n], provider);\n\nconst myBase = keccak256(toUtf8Bytes(\"WalletB.Account.v1\")); // whatever your impl uses\nconst [id, bases] = await Promise.all([acct.accountId(), acct.accountStorageBases()]);\nif (bases.includes(myBase)) {\n  console.warn(`Storage base already used by ${id}; inspect storage before delegating`);\n}\n```\n\n## 需要注意\n\n- 状态为 **Draft**。\n- 协议无法强制合规。恶意实现可以谎报自己的存储基础槽，或把数据留在原处。规范建议确认账户运行的是已知且经过审计的实现，并在重要场合扫描存储。\n- `onRedelegation()` 必须验证所有者身份，且不得重置重放保护（nonce），否则旧签名可能被重放。\n- 清理之后，旧的初始化函数不能被其他任何人调用，否则攻击者可能重新初始化账户。\n- 这种做法借鉴了 Diamond facet 存储检查（[ERC-2535](/eip-2535/)）等实践，适用于任何使用自定义存储槽的合约，而不仅仅是 7702 账户。\n"}}}
