{"eip":8350,"title":"Agent Memory State Registry","description":"Authorized commitments to private agent memory state transitions.","authors":["Everest An (@everest-an)","XiaoHai (@XiaoHai67890)","Luo (@lucas1968)","Eric"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2026-07-14","requires":[712,1271,7702],"discussionsTo":"https://ethereum-magicians.org/t/erc-8350-agent-memory-state-registry/29098","repo":"ERCs","label":"ERC-8350","officialUrl":"https://eips.ethereum.org/EIPS/eip-8350","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8350.md","url":"https://eips.huatuo.xyz/eip-8350/","tldr":{"en":"A registry where an AI agent's private memory updates are recorded only as signed hash commitments in a strict, gapless chain, making the agent's memory history tamper-evident and attributable without revealing any memory on-chain.","ja":"AI エージェントのプライベートなメモリの更新を、厳密で欠番のないチェーンにおける署名付きのハッシュコミットメントとしてのみ記録するレジストリ。メモリの内容をオンチェーンで一切明かさずに、エージェントのメモリ履歴を改ざん検知可能かつ帰属可能にする。","ko":"AI 에이전트의 비공개 메모리 업데이트를 엄격하고 빈틈없는 체인 속 서명된 해시 커밋먼트로만 기록하는 레지스트리. 메모리를 온체인에 전혀 공개하지 않고도 에이전트의 메모리 이력을 변조 탐지 가능하고 귀속 가능하게 만든다.","zh":"一个注册表，AI 智能体的私有记忆更新只以签名哈希承诺的形式，记录在一条严格且无间断的链中，使智能体的记忆历史可被篡改检测、可归属，而无需在链上披露任何记忆内容。"},"tags":["erc","ai-agents","commitments","eip-712","privacy"],"explainers":{"en":{"lang":"en","tldr":"A registry where an AI agent's private memory updates are recorded only as signed hash commitments in a strict, gapless chain, making the agent's memory history tamper-evident and attributable without revealing any memory on-chain.","tags":["erc","ai-agents","commitments","eip-712","privacy"],"related":[712,1271,7702,1967],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8350/","markdown":"## What problem does it solve?\n\nAI agents usually keep long-lived memory (prompts, embeddings, preferences, policies) in private databases, and publishing it on-chain would be both a privacy problem and expensive. Posting a bare content hash is not enough either: it doesn't say which earlier state it follows, whether it is the *only* valid successor, who is allowed to authorise it, or how independent implementations should compute the identifier.\n\nERC-8350 defines a minimal registry that records each memory update as a fixed-size, signed commitment and enforces a linear, gapless history per \"memory space\". Auditors and counterparties can then detect rollbacks or substitutions against a known on-chain head, and the agent can open specific commitments selectively.\n\n## How it works\n\n- **Memory Space.** Identified by `spaceId = keccak256(abi.encode(typehash, initialController, salt))`, so nobody can squat another controller's id. Each space has a **controller** (can rotate roles) and an **authorizer** (signs updates), both EOAs or contracts.\n- **ExperienceDelta.** Each update is a fixed struct: `spaceId`, `sequence` (starting at 1), `prevStateRoot`, `deltaCommitment` (required), optional `provenanceCommitment`, `profileId` (how to interpret the private data, required) and optional `locatorCommitment`. Raw memory, salts, keys and URLs never go on-chain.\n- **Transition ID and state root.** `transitionId` is the [EIP-712](/eip-712/) struct hash of the delta. The registry accepts it only if `sequence == current + 1` and `prevStateRoot == current root`, then sets `nextStateRoot = hash(prevStateRoot, transitionId)`.\n- **Signatures.** Signed under the EIP-712 domain `AgentMemoryState` / version `1` / chain id / registry address. Validation tries [ERC-1271](/eip-1271/) first when the authorizer has code, then falls back to a canonical 65-byte ECDSA signature, so [EIP-7702](/eip-7702/)-delegated EOAs keep working.\n- **Baseline commitments.** Domain-separated `keccak256(abi.encode(DOMAIN, …, salt, keccak256(payload)))`; low-entropy plaintext requires a secret salt or encryption.\n- **Immutability.** The logic enforcing linearity and signature checks must not be upgradeable; otherwise the guarantee is void even if the test vectors pass.\n\n## Sample code\n\nSigning an `ExperienceDelta` for `commitTransition` (ethers v6):\n\n```ts\nimport { Wallet, keccak256, AbiCoder, id } from \"ethers\";\n\nconst domain = { name: \"AgentMemoryState\", version: \"1\", chainId, verifyingContract: registry };\nconst types = {\n  ExperienceDelta: [\n    { name: \"spaceId\", type: \"bytes32\" },\n    { name: \"sequence\", type: \"uint64\" },\n    { name: \"prevStateRoot\", type: \"bytes32\" },\n    { name: \"deltaCommitment\", type: \"bytes32\" },\n    { name: \"provenanceCommitment\", type: \"bytes32\" },\n    { name: \"profileId\", type: \"bytes32\" },\n    { name: \"locatorCommitment\", type: \"bytes32\" },\n  ],\n};\n\nconst coder = AbiCoder.defaultAbiCoder();\nconst deltaCommitment = keccak256(coder.encode(\n  [\"bytes32\", \"bytes32\", \"bytes32\", \"bytes32\"],\n  [id(\"AgentMemoryState.deltaCommitment.v1\"), profileId, secretSalt, keccak256(ciphertext)],\n));\n\nconst [, stateRoot, seq] = await registryContract.head(spaceId);\nconst delta = {\n  spaceId, sequence: seq + 1n, prevStateRoot: stateRoot,\n  deltaCommitment, provenanceCommitment: \"0x\" + \"00\".repeat(32),\n  profileId, locatorCommitment: \"0x\" + \"00\".repeat(32),\n};\nconst sig = await authorizer.signTypedData(domain, types, delta);\nawait registryContract.commitTransition(delta, sig);\n```\n\n## Things to know\n\n- Status: **Draft**.\n- It proves only that the configured authorizer approved a given sequence of commitments. It does not prove the memory is true, available, actually used by the agent, or ever deleted.\n- Commitments still leak metadata such as update timing and frequency; reusing salts or ciphertext can reveal equality.\n- A transition reference must include the chain and registry address, since the same `spaceId` can exist on several chains and the signature depends on the registry.\n- With EIP-7702 delegation, the account's original key can still sign, so a delegate's policy is not the only authorization path.\n- To check non-upgradeability, the spec suggests confirming empty [ERC-1967](/eip-1967/) proxy slots and no admin or owner functions.\n"},"ja":{"lang":"ja","tldr":"AI エージェントのプライベートなメモリの更新を、厳密で欠番のないチェーンにおける署名付きのハッシュコミットメントとしてのみ記録するレジストリ。メモリの内容をオンチェーンで一切明かさずに、エージェントのメモリ履歴を改ざん検知可能かつ帰属可能にする。","tags":["erc","ai-agents","commitments","eip-712","privacy"],"related":[712,1271,7702,1967],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8350/","markdown":"## 何を解決するのか\n\nAI エージェントは通常、長期的なメモリ（プロンプト、埋め込み、好み、ポリシー）をプライベートなデータベースに保持しており、それをオンチェーンに公開することは、プライバシーの問題であると同時に高コストでもあります。単なるコンテンツのハッシュを投稿するだけでも不十分です。それがどの以前の状態に続くのか、それが*唯一*有効な後継なのか、誰がそれを承認してよいのか、独立した実装が識別子をどう計算すべきなのかが、わからないからです。\n\nERC-8350 は、各メモリ更新を固定サイズの署名付きコミットメントとして記録し、「メモリスペース」ごとに直線的で欠番のない履歴を強制する、最小限のレジストリを定義します。監査人や取引相手は、既知のオンチェーンのヘッドに対して、ロールバックや差し替えを検出でき、エージェントは特定のコミットメントを選択的に開示できます。\n\n## 仕組み\n\n- **メモリスペース。** `spaceId = keccak256(abi.encode(typehash, initialController, salt))` で識別されるため、他のコントローラーの ID を誰も占拠できません。各スペースには **controller**（ロールをローテーションできる）と **authorizer**（更新に署名する）があり、どちらも EOA またはコントラクトです。\n- **ExperienceDelta。** 各更新は固定の構造体です: `spaceId`、`sequence`（1 から開始）、`prevStateRoot`、`deltaCommitment`（必須）、任意の `provenanceCommitment`、`profileId`（プライベートデータの解釈方法。必須）、任意の `locatorCommitment`。生のメモリ、ソルト、鍵、URL はオンチェーンに置かれません。\n- **遷移 ID とステートルート。** `transitionId` は、デルタの [EIP-712](/eip-712/) 構造体ハッシュです。レジストリがこれを受け付けるのは `sequence == current + 1` かつ `prevStateRoot == current root` の場合のみで、受け付けると `nextStateRoot = hash(prevStateRoot, transitionId)` を設定します。\n- **署名。** EIP-712 ドメイン `AgentMemoryState` / バージョン `1` / チェーン ID / レジストリアドレスの下で署名されます。検証は、authorizer にコードがある場合はまず [ERC-1271](/eip-1271/) を試し、そうでなければ正規の 65 バイトの ECDSA 署名にフォールバックするため、[EIP-7702](/eip-7702/) で委任された EOA も引き続き機能します。\n- **ベースラインのコミットメント。** ドメイン分離された `keccak256(abi.encode(DOMAIN, …, salt, keccak256(payload)))`。エントロピーの低い平文には、秘密のソルトか暗号化が必要です。\n- **不変性。** 直線性と署名チェックを強制するロジックはアップグレード可能であってはなりません。さもないと、テストベクターが通っていても保証は無効になります。\n\n## サンプルコード\n\n`commitTransition` のために `ExperienceDelta` に署名する例（ethers v6）:\n\n```ts\nimport { Wallet, keccak256, AbiCoder, id } from \"ethers\";\n\nconst domain = { name: \"AgentMemoryState\", version: \"1\", chainId, verifyingContract: registry };\nconst types = {\n  ExperienceDelta: [\n    { name: \"spaceId\", type: \"bytes32\" },\n    { name: \"sequence\", type: \"uint64\" },\n    { name: \"prevStateRoot\", type: \"bytes32\" },\n    { name: \"deltaCommitment\", type: \"bytes32\" },\n    { name: \"provenanceCommitment\", type: \"bytes32\" },\n    { name: \"profileId\", type: \"bytes32\" },\n    { name: \"locatorCommitment\", type: \"bytes32\" },\n  ],\n};\n\nconst coder = AbiCoder.defaultAbiCoder();\nconst deltaCommitment = keccak256(coder.encode(\n  [\"bytes32\", \"bytes32\", \"bytes32\", \"bytes32\"],\n  [id(\"AgentMemoryState.deltaCommitment.v1\"), profileId, secretSalt, keccak256(ciphertext)],\n));\n\nconst [, stateRoot, seq] = await registryContract.head(spaceId);\nconst delta = {\n  spaceId, sequence: seq + 1n, prevStateRoot: stateRoot,\n  deltaCommitment, provenanceCommitment: \"0x\" + \"00\".repeat(32),\n  profileId, locatorCommitment: \"0x\" + \"00\".repeat(32),\n};\nconst sig = await authorizer.signTypedData(domain, types, delta);\nawait registryContract.commitTransition(delta, sig);\n```\n\n## 知っておくべきこと\n\n- ステータス: **Draft**。\n- 証明されるのは、設定された authorizer が、与えられたコミットメントの系列を承認したことだけです。メモリが真実であること、利用可能であること、エージェントが実際に使っていること、そして削除されたことがあるかどうかは、証明されません。\n- コミットメントからも、更新のタイミングや頻度といったメタデータは漏れます。ソルトや暗号文を再利用すると、同一性が明らかになることがあります。\n- 同じ `spaceId` が複数のチェーンに存在しうること、署名がレジストリに依存することから、遷移の参照にはチェーンとレジストリのアドレスを含めなければなりません。\n- EIP-7702 による委任があっても、そのアカウントの元の鍵は依然として署名できるため、委任先のポリシーだけが唯一の認可経路ではありません。\n- 非アップグレード性を確認するために、仕様は、[ERC-1967](/eip-1967/) のプロキシスロットが空であること、管理者やオーナーの関数がないことを確認するよう提案しています。\n"},"ko":{"lang":"ko","tldr":"AI 에이전트의 비공개 메모리 업데이트를 엄격하고 빈틈없는 체인 속 서명된 해시 커밋먼트로만 기록하는 레지스트리. 메모리를 온체인에 전혀 공개하지 않고도 에이전트의 메모리 이력을 변조 탐지 가능하고 귀속 가능하게 만든다.","tags":["erc","ai-agents","commitments","eip-712","privacy"],"related":[712,1271,7702,1967],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8350/","markdown":"## 어떤 문제를 해결하나요?\n\nAI 에이전트는 보통 장기 메모리(프롬프트, 임베딩, 선호, 정책)를 비공개 데이터베이스에 보관하며, 이를 온체인에 공개하는 것은 프라이버시 문제이자 비용 문제입니다. 단순한 콘텐츠 해시만 게시하는 것도 충분하지 않습니다. 그것이 어느 이전 상태를 잇는지, *유일한* 유효한 후속인지, 누가 승인할 수 있는지, 독립적인 구현이 식별자를 어떻게 계산해야 하는지 알 수 없기 때문입니다.\n\nERC-8350은 각 메모리 업데이트를 고정 크기의 서명된 커밋먼트로 기록하고, \"메모리 스페이스\"별로 선형이고 빈틈없는 이력을 강제하는 최소한의 레지스트리를 정의합니다. 감사자와 거래 상대방은 알려진 온체인 헤드에 대해 롤백이나 바꿔치기를 탐지할 수 있고, 에이전트는 특정 커밋먼트를 선택적으로 열어 보일 수 있습니다.\n\n## 어떻게 동작하나요?\n\n- **메모리 스페이스(Memory Space).** `spaceId = keccak256(abi.encode(typehash, initialController, salt))`로 식별되므로 누구도 다른 controller의 id를 선점할 수 없습니다. 각 스페이스에는 **controller**(역할을 교체할 수 있음)와 **authorizer**(업데이트에 서명)가 있으며, 둘 다 EOA 또는 컨트랙트입니다.\n- **ExperienceDelta.** 각 업데이트는 고정 구조체입니다: `spaceId`, `sequence`(1부터 시작), `prevStateRoot`, `deltaCommitment`(필수), 선택적인 `provenanceCommitment`, `profileId`(비공개 데이터를 해석하는 방법, 필수), 선택적인 `locatorCommitment`. 원본 메모리, 솔트, 키, URL은 절대 온체인에 올라가지 않습니다.\n- **전이 ID와 상태 루트.** `transitionId`는 델타의 [EIP-712](/eip-712/) 구조체 해시입니다. 레지스트리는 `sequence == current + 1`이고 `prevStateRoot == current root`일 때만 이를 받아들이며, 그다음 `nextStateRoot = hash(prevStateRoot, transitionId)`를 설정합니다.\n- **서명.** EIP-712 도메인 `AgentMemoryState` / 버전 `1` / 체인 id / 레지스트리 주소 아래에서 서명됩니다. 검증은 authorizer에 코드가 있으면 먼저 [ERC-1271](/eip-1271/)을 시도하고, 그렇지 않으면 표준 65바이트 ECDSA 서명으로 폴백하므로 [EIP-7702](/eip-7702/)로 위임된 EOA도 계속 동작합니다.\n- **기본 커밋먼트.** 도메인 분리된 `keccak256(abi.encode(DOMAIN, …, salt, keccak256(payload)))`. 엔트로피가 낮은 평문에는 비밀 솔트나 암호화가 필요합니다.\n- **불변성.** 선형성과 서명 검사를 강제하는 로직은 업그레이드할 수 없어야 합니다. 그렇지 않으면 테스트 벡터를 통과하더라도 보장은 무효입니다.\n\n## 샘플 코드\n\n`commitTransition`을 위해 `ExperienceDelta`에 서명하는 예(ethers v6):\n\n```ts\nimport { Wallet, keccak256, AbiCoder, id } from \"ethers\";\n\nconst domain = { name: \"AgentMemoryState\", version: \"1\", chainId, verifyingContract: registry };\nconst types = {\n  ExperienceDelta: [\n    { name: \"spaceId\", type: \"bytes32\" },\n    { name: \"sequence\", type: \"uint64\" },\n    { name: \"prevStateRoot\", type: \"bytes32\" },\n    { name: \"deltaCommitment\", type: \"bytes32\" },\n    { name: \"provenanceCommitment\", type: \"bytes32\" },\n    { name: \"profileId\", type: \"bytes32\" },\n    { name: \"locatorCommitment\", type: \"bytes32\" },\n  ],\n};\n\nconst coder = AbiCoder.defaultAbiCoder();\nconst deltaCommitment = keccak256(coder.encode(\n  [\"bytes32\", \"bytes32\", \"bytes32\", \"bytes32\"],\n  [id(\"AgentMemoryState.deltaCommitment.v1\"), profileId, secretSalt, keccak256(ciphertext)],\n));\n\nconst [, stateRoot, seq] = await registryContract.head(spaceId);\nconst delta = {\n  spaceId, sequence: seq + 1n, prevStateRoot: stateRoot,\n  deltaCommitment, provenanceCommitment: \"0x\" + \"00\".repeat(32),\n  profileId, locatorCommitment: \"0x\" + \"00\".repeat(32),\n};\nconst sig = await authorizer.signTypedData(domain, types, delta);\nawait registryContract.commitTransition(delta, sig);\n```\n\n## 알아둘 점\n\n- 상태: **Draft**.\n- 설정된 authorizer가 주어진 커밋먼트 시퀀스를 승인했다는 것만 증명합니다. 메모리가 사실이라는 것, 이용 가능하다는 것, 에이전트가 실제로 사용했다는 것, 또는 삭제된 적이 있다는 것은 증명하지 않습니다.\n- 커밋먼트도 업데이트 시점과 빈도 같은 메타데이터를 유출합니다. 솔트나 암호문을 재사용하면 동일성이 드러날 수 있습니다.\n- 같은 `spaceId`가 여러 체인에 존재할 수 있고 서명이 레지스트리에 의존하므로, 전이 참조에는 체인과 레지스트리 주소가 포함되어야 합니다.\n- EIP-7702 위임을 쓰더라도 계정의 원래 키는 여전히 서명할 수 있으므로, 위임 대상의 정책이 유일한 인가 경로는 아닙니다.\n- 업그레이드 불가능성을 확인하기 위해 스펙은 [ERC-1967](/eip-1967/) 프록시 슬롯이 비어 있고 관리자나 소유자 함수가 없는지 확인할 것을 제안합니다.\n"},"zh":{"lang":"zh","tldr":"一个注册表，AI 智能体的私有记忆更新只以签名哈希承诺的形式，记录在一条严格且无间断的链中，使智能体的记忆历史可被篡改检测、可归属，而无需在链上披露任何记忆内容。","tags":["erc","ai-agents","commitments","eip-712","privacy"],"related":[712,1271,7702,1967],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8350/","markdown":"## 它解决什么问题？\n\nAI 智能体通常把长期记忆（提示词、嵌入向量、偏好、策略）保存在私有数据库中，把它们发布到链上既有隐私问题，又很昂贵。仅仅发布一个裸的内容哈希也不够：它没有说明自己接在哪个之前的状态之后，是否是*唯一*有效的后继，谁有权批准它，或者独立的实现应该如何计算这个标识符。\n\nERC-8350 定义了一个最小化的注册表，把每次记忆更新记录为固定大小的签名承诺，并为每个“记忆空间（memory space）”强制保持线性、无间断的历史。审计者和交易对手随后可以针对已知的链上头部检测回滚或替换，智能体也可以有选择地打开特定的承诺。\n\n## 它如何运作\n\n- **记忆空间（Memory Space）。** 由 `spaceId = keccak256(abi.encode(typehash, initialController, salt))` 标识，因此没人可以抢注其他 controller 的 id。每个空间都有一个 **controller**（可以轮换角色）和一个 **authorizer**（对更新签名），两者可以是 EOA 或合约。\n- **ExperienceDelta。** 每次更新是一个固定的结构体：`spaceId`、`sequence`（从 1 开始）、`prevStateRoot`、`deltaCommitment`（必填）、可选的 `provenanceCommitment`、`profileId`（如何解释私有数据，必填）和可选的 `locatorCommitment`。原始记忆、盐值、密钥和 URL 绝不上链。\n- **转换 ID 与状态根。** `transitionId` 是该 delta 的 [EIP-712](/eip-712/) 结构体哈希。注册表只有在 `sequence == current + 1` 且 `prevStateRoot == current root` 时才接受它，然后设置 `nextStateRoot = hash(prevStateRoot, transitionId)`。\n- **签名。** 在 EIP-712 域 `AgentMemoryState` / 版本 `1` / 链 id / 注册表地址之下签名。当 authorizer 有代码时，验证先尝试 [ERC-1271](/eip-1271/)，然后回退到规范的 65 字节 ECDSA 签名，因此经 [EIP-7702](/eip-7702/) 委托的 EOA 仍可正常工作。\n- **基线承诺。** 经过域分离的 `keccak256(abi.encode(DOMAIN, …, salt, keccak256(payload)))`；低熵明文需要秘密盐值或加密。\n- **不可变性。** 强制线性和签名检查的逻辑不得可升级；否则，即使测试向量通过，这一保证也是无效的。\n\n## 示例代码\n\n为 `commitTransition` 签署一个 `ExperienceDelta`（ethers v6）：\n\n```ts\nimport { Wallet, keccak256, AbiCoder, id } from \"ethers\";\n\nconst domain = { name: \"AgentMemoryState\", version: \"1\", chainId, verifyingContract: registry };\nconst types = {\n  ExperienceDelta: [\n    { name: \"spaceId\", type: \"bytes32\" },\n    { name: \"sequence\", type: \"uint64\" },\n    { name: \"prevStateRoot\", type: \"bytes32\" },\n    { name: \"deltaCommitment\", type: \"bytes32\" },\n    { name: \"provenanceCommitment\", type: \"bytes32\" },\n    { name: \"profileId\", type: \"bytes32\" },\n    { name: \"locatorCommitment\", type: \"bytes32\" },\n  ],\n};\n\nconst coder = AbiCoder.defaultAbiCoder();\nconst deltaCommitment = keccak256(coder.encode(\n  [\"bytes32\", \"bytes32\", \"bytes32\", \"bytes32\"],\n  [id(\"AgentMemoryState.deltaCommitment.v1\"), profileId, secretSalt, keccak256(ciphertext)],\n));\n\nconst [, stateRoot, seq] = await registryContract.head(spaceId);\nconst delta = {\n  spaceId, sequence: seq + 1n, prevStateRoot: stateRoot,\n  deltaCommitment, provenanceCommitment: \"0x\" + \"00\".repeat(32),\n  profileId, locatorCommitment: \"0x\" + \"00\".repeat(32),\n};\nconst sig = await authorizer.signTypedData(domain, types, delta);\nawait registryContract.commitTransition(delta, sig);\n```\n\n## 需要注意\n\n- 状态：**Draft**。\n- 它只证明所配置的 authorizer 批准了某个承诺序列。它不能证明记忆是真实的、可获取的、被智能体实际使用过，或者曾被删除。\n- 承诺仍会泄露元数据，比如更新的时间和频率；重复使用盐值或密文可能暴露相等关系。\n- 转换引用必须包含链和注册表地址，因为同一个 `spaceId` 可能存在于多条链上，而且签名取决于注册表。\n- 对于 EIP-7702 委托，账户的原始密钥仍然可以签名，因此被委托方的策略并不是唯一的授权路径。\n- 为检查不可升级性，规范建议确认 [ERC-1967](/eip-1967/) 代理槽为空，并且没有管理员或所有者函数。\n"}}}
