ERC-7897 · Withdrawn · ERC · 2024-04-15
ERC-7897: Wallet-Linked Services for Smart Accounts
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.
What problem does it solve?
Smart accounts built on ERC-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.
The idea borrows from ERC-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.
How it works
- A single registry exposes
deployService(implementation, salt, wallet)and a viewserviceAddress(implementation, salt, chainId, wallet). - Each service is deployed with CREATE2 as an ERC-1167 minimal proxy. After the standard proxy bytecode, the registry appends
salt,chainIdand thewalletaddress as immutable data. The address is therefore deterministic: anyone can compute it before deployment. - Deploying is permissionless and idempotent: if the service already exists, the registry just returns its address.
- Services should implement
wallet()returning(chainId, wallet)and treat that wallet as their owner for access control.
Sample code
Service contract that reads its owner from the linked wallet:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC7897Service {
function wallet() external view returns (uint256 chainId, address wallet);
}
abstract contract WalletLinkedService is IERC7897Service {
function owner() public view returns (address) {
(, address w) = IERC7897Service(address(this)).wallet();
return w;
}
modifier onlyOwner() {
require(msg.sender == owner(), "Unauthorized");
_;
}
}
Predicting the address off-chain (ethers v6):
const registry = new Contract(registryAddress, [
"function serviceAddress(address,bytes32,uint256,address) view returns (address)",
], provider);
const addr = await registry.serviceAddress(impl, ZeroHash, chainId, walletAddress);
Things to know
- Status is Withdrawn. The author notes it is no longer needed because the same result can be achieved with ERC-7656, a generalized registry for contracts linked to any owner. Use ERC-7656 for new work.
wallet()reads data embedded in the proxy bytecode, so the linked wallet can never change for a given service address.- 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.