ERC-8350 Agent Memory State Registry

Draft · Other · created 2026-07-14

Records changes to an autonomous agent's memory state as signature-authorized on-chain commitments, making it possible to verify the continuity and authorization of the change history without disclosing the actual memory contents.

Why it is needed

Agent systems typically keep long-term memory in private databases and use Ethereum only for identity, payment, and execution. If memory changes are posted as a bare hash, there is no way to know what state that hash leads to, whether it is the sole valid next step from the current state, who controls the namespace and who authorizes updates, whether externally meaningful references are all signed, or whether different implementations compute the same transition identifier. Disclosing the raw prompts, embeddings, policies, or latent state directly breaks privacy and is also costly. Operators, wallet and app developers, auditors, and counterparties need a way to jointly verify that an agent's memory history has been authorized and remains unbroken, without exposing the memory contents.

What to implement

In depth

Memory space identifier and state root

spaceId is computed as keccak256(typehash, initialController, salt) from the struct MemorySpace(address initialController, bytes32 salt), and initialController cannot be zero. Each space has a sequence number starting at 1 and a stateRoot, both zero for an empty space. The registry accepts a transition only when sequence equals the current value plus one and prevStateRoot matches the current state root, then atomically stores the transition ID, next state root, and sequence number, with nextStateRoot computed as keccak256(MemoryState typehash, prevStateRoot, transitionId).

The 7 fields of ExperienceDelta

ExperienceDelta is fixed to 7 fields: spaceId, sequence, prevStateRoot, deltaCommitment, provenanceCommitment, profileId, and locatorCommitment. deltaCommitment and profileId cannot be zero; provenanceCommitment and locatorCommitment being zero means that information is absent. The raw memory, salt, encryption key, and original locator must never be passed to the registry, whether in this struct or any other required argument.

Transition ID and signing domain

The transition ID (transitionId) is computed solely as the EIP-712 hashStruct of the fixed ExperienceDelta type string; no other encoding such as JSON, JCS, or CBOR exists. Registration, authorization changes, and transition signatures all use an EIP-712 domain composed of name="AgentMemoryState", version="1", chainId, and verifyingContract (the registry address). This domain prevents the same signature from being replayed on a different chain or registry; the transitionId itself is chain-agnostic, but its signature is not.

Referencing a transition requires specifying the registry and chain

Because spaceId is determined solely by the controller and salt, it can be identical across multiple chains, but two chains can have different histories under the same spaceId, so (spaceId, transitionId) alone does not determine which history is being referenced. Since the signing domain includes the registry address as verifyingContract, the signature digest cannot be reconstructed, and the authorizer's signature cannot be verified, without knowing the registry and chain. Therefore a reference that does not include the registry address and chain cannot be independently verified.

Space registration and authorization replacement

registerSpace requires a non-zero controller and authorizer, requires the supplied spaceId to equal deriveSpaceId(controller, salt), and requires the controller to sign the SpaceRegistration struct. A space can only be registered once, and a relayer can submit the signature on someone's behalf without itself becoming the controller or authorizer. updateSpaceAuthorization lets the current controller replace both the controller and authorizer at once; configNonce must equal the current value plus one, the current controller must sign the SpaceAuthorization struct, and neither address can be zero.

Signature verification order (ERC-1271 and ECDSA)

The required accounts are: the controller passed in at registration, the current controller at authorization change, and the current authorizer at transition. Code presence alone must not be used to distinguish ECDSA from ERC-1271, because an EOA delegated via EIP-7702 can carry code of the form 0xef0100||delegate while still being a delegate with no signature policy. An empty signature can only be accepted as a direct-call exception when msg.sender is exactly the required account itself; other callers cannot receive this exception with empty bytes. Otherwise, if code is present, ERC-1271's isValidSignature is first called via STATICCALL, and it is treated as success only if the first 32 bytes of the return value are exactly the magic value 0x1626ba7e followed by 28 bytes of zero padding; on failure or revert, it falls back to ECDSA recovery, which accepts only a canonical 65-byte signature. Because an ERC-1271 rejection does not invalidate a valid ECDSA signature, the original key of a delegated account can still authorize a transition even if the delegate rejects it.

Default method for private commitments

It is recommended (SHOULD) that deltaCommitment, provenanceCommitment, and locatorCommitment support a default method computed as the keccak256 of an abi.encode of a domain tag, a salt, and the payload. The salt must be 32 bytes and drawn independently; for low-entropy plaintext, either the salt must be kept secret or the payload itself must be encrypted into ciphertext using a fresh, high-entropy key and nonce. A publicly disclosed salt does not prevent targeted dictionary attacks against low-entropy content.

Immutability requirements for the enforcing logic, and Draft status

The registry must not be deployed behind an upgrade mechanism capable of replacing the logic that enforces sequence continuity, state root chaining, and signature verification, and such authority must not be exposed. A replaceable implementation can reproduce every published test vector exactly while still accepting transitions that violate sequence continuity, so passing the vectors and holding this guarantee are separate claims. An empty ERC-1967 implementation and admin slot, and deployed code with no owner, admin, initializer, or proxy, can serve as evidence of immutability. This ERC is currently in Draft status, not yet finalized, and the proposal may change or stall.

Things to watch out for

Original ERC · ← ERCs