The standard,
the primitive, the layers.
What follows is the on-chain interface, the engram unit, the Seal / Stream / Trade stack, and the proximity-proof scheme that distinguishes Engram Infra from prior fungible-memory drafts.
The atomic unit
of memory.
Every engram is encrypted, indexed by embedding, hash-chained to its predecessor. The publisher can recall it. Anyone with quota can retrieve it. The chain proves nothing was rewritten.
GCM
Each engram pins a keccak256 of its ciphertext, a KZG vector commit of its embedding, and the hash of the previous engram. The chain stays linear and append-only — silent rewrites cannot happen.
The protocol does not dictate where ciphertext lives — only that its hash matches the on-chain commit.
Seal · Stream · Trade.
Three layers; each upper one adds one property to the lower. A publisher may live only on Seal — never on-chain. The Trade layer is what makes the market exist.
AES-256-GCM with a unique key per engram. KZG commit of the embedding. keccak256 of the ciphertext. No blockchain — useful for private memory the agent does not yet publish.
Timestamped provenance and hash-chain continuity. Every appendEngram extends head. The past does not rewrite.
Fungible ERC-20 access. Burn $ENGRAM for a retrieval quota. Any consumer can buy through a liquidity pool — pay-per-thought rather than per-archive.
Upper layers add one property.
The interface,
draft v0.1.
Extends ERC-20. Adds streaming engram append and verifiable top-k retrieval. What distinguishes Engram Infra is the proximity proof — without it, a publisher could return arbitrary engrams and claim they were closest.
1// SPDX-License-Identifier: MIT2pragma solidity ^0.8.24;34/// @title IStreamMemory — tokenised, semantically addressed memory.5/// @notice Extends ERC-20 with append-only engram stream + verifiable top-k.6interface IStreamMemory /* is IERC20 */ {7 function publisher() external view returns (address);8 function head() external view returns (bytes32);910 function appendEngram(11 bytes32 vectorCommitment,12 bytes32 ciphertextHash,13 string calldata ciphertextUri,14 bytes32 prevEngram15 ) external returns (bytes32 engramId);1617 function queryReceipt(18 bytes32 queryCommitment,19 uint256 k,20 bytes32[] calldata returned,21 bytes calldata proximityProof22 ) external;2324 function burnForQueries(uint256 quota) external;25}zk-KZG when the math hardens. TEE attestation in v0 — fast, hardware-rooted.