---
eip: 8350
label: ERC-8350
title: Agent Memory State Registry
status: Draft
type: Standards Track
category: ERC
created: 2026-07-14
requires: 712, 1271, 7702
official: https://eips.ethereum.org/EIPS/eip-8350
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8350.md
canonical: https://eips.huatuo.xyz/eip-8350/
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]
---

# ERC-8350: Agent Memory State Registry

> Authorized commitments to private agent memory state transitions.

**TL;DR:** 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.

## What problem does it solve?

AI 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.

ERC-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.

## How it works

- **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.
- **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.
- **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)`.
- **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.
- **Baseline commitments.** Domain-separated `keccak256(abi.encode(DOMAIN, …, salt, keccak256(payload)))`; low-entropy plaintext requires a secret salt or encryption.
- **Immutability.** The logic enforcing linearity and signature checks must not be upgradeable; otherwise the guarantee is void even if the test vectors pass.

## Sample code

Signing an `ExperienceDelta` for `commitTransition` (ethers v6):

```ts
import { Wallet, keccak256, AbiCoder, id } from "ethers";

const domain = { name: "AgentMemoryState", version: "1", chainId, verifyingContract: registry };
const types = {
  ExperienceDelta: [
    { name: "spaceId", type: "bytes32" },
    { name: "sequence", type: "uint64" },
    { name: "prevStateRoot", type: "bytes32" },
    { name: "deltaCommitment", type: "bytes32" },
    { name: "provenanceCommitment", type: "bytes32" },
    { name: "profileId", type: "bytes32" },
    { name: "locatorCommitment", type: "bytes32" },
  ],
};

const coder = AbiCoder.defaultAbiCoder();
const deltaCommitment = keccak256(coder.encode(
  ["bytes32", "bytes32", "bytes32", "bytes32"],
  [id("AgentMemoryState.deltaCommitment.v1"), profileId, secretSalt, keccak256(ciphertext)],
));

const [, stateRoot, seq] = await registryContract.head(spaceId);
const delta = {
  spaceId, sequence: seq + 1n, prevStateRoot: stateRoot,
  deltaCommitment, provenanceCommitment: "0x" + "00".repeat(32),
  profileId, locatorCommitment: "0x" + "00".repeat(32),
};
const sig = await authorizer.signTypedData(domain, types, delta);
await registryContract.commitTransition(delta, sig);
```

## Things to know

- Status: **Draft**.
- 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.
- Commitments still leak metadata such as update timing and frequency; reusing salts or ciphertext can reveal equality.
- 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.
- With EIP-7702 delegation, the account's original key can still sign, so a delegate's policy is not the only authorization path.
- To check non-upgradeability, the spec suggests confirming empty [ERC-1967](/eip-1967/) proxy slots and no admin or owner functions.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8350
