{"eip":7897,"title":"Wallet-Linked Services for Smart Accounts","description":"Define a registry for modular services linked to ERC-4337 wallets.","authors":["Francesco Sullo (@sullof)"],"status":"Withdrawn","type":"Standards Track","category":"ERC","created":"2024-04-15","requires":[165,1167,4337,6551,7656],"discussionsTo":"https://ethereum-magicians.org/t/generalized-wallet-linked-services-for-erc-4337-wallets/23028","repo":"ERCs","label":"ERC-7897","officialUrl":"https://eips.ethereum.org/EIPS/eip-7897","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7897.md","url":"https://eips.huatuo.xyz/eip-7897/","tldr":{"en":"A withdrawn proposal for a registry that deploys deterministic, wallet-owned service contracts (recovery, automation, compliance) next to any ERC-4337 smart account; ERC-7656 now covers the same need.","ja":"決定論的でウォレットが所有するサービスコントラクト（リカバリー、自動化、コンプライアンス）を、あらゆる ERC-4337 スマートアカウントの隣にデプロイするレジストリの、取り下げ済みの提案。同じニーズは現在 ERC-7656 がカバーしている。","ko":"결정론적이며 지갑이 소유하는 서비스 컨트랙트(복구, 자동화, 컴플라이언스)를 모든 ERC-4337 스마트 계정 옆에 배포하는 레지스트리에 대한, 철회된 제안. 같은 필요는 이제 ERC-7656이 다룬다.","zh":"一项已撤回的提案：设计一个注册表，在任何 ERC-4337 智能账户旁部署确定性的、由钱包拥有的服务合约（恢复、自动化、合规）；ERC-7656 现在涵盖了同样的需求。"},"tags":["account-abstraction","registry","wallet","modules","withdrawn"],"explainers":{"en":{"lang":"en","tldr":"A withdrawn proposal for a registry that deploys deterministic, wallet-owned service contracts (recovery, automation, compliance) next to any ERC-4337 smart account; ERC-7656 now covers the same need.","tags":["account-abstraction","registry","wallet","modules","withdrawn"],"related":[7656,6551,4337,1167],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7897/","markdown":"## What problem does it solve?\n\nSmart accounts built on [ERC-4337](/eip-4337/) are programmable, but adding a feature usually means installing a module inside the wallet, which depends on the wallet's own module system. ERC-7897 wanted a way to attach external services to any wallet without touching its core logic.\n\nThe idea borrows from [ERC-6551](/eip-6551/) (token-bound accounts): instead of an NFT owning a contract, a wallet owns a set of linked service contracts whose addresses can be computed in advance.\n\n## How it works\n\n- A single registry exposes `deployService(implementation, salt, wallet)` and a view `serviceAddress(implementation, salt, chainId, wallet)`.\n- Each service is deployed with CREATE2 as an [ERC-1167](/eip-1167/) minimal proxy. After the standard proxy bytecode, the registry appends `salt`, `chainId` and the `wallet` address as immutable data. The address is therefore deterministic: anyone can compute it before deployment.\n- Deploying is permissionless and idempotent: if the service already exists, the registry just returns its address.\n- Services should implement `wallet()` returning `(chainId, wallet)` and treat that wallet as their owner for access control.\n\n## Sample code\n\nService contract that reads its owner from the linked wallet:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IERC7897Service {\n    function wallet() external view returns (uint256 chainId, address wallet);\n}\n\nabstract contract WalletLinkedService is IERC7897Service {\n    function owner() public view returns (address) {\n        (, address w) = IERC7897Service(address(this)).wallet();\n        return w;\n    }\n\n    modifier onlyOwner() {\n        require(msg.sender == owner(), \"Unauthorized\");\n        _;\n    }\n}\n```\n\nPredicting the address off-chain (ethers v6):\n\n```ts\nconst registry = new Contract(registryAddress, [\n  \"function serviceAddress(address,bytes32,uint256,address) view returns (address)\",\n], provider);\nconst addr = await registry.serviceAddress(impl, ZeroHash, chainId, walletAddress);\n```\n\n## Things to know\n\n- Status is **Withdrawn**. The author notes it is no longer needed because the same result can be achieved with [ERC-7656](/eip-7656/), a generalized registry for contracts linked to any owner. Use ERC-7656 for new work.\n- `wallet()` reads data embedded in the proxy bytecode, so the linked wallet can never change for a given service address.\n- Because anyone can deploy a service for any wallet, the security of a service rests entirely on its implementation. Wallet UIs should only trust audited implementations.\n"},"ja":{"lang":"ja","tldr":"決定論的でウォレットが所有するサービスコントラクト（リカバリー、自動化、コンプライアンス）を、あらゆる ERC-4337 スマートアカウントの隣にデプロイするレジストリの、取り下げ済みの提案。同じニーズは現在 ERC-7656 がカバーしている。","tags":["account-abstraction","registry","wallet","modules","withdrawn"],"related":[7656,6551,4337,1167],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7897/","markdown":"## 何を解決するのか\n\n[ERC-4337](/eip-4337/) 上に構築されたスマートアカウントはプログラム可能ですが、機能を追加するには通常、ウォレット内にモジュールをインストールすることになり、ウォレット独自のモジュールシステムに依存します。ERC-7897 は、ウォレットのコアロジックに触れずに、外部サービスを任意のウォレットに取り付ける方法を求めていました。\n\nこの発想は [ERC-6551](/eip-6551/)（トークンバウンドアカウント）から借りています。NFT がコントラクトを所有する代わりに、ウォレットが、アドレスを事前に計算できる一連のリンクされたサービスコントラクトを所有します。\n\n## 仕組み\n\n- 単一のレジストリが `deployService(implementation, salt, wallet)` と、view 関数 `serviceAddress(implementation, salt, chainId, wallet)` を公開します。\n- 各サービスは CREATE2 で [ERC-1167](/eip-1167/) の最小プロキシとしてデプロイされます。標準のプロキシバイトコードの後に、レジストリが `salt`、`chainId`、`wallet` アドレスを不変データとして付加します。そのためアドレスは決定論的で、デプロイ前に誰でも計算できます。\n- デプロイはパーミッションレスかつ冪等です。サービスがすでに存在する場合、レジストリはそのアドレスを返すだけです。\n- サービスは `(chainId, wallet)` を返す `wallet()` を実装し、そのウォレットをアクセス制御上の所有者として扱うべきです。\n\n## サンプルコード\n\nリンクされたウォレットから所有者を読み取るサービスコントラクト:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IERC7897Service {\n    function wallet() external view returns (uint256 chainId, address wallet);\n}\n\nabstract contract WalletLinkedService is IERC7897Service {\n    function owner() public view returns (address) {\n        (, address w) = IERC7897Service(address(this)).wallet();\n        return w;\n    }\n\n    modifier onlyOwner() {\n        require(msg.sender == owner(), \"Unauthorized\");\n        _;\n    }\n}\n```\n\nアドレスをオフチェーンで予測する（ethers v6）:\n\n```ts\nconst registry = new Contract(registryAddress, [\n  \"function serviceAddress(address,bytes32,uint256,address) view returns (address)\",\n], provider);\nconst addr = await registry.serviceAddress(impl, ZeroHash, chainId, walletAddress);\n```\n\n## 知っておくべきこと\n\n- ステータスは **Withdrawn（取り下げ）** です。著者は、任意の所有者にリンクされたコントラクトのための汎用レジストリである [ERC-7656](/eip-7656/) で同じ結果を得られるため、もはや不要だと述べています。新しい作業には ERC-7656 を使ってください。\n- `wallet()` はプロキシのバイトコードに埋め込まれたデータを読むため、あるサービスアドレスにリンクされたウォレットは決して変更できません。\n- 誰でも任意のウォレットのサービスをデプロイできるため、サービスの安全性は完全にその実装にかかっています。ウォレットの UI は、監査済みの実装のみを信頼すべきです。\n"},"ko":{"lang":"ko","tldr":"결정론적이며 지갑이 소유하는 서비스 컨트랙트(복구, 자동화, 컴플라이언스)를 모든 ERC-4337 스마트 계정 옆에 배포하는 레지스트리에 대한, 철회된 제안. 같은 필요는 이제 ERC-7656이 다룬다.","tags":["account-abstraction","registry","wallet","modules","withdrawn"],"related":[7656,6551,4337,1167],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7897/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-4337](/eip-4337/) 기반 스마트 계정은 프로그래밍이 가능하지만, 기능을 추가하려면 보통 지갑 안에 모듈을 설치해야 하고 이는 지갑 자체의 모듈 시스템에 의존합니다. ERC-7897은 지갑의 핵심 로직을 건드리지 않고 외부 서비스를 어떤 지갑에든 붙이는 방법을 원했습니다.\n\n이 아이디어는 [ERC-6551](/eip-6551/)(토큰 바운드 계정)에서 빌려 왔습니다. NFT가 컨트랙트를 소유하는 대신, 지갑이 주소를 미리 계산할 수 있는 연결된 서비스 컨트랙트 묶음을 소유합니다.\n\n## 어떻게 동작하나요?\n\n- 하나의 레지스트리가 `deployService(implementation, salt, wallet)`와 view 함수 `serviceAddress(implementation, salt, chainId, wallet)`를 노출합니다.\n- 각 서비스는 CREATE2로 [ERC-1167](/eip-1167/) 최소 프록시로 배포됩니다. 표준 프록시 바이트코드 뒤에 레지스트리가 `salt`, `chainId`, `wallet` 주소를 불변 데이터로 덧붙입니다. 따라서 주소는 결정론적이며, 누구나 배포 전에 계산할 수 있습니다.\n- 배포는 허가 불필요(permissionless)이며 멱등입니다. 서비스가 이미 존재하면 레지스트리는 그 주소를 반환하기만 합니다.\n- 서비스는 `(chainId, wallet)`을 반환하는 `wallet()`을 구현하고, 그 지갑을 접근 제어상의 소유자로 취급해야 합니다.\n\n## 샘플 코드\n\n연결된 지갑에서 소유자를 읽는 서비스 컨트랙트:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IERC7897Service {\n    function wallet() external view returns (uint256 chainId, address wallet);\n}\n\nabstract contract WalletLinkedService is IERC7897Service {\n    function owner() public view returns (address) {\n        (, address w) = IERC7897Service(address(this)).wallet();\n        return w;\n    }\n\n    modifier onlyOwner() {\n        require(msg.sender == owner(), \"Unauthorized\");\n        _;\n    }\n}\n```\n\n오프체인에서 주소 예측하기(ethers v6):\n\n```ts\nconst registry = new Contract(registryAddress, [\n  \"function serviceAddress(address,bytes32,uint256,address) view returns (address)\",\n], provider);\nconst addr = await registry.serviceAddress(impl, ZeroHash, chainId, walletAddress);\n```\n\n## 알아둘 점\n\n- 상태는 **Withdrawn(철회)**입니다. 저자는 어떤 소유자에든 연결된 컨트랙트를 위한 범용 레지스트리인 [ERC-7656](/eip-7656/)으로 같은 결과를 얻을 수 있어 더 이상 필요하지 않다고 밝힙니다. 새 작업에는 ERC-7656을 사용하세요.\n- `wallet()`은 프록시 바이트코드에 내장된 데이터를 읽으므로, 특정 서비스 주소에 연결된 지갑은 결코 바뀔 수 없습니다.\n- 누구나 어떤 지갑에 대해서든 서비스를 배포할 수 있으므로, 서비스의 보안은 전적으로 그 구현에 달려 있습니다. 지갑 UI는 감사를 거친 구현만 신뢰해야 합니다.\n"},"zh":{"lang":"zh","tldr":"一项已撤回的提案：设计一个注册表，在任何 ERC-4337 智能账户旁部署确定性的、由钱包拥有的服务合约（恢复、自动化、合规）；ERC-7656 现在涵盖了同样的需求。","tags":["account-abstraction","registry","wallet","modules","withdrawn"],"related":[7656,6551,4337,1167],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7897/","markdown":"## 它解决什么问题？\n\n基于 [ERC-4337](/eip-4337/) 构建的智能账户是可编程的，但添加功能通常意味着在钱包内部安装模块，这取决于钱包自身的模块系统。ERC-7897 希望提供一种方式，在不触及钱包核心逻辑的前提下，把外部服务附加到任何钱包上。\n\n这一思路借鉴了 [ERC-6551](/eip-6551/)（代币绑定账户）：不是由 NFT 拥有合约，而是由钱包拥有一组相互关联的服务合约，这些合约的地址可以提前计算出来。\n\n## 它如何运作\n\n- 单一注册表提供 `deployService(implementation, salt, wallet)` 以及 view 函数 `serviceAddress(implementation, salt, chainId, wallet)`。\n- 每个服务通过 CREATE2 部署为 [ERC-1167](/eip-1167/) 最小代理。在标准代理字节码之后，注册表会把 `salt`、`chainId` 和 `wallet` 地址作为不可变数据追加进去。因此地址是确定性的：任何人都可以在部署前计算出来。\n- 部署无需许可且是幂等的：如果服务已存在，注册表只会返回其地址。\n- 服务应当实现返回 `(chainId, wallet)` 的 `wallet()`，并把该钱包视为其访问控制中的所有者。\n\n## 示例代码\n\n从关联钱包读取所有者的服务合约：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ninterface IERC7897Service {\n    function wallet() external view returns (uint256 chainId, address wallet);\n}\n\nabstract contract WalletLinkedService is IERC7897Service {\n    function owner() public view returns (address) {\n        (, address w) = IERC7897Service(address(this)).wallet();\n        return w;\n    }\n\n    modifier onlyOwner() {\n        require(msg.sender == owner(), \"Unauthorized\");\n        _;\n    }\n}\n```\n\n在链下预测地址（ethers v6）：\n\n```ts\nconst registry = new Contract(registryAddress, [\n  \"function serviceAddress(address,bytes32,uint256,address) view returns (address)\",\n], provider);\nconst addr = await registry.serviceAddress(impl, ZeroHash, chainId, walletAddress);\n```\n\n## 需要注意\n\n- 状态为 **Withdrawn（已撤回）**。作者指出它已不再需要，因为用 [ERC-7656](/eip-7656/)（面向任意所有者所关联合约的通用注册表）就能达到同样的效果。新的工作请使用 ERC-7656。\n- `wallet()` 读取的是嵌入在代理字节码中的数据，因此对于某个服务地址，其关联的钱包永远无法更改。\n- 由于任何人都可以为任何钱包部署服务，服务的安全性完全取决于其实现。钱包界面应当只信任经过审计的实现。\n"}}}
