{"eip":725,"title":"General data key/value store and execution","description":"An interface for a smart contract based account with attachable data key/value store","authors":["Fabian Vogelsteller (@frozeman)","Tyler Yasaka (@tyleryasaka)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2017-10-02","requires":[165,173],"discussionsTo":"https://ethereum-magicians.org/t/discussion-for-eip725/12158","repo":"ERCs","label":"ERC-725","officialUrl":"https://eips.ethereum.org/EIPS/eip-725","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-725.md","url":"https://eips.huatuo.xyz/eip-725/","tldr":{"en":"Two building blocks for smart contract accounts: ERC725X, a generic owner-only execute function, and ERC725Y, a bytes32-keyed data store for upgradable metadata.","ja":"スマートコントラクトアカウントの 2 つの構成要素。汎用のオーナー専用実行関数である ERC725X と、アップグレード可能なメタデータのための bytes32 キーのデータストアである ERC725Y。","ko":"스마트 컨트랙트 계정을 위한 두 가지 구성 요소. 소유자만 쓸 수 있는 범용 실행 함수 ERC725X와, 업그레이드 가능한 메타데이터를 위한 bytes32 키 데이터 저장소 ERC725Y.","zh":"智能合约账户的两个构件：ERC725X 是通用的仅所有者可调用的执行函数，ERC725Y 是以 bytes32 为键、用于可升级元数据的数据存储。"},"tags":["account","smart-wallet","identity","key-value","draft"],"explainers":{"en":{"lang":"en","tldr":"Two building blocks for smart contract accounts: ERC725X, a generic owner-only execute function, and ERC725Y, a bytes32-keyed data store for upgradable metadata.","tags":["account","smart-wallet","identity","key-value","draft"],"related":[165,173,1014,4337,6551],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-725/","markdown":"## What problem does it solve?\n\nA smart contract can act as an account (it can hold assets and call other contracts) and it can carry information about itself (a profile, permissions, links). Before ERC-725, every project invented its own function names for both, so wallets and dapps could not treat these contracts in a uniform way.\n\nERC-725 defines two small, separable interfaces:\n\n- **ERC725X**: \"do something on my behalf\". One function that can call, deploy or delegate.\n- **ERC725Y**: \"store anything about me\". A key/value store whose keys are `bytes32` and values are raw `bytes`.\n\nTogether they form a flexible contract account; separately, ERC725Y can add upgradable metadata to tokens, NFTs or any other contract.\n\n## How it works\n\n**Ownership.** The contract has one owner (an EOA or another contract), following [ERC-173](/eip-173/) (`owner()`, `transferOwnership()`). Only the owner may execute or write data.\n\n**ERC725X** (interface ID `0x7545acac`):\n\n| `operationType` | Action |\n| --- | --- |\n| `0` | `CALL` |\n| `1` | `CREATE` |\n| `2` | `CREATE2` (salt appended to `data`, see [EIP-1014](/eip-1014/)) |\n| `3` | `STATICCALL` |\n| `4` | `DELEGATECALL` (dangerous) |\n\n`execute(operationType, target, value, data)` runs one operation and `executeBatch(...)` runs several. Events `Executed` and `ContractCreated` record what happened.\n\n**ERC725Y** (interface ID `0x629aa694`): `getData(key)`, `getDataBatch(keys)`, `setData(key, value)`, `setDataBatch(keys, values)`, plus a `DataChanged` event. Keys are usually a hash of a descriptive name, e.g. `keccak256(\"MyStandardKey\")`, so different standards do not collide.\n\nBoth interfaces must be advertised with [ERC-165](/eip-165/).\n\n## Sample code\n\nUsing an ERC-725 contract (Solidity):\n\n```solidity\ninterface IERC725X {\n    function execute(uint256 operationType, address target, uint256 value, bytes calldata data)\n        external payable returns (bytes memory);\n}\ninterface IERC725Y {\n    function getData(bytes32 dataKey) external view returns (bytes memory);\n    function setData(bytes32 dataKey, bytes calldata dataValue) external;\n}\n\ncontract Owner {\n    function demo(address account, address token, address to) external {\n        // Send 100 token units from the account (operation 0 = CALL)\n        IERC725X(account).execute(\n            0, token, 0,\n            abi.encodeWithSignature(\"transfer(address,uint256)\", to, 100)\n        );\n\n        // Attach a profile pointer to the account\n        bytes32 key = keccak256(\"ProfileURI\");\n        IERC725Y(account).setData(key, bytes(\"ipfs://...\"));\n    }\n}\n```\n\nReading data off chain (ethers v6):\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes, toUtf8String } from \"ethers\";\n\nconst acct = new Contract(addr, [\"function getData(bytes32) view returns (bytes)\"], provider);\nconst raw = await acct.getData(keccak256(toUtf8Bytes(\"ProfileURI\")));\nconsole.log(toUtf8String(raw));\n```\n\n## Things to know\n\n- **This proposal is still a Draft.** The interface has changed over the years: older versions used overloaded `getData(bytes32[])` and `execute(...[])`, which were renamed to the `...Batch` functions in 2023. Check which version a contract implements via its ERC-165 interface IDs.\n- `DELEGATECALL` (operation `4`) runs foreign code in the account's own storage. It can overwrite the owner or data, or self-destruct the account. Only delegate to code you fully trust.\n- Generic execution means reentrancy and call-chain attacks need extra care.\n- The full account profile built on ERC-725 is standardized outside the EIP process as `LSP0-ERC725Account`, with `LSP2` defining typed data keys.\n- For the more widely used smart account path, see [ERC-4337](/eip-4337/). For accounts owned by NFTs, see [ERC-6551](/eip-6551/).\n"},"ja":{"lang":"ja","tldr":"スマートコントラクトアカウントの 2 つの構成要素。汎用のオーナー専用実行関数である ERC725X と、アップグレード可能なメタデータのための bytes32 キーのデータストアである ERC725Y。","tags":["account","smart-wallet","identity","key-value","draft"],"related":[165,173,1014,4337,6551],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-725/","markdown":"## 何を解決するのか\n\nスマートコントラクトはアカウントとして振る舞い（資産を保有し、他のコントラクトを呼び出せます）、自身に関する情報（プロフィール、権限、リンクなど）も持てます。ERC-725 以前は、プロジェクトごとにこの両方に独自の関数名が考案されていたため、ウォレットや dapp はこうしたコントラクトを統一的に扱えませんでした。\n\nERC-725 は、分離可能な 2 つの小さなインターフェースを定義します。\n\n- **ERC725X**: 「私の代わりに何かを実行する」。呼び出し、デプロイ、委譲ができる 1 つの関数。\n- **ERC725Y**: 「私に関する何かを保存する」。キーが `bytes32`、値が生の `bytes` のキー／バリューストア。\n\n2 つを合わせると柔軟なコントラクトアカウントになります。単独でも、ERC725Y はトークン、NFT、その他任意のコントラクトにアップグレード可能なメタデータを追加できます。\n\n## 仕組み\n\n**所有権。** コントラクトには 1 人のオーナー（EOA または別のコントラクト）がおり、[ERC-173](/eip-173/)（`owner()`、`transferOwnership()`）に従います。実行やデータの書き込みができるのはオーナーだけです。\n\n**ERC725X**（インターフェース ID `0x7545acac`）:\n\n| `operationType` | 動作 |\n| --- | --- |\n| `0` | `CALL` |\n| `1` | `CREATE` |\n| `2` | `CREATE2`（salt は `data` の末尾に付加。[EIP-1014](/eip-1014/) を参照） |\n| `3` | `STATICCALL` |\n| `4` | `DELEGATECALL`（危険） |\n\n`execute(operationType, target, value, data)` は 1 つの操作を実行し、`executeBatch(...)` は複数を実行します。イベント `Executed` と `ContractCreated` が実行内容を記録します。\n\n**ERC725Y**（インターフェース ID `0x629aa694`）: `getData(key)`、`getDataBatch(keys)`、`setData(key, value)`、`setDataBatch(keys, values)` と、`DataChanged` イベント。キーは通常、説明的な名前のハッシュ（例: `keccak256(\"MyStandardKey\")`）で、標準同士が衝突しないようになっています。\n\nどちらのインターフェースも [ERC-165](/eip-165/) で通知する必要があります。\n\n## サンプルコード\n\nERC-725 コントラクトの利用（Solidity）:\n\n```solidity\ninterface IERC725X {\n    function execute(uint256 operationType, address target, uint256 value, bytes calldata data)\n        external payable returns (bytes memory);\n}\ninterface IERC725Y {\n    function getData(bytes32 dataKey) external view returns (bytes memory);\n    function setData(bytes32 dataKey, bytes calldata dataValue) external;\n}\n\ncontract Owner {\n    function demo(address account, address token, address to) external {\n        // Send 100 token units from the account (operation 0 = CALL)\n        IERC725X(account).execute(\n            0, token, 0,\n            abi.encodeWithSignature(\"transfer(address,uint256)\", to, 100)\n        );\n\n        // Attach a profile pointer to the account\n        bytes32 key = keccak256(\"ProfileURI\");\n        IERC725Y(account).setData(key, bytes(\"ipfs://...\"));\n    }\n}\n```\n\nオフチェーンでのデータ読み取り（ethers v6）:\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes, toUtf8String } from \"ethers\";\n\nconst acct = new Contract(addr, [\"function getData(bytes32) view returns (bytes)\"], provider);\nconst raw = await acct.getData(keccak256(toUtf8Bytes(\"ProfileURI\")));\nconsole.log(toUtf8String(raw));\n```\n\n## 知っておくべきこと\n\n- **この提案はまだ Draft です。** インターフェースは年月とともに変化しました。古いバージョンはオーバーロードされた `getData(bytes32[])` と `execute(...[])` を使っていましたが、2023 年に `...Batch` 関数へ名称変更されました。コントラクトがどのバージョンを実装しているかは、ERC-165 のインターフェース ID で確認してください。\n- `DELEGATECALL`（操作 `4`）は、他者のコードをアカウント自身のストレージ上で実行します。オーナーやデータを上書きしたり、アカウントを自己破壊したりできます。完全に信頼できるコードにのみ委譲してください。\n- 汎用的な実行は、リエントランシーや呼び出しチェーン攻撃に対して追加の注意が必要です。\n- ERC-725 を土台にした完全なアカウントプロファイルは、EIP プロセスの外で `LSP0-ERC725Account` として標準化されており、`LSP2` が型付きデータキーを定義しています。\n- より広く使われているスマートアカウントの道筋については [ERC-4337](/eip-4337/) を、NFT が所有するアカウントについては [ERC-6551](/eip-6551/) を参照してください。\n"},"ko":{"lang":"ko","tldr":"스마트 컨트랙트 계정을 위한 두 가지 구성 요소. 소유자만 쓸 수 있는 범용 실행 함수 ERC725X와, 업그레이드 가능한 메타데이터를 위한 bytes32 키 데이터 저장소 ERC725Y.","tags":["account","smart-wallet","identity","key-value","draft"],"related":[165,173,1014,4337,6551],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-725/","markdown":"## 어떤 문제를 해결하나요?\n\n스마트 컨트랙트는 계정처럼 동작할 수 있고(자산을 보유하고 다른 컨트랙트를 호출할 수 있습니다), 자기 자신에 대한 정보(프로필, 권한, 링크 등)도 담을 수 있습니다. ERC-725 이전에는 프로젝트마다 이 둘에 대해 자기만의 함수 이름을 만들어 냈기 때문에, 지갑과 dapp이 이런 컨트랙트를 일관되게 다룰 수 없었습니다.\n\nERC-725는 분리할 수 있는 작은 인터페이스 두 개를 정의합니다.\n\n- **ERC725X**: \"나를 대신해 무언가를 실행한다\". 호출, 배포, 위임을 할 수 있는 함수 하나.\n- **ERC725Y**: \"나에 대한 무엇이든 저장한다\". 키는 `bytes32`, 값은 원시 `bytes`인 키/값 저장소.\n\n둘을 합치면 유연한 컨트랙트 계정이 됩니다. 따로 쓰면 ERC725Y는 토큰, NFT 또는 다른 어떤 컨트랙트에든 업그레이드 가능한 메타데이터를 추가할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n**소유권.** 컨트랙트에는 [ERC-173](/eip-173/)(`owner()`, `transferOwnership()`)에 따라 소유자 한 명(EOA 또는 다른 컨트랙트)이 있습니다. 소유자만 실행하거나 데이터를 쓸 수 있습니다.\n\n**ERC725X**(인터페이스 ID `0x7545acac`):\n\n| `operationType` | 동작 |\n| --- | --- |\n| `0` | `CALL` |\n| `1` | `CREATE` |\n| `2` | `CREATE2` (salt는 `data` 뒤에 붙음, [EIP-1014](/eip-1014/) 참고) |\n| `3` | `STATICCALL` |\n| `4` | `DELEGATECALL` (위험) |\n\n`execute(operationType, target, value, data)`는 연산 하나를 실행하고 `executeBatch(...)`는 여러 개를 실행합니다. `Executed`와 `ContractCreated` 이벤트가 어떤 일이 있었는지 기록합니다.\n\n**ERC725Y**(인터페이스 ID `0x629aa694`): `getData(key)`, `getDataBatch(keys)`, `setData(key, value)`, `setDataBatch(keys, values)`와 `DataChanged` 이벤트. 키는 보통 설명적인 이름의 해시(예: `keccak256(\"MyStandardKey\")`)이며, 그래서 서로 다른 표준끼리 충돌하지 않습니다.\n\n두 인터페이스 모두 [ERC-165](/eip-165/)로 알려야 합니다.\n\n## 샘플 코드\n\nERC-725 컨트랙트 사용하기(Solidity):\n\n```solidity\ninterface IERC725X {\n    function execute(uint256 operationType, address target, uint256 value, bytes calldata data)\n        external payable returns (bytes memory);\n}\ninterface IERC725Y {\n    function getData(bytes32 dataKey) external view returns (bytes memory);\n    function setData(bytes32 dataKey, bytes calldata dataValue) external;\n}\n\ncontract Owner {\n    function demo(address account, address token, address to) external {\n        // Send 100 token units from the account (operation 0 = CALL)\n        IERC725X(account).execute(\n            0, token, 0,\n            abi.encodeWithSignature(\"transfer(address,uint256)\", to, 100)\n        );\n\n        // Attach a profile pointer to the account\n        bytes32 key = keccak256(\"ProfileURI\");\n        IERC725Y(account).setData(key, bytes(\"ipfs://...\"));\n    }\n}\n```\n\n오프체인에서 데이터 읽기(ethers v6):\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes, toUtf8String } from \"ethers\";\n\nconst acct = new Contract(addr, [\"function getData(bytes32) view returns (bytes)\"], provider);\nconst raw = await acct.getData(keccak256(toUtf8Bytes(\"ProfileURI\")));\nconsole.log(toUtf8String(raw));\n```\n\n## 알아둘 점\n\n- **이 제안은 아직 Draft입니다.** 인터페이스는 몇 해 동안 바뀌었습니다. 오래된 버전은 오버로드된 `getData(bytes32[])`와 `execute(...[])`를 썼는데, 2023년에 `...Batch` 함수로 이름이 바뀌었습니다. 컨트랙트가 어느 버전을 구현하는지는 ERC-165 인터페이스 ID로 확인하세요.\n- `DELEGATECALL`(연산 `4`)은 외부 코드를 계정 자신의 스토리지에서 실행합니다. 소유자나 데이터를 덮어쓰거나 계정을 셀프디스트럭트할 수 있습니다. 완전히 신뢰하는 코드에만 위임하세요.\n- 범용 실행에서는 재진입과 호출 체인 공격에 각별한 주의가 필요합니다.\n- ERC-725 위에 만들어진 전체 계정 프로필은 EIP 프로세스 밖에서 `LSP0-ERC725Account`로 표준화되어 있으며, `LSP2`가 타입이 있는 데이터 키를 정의합니다.\n- 더 널리 쓰이는 스마트 계정 경로는 [ERC-4337](/eip-4337/)을, NFT가 소유하는 계정은 [ERC-6551](/eip-6551/)을 참고하세요.\n"},"zh":{"lang":"zh","tldr":"智能合约账户的两个构件：ERC725X 是通用的仅所有者可调用的执行函数，ERC725Y 是以 bytes32 为键、用于可升级元数据的数据存储。","tags":["account","smart-wallet","identity","key-value","draft"],"related":[165,173,1014,4337,6551],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-725/","markdown":"## 它解决什么问题？\n\n智能合约可以充当账户（它可以持有资产并调用其他合约），也可以携带关于自身的信息（资料、权限、链接）。在 ERC-725 之前，每个项目都为这两件事发明了自己的函数名，因此钱包和 dapp 无法以统一的方式对待这些合约。\n\nERC-725 定义了两个小而可分离的接口：\n\n- **ERC725X**：\"代表我执行操作\"。一个可以调用、部署或委托的函数。\n- **ERC725Y**：\"存储关于我的任何信息\"。一个键为 `bytes32`、值为原始 `bytes` 的键值存储。\n\n两者合在一起构成灵活的合约账户；单独使用时，ERC725Y 可以为代币、NFT 或任何其他合约添加可升级的元数据。\n\n## 它如何运作\n\n**所有权。** 合约有一个所有者（EOA 或另一个合约），遵循 [ERC-173](/eip-173/)（`owner()`、`transferOwnership()`）。只有所有者可以执行操作或写入数据。\n\n**ERC725X**（接口 ID `0x7545acac`）：\n\n| `operationType` | 动作 |\n| --- | --- |\n| `0` | `CALL` |\n| `1` | `CREATE` |\n| `2` | `CREATE2`（salt 附加在 `data` 后面，见 [EIP-1014](/eip-1014/)） |\n| `3` | `STATICCALL` |\n| `4` | `DELEGATECALL`（危险） |\n\n`execute(operationType, target, value, data)` 运行一个操作，`executeBatch(...)` 运行多个操作。事件 `Executed` 和 `ContractCreated` 记录发生了什么。\n\n**ERC725Y**（接口 ID `0x629aa694`）：`getData(key)`、`getDataBatch(keys)`、`setData(key, value)`、`setDataBatch(keys, values)`，以及 `DataChanged` 事件。键通常是描述性名称的哈希，例如 `keccak256(\"MyStandardKey\")`，这样不同标准之间不会冲突。\n\n两个接口都必须通过 [ERC-165](/eip-165/) 声明。\n\n## 示例代码\n\n使用 ERC-725 合约（Solidity）：\n\n```solidity\ninterface IERC725X {\n    function execute(uint256 operationType, address target, uint256 value, bytes calldata data)\n        external payable returns (bytes memory);\n}\ninterface IERC725Y {\n    function getData(bytes32 dataKey) external view returns (bytes memory);\n    function setData(bytes32 dataKey, bytes calldata dataValue) external;\n}\n\ncontract Owner {\n    function demo(address account, address token, address to) external {\n        // Send 100 token units from the account (operation 0 = CALL)\n        IERC725X(account).execute(\n            0, token, 0,\n            abi.encodeWithSignature(\"transfer(address,uint256)\", to, 100)\n        );\n\n        // Attach a profile pointer to the account\n        bytes32 key = keccak256(\"ProfileURI\");\n        IERC725Y(account).setData(key, bytes(\"ipfs://...\"));\n    }\n}\n```\n\n在链下读取数据（ethers v6）：\n\n```ts\nimport { Contract, keccak256, toUtf8Bytes, toUtf8String } from \"ethers\";\n\nconst acct = new Contract(addr, [\"function getData(bytes32) view returns (bytes)\"], provider);\nconst raw = await acct.getData(keccak256(toUtf8Bytes(\"ProfileURI\")));\nconsole.log(toUtf8String(raw));\n```\n\n## 需要注意\n\n- **该提案仍处于 Draft 状态。** 接口多年来有所变化：旧版本使用重载的 `getData(bytes32[])` 和 `execute(...[])`，它们在 2023 年被重命名为 `...Batch` 函数。请通过合约的 ERC-165 接口 ID 来确认它实现的是哪个版本。\n- `DELEGATECALL`（操作 `4`）会在账户自身的存储中运行外部代码。它可能覆盖所有者或数据，或使账户自毁。只应委托给你完全信任的代码。\n- 通用执行意味着重入攻击和调用链攻击需要格外小心。\n- 基于 ERC-725 构建的完整账户配置文件在 EIP 流程之外被标准化为 `LSP0-ERC725Account`，其中 `LSP2` 定义了带类型的数据键。\n- 关于使用更广泛的智能账户路线，请参阅 [ERC-4337](/eip-4337/)。关于由 NFT 拥有的账户，请参阅 [ERC-6551](/eip-6551/)。\n"}},"requiredBy":[1078]}
