Alert Source Discuss
⚠️ Draft Standards Track: ERC

ERC-8309: Gateway Mesh Sync Protocol for CCIP-Read

Defines a pull-based protocol for ERC-3668 CCIP-Read gateways to replicate each other's signed records, forming a redundant mesh.

Authors Tiago Merlini (@TMerlini) <merloproductions@gmail.com>, Damon Zwicker (@damonzwicker), Jimmy Shi (@JimmyShi22)
Created 2026-06-13
Discussion Link https://ethereum-magicians.org/t/erc-8309-gateway-mesh-sync-protocol-for-ccip-read/28680
Requires EIP-191, EIP-3668

Abstract

ERC-3668 (CCIP-Read) lets a contract direct a client to one or more off-chain gateways, but it defines no way for those gateways to share records with each other, so a record held by only one gateway disappears if that gateway goes down. This standard defines a minimal, pull-based mesh sync protocol: each gateway exposes a GET /records endpoint returning ERC-191-signed records, and peer gateways poll it on an interval and replicate the records they verify. Records are deduplicated by content, signer keys are verifiable and rotatable, and an optional on-chain NodeRegistry provides discovery. Any CCIP-Read gateway that implements /records becomes part of the mesh, regardless of language or runtime, so a record originating on any node survives the loss of any other.

Motivation

CCIP-Read makes off-chain data retrieval verifiable, and its urls list lets a contract name several gateways, but each gateway must still hold the data itself: if the only gateway holding a record is unreachable, resolution of that record fails even though the data is fully reproducible. Operators work around this with bespoke replication or centralized failover. There is no interoperable way for independently operated gateways to share signed records, so meshes cannot form across operators or implementations.

This standard fills the gap ERC-3668 leaves between client↔gateway (specified) and gateway↔gateway (unspecified). It separates two concerns the existing stack conflates:

  • Trust — already solved: each record is signed; a consumer verifies the signature, independent of who served it.
  • Availability — addressed here: signed records replicate across peers so any node can answer.

Concretely it answers: how does a gateway expose its records for replication; how does a peer verify and deduplicate them; how do gateways discover one another; and how does node identity survive a key rotation.

Specification

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.

Roles

A node is any Hypertext Transfer Protocol (HTTP) service that serves GET /records in the format below. A node MAY also serve ERC-3668 CCIP-Read lookups, but this standard governs only inter-node replication. Nodes are pull-based: each node polls its peers; there is no push and no central coordinator.

The /records Endpoint

GET /records?namespace=<string>&since=<unix>&limit=<n>&cursor=<string>&protocol=<n>

Response:

{
  "protocol": 1,
  "supported_protocols": [1],
  "node_version": "<impl-defined string>",
  "namespace": "<string>",
  "records": [
    {
      "inputHash": "0x…",
      "namespace": "<string>",
      "value": "0x…",
      "timestamp": 1234567890,
      "signature": "0x…",
      "sourcePeer": null
    }
  ],
  "cursor": "<opaque string>" | null
}

Record fields:

  • inputHash — a 32-byte identifier, 0x-prefixed hex, of the subject the record answers for, chosen by the originating node (for a CCIP-Read gateway, typically keccak256 of the request calldata). This protocol treats it as opaque.
  • namespace — the record’s namespace (see Namespaces).
  • value — the record’s payload bytes as 0x-prefixed hex, of any length; 0x (empty) is permitted. This protocol treats the bytes as opaque.
  • timestamp — Unix time in seconds, set by the originating node when it signs the record. It is part of the signed commitment and is never changed by a relaying node.
  • signature — see Record Commitment and Signing.
  • sourcePeer — null for locally originated records; for a record learned via sync it MUST carry the Uniform Resource Locator (URL) of the originating node (the node that first signed the record). A node relaying a synced record MUST propagate that original sourcePeer unchanged and MUST NOT overwrite it with its own URL — so for a path A→B→C, C reports A, not B. sourcePeer is advisory provenance only; trust derives from the record signature, not from sourcePeer.

Query semantics:

  • namespace is REQUIRED. The response’s top-level namespace echoes it, and every returned record carries that namespace.
  • since is OPTIONAL (default 0). It is compared, exclusively, against the serving node’s ingest time for each record: the Unix time in seconds at which the serving node stored that record, whether it originated the record or learned it via sync. It is never compared against the record’s timestamp, because a relayed record keeps its original timestamp and would otherwise be skipped by a peer that last polled after that time.
  • Records MUST be returned in ascending order of ingest time, with ties broken by ascending inputHash and then ascending value, so that cursor pagination is stable.
  • limit is OPTIONAL. A node MUST NOT return more records than limit; it MAY cap limit at a node-defined maximum, and applies a node-defined default when limit is absent.
  • cursor is OPTIONAL. A node MUST support cursor pagination: cursor in a response is null when no further records match, and otherwise is passed back unchanged to continue. cursor is opaque to the caller and MUST be treated as a continuation token, not parsed.
  • protocol is OPTIONAL (see Protocol Versioning).
  • When the store holds a divergence for an (inputHash, namespace) (see Deduplication), each retained observation is returned as its own entry in records.

Sync cadence and propagation:

  • Nodes SHOULD poll each peer on a regular interval. RECOMMENDED 30 s–5 min; intervals below ~10 s add redundant load with no survival benefit. The interval is node-local and is not coordinated.
  • A puller SHOULD set since to the time of its last successful pull from that peer minus a margin covering clock skew between the two nodes (RECOMMENDED at least 60 s). Re-delivered records are deduplicated, so the margin costs bandwidth, not correctness.
  • Propagation is per hop: a record reaches a node d sync hops from its origin after roughly d sync intervals, provided each hop is reachable. This protocol makes no stronger delivery guarantee.

Record Commitment and Signing

Each record is signed by the originating node’s current signer key over:

commitment = keccak256(abi.encodePacked(
    bytes32  inputHash,
    string   namespace,
    bytes32  keccak256(value),
    uint64   timestamp
))

The signature is the ERC-191 version 0x45 (personal_sign) signature of the 32 raw bytes of commitment — that is, over keccak256("\x19Ethereum Signed Message:\n32" || commitment), not over the hexadecimal string of commitment. signature is 65 bytes, r || s || v, 0x-prefixed hex, with v ∈ {27, 28}. The same encoding applies to every other ERC-191 signature in this standard (delegation, the /vni signature and the NodeRegistry registration).

The single variable-length field (namespace) is bracketed by fixed-size fields — inputHash before it, the 32-byte value hash and 8-byte timestamp after. Because the total preimage length fixes the namespace length and every field’s position is anchored from one end or the other, no two distinct tuples can produce the same preimage; the packing is unambiguous. Packing two adjacent variable-length fields would be ambiguous; this preimage has only one.

Binding a record to its originating node. A record carries no node identifier; the signature is the binding. A verifier recovers the signer from signature over commitment and resolves it to the node whose currently accepted delegation names that signer (for a single-key node, the node whose identity key is that signer; see Node Identity and Key Rotation). A record whose recovered signer resolves to no pinned node MUST NOT be stored as verified; it is handled as described under Rotation propagation. A record without a signature, or with a signature that fails to recover, MUST be rejected.

Deduplication

Deduplication MUST collapse only observation-identical records — those with the same (inputHash, namespace, value). The signature, timestamp, and sourcePeer are attestation metadata outside record identity, so two validly-signed records with the same (inputHash, namespace, value) from different signers are observation-identical and collapse to one (the first valid one a node receives is kept). Replication therefore converges on the set of observations: every node that has pulled the same records holds the same (inputHash, namespace, value) set. The metadata kept for each observation depends on arrival order and is not convergent across nodes; a consumer that needs a specific attestation verifies the one it is served.

Two validly-signed records with the same (inputHash, namespace) but a differing value are a divergence, not a duplicate: both MUST be retained and both MUST be served by /records. For a given (inputHash, namespace) a node’s store is therefore in exactly one of three states: single (one observation), divergent (two or more observations, all retained) or absent. A node MUST NOT silently discard a divergence and MUST NOT present a divergence as agreement. A node MAY apply a resolution policy of its own when answering its own consumers (for example, CCIP-Read lookups), but MUST NOT apply it to /records output.

Collapsing observation-identical records discards per-value attestation multiplicity. A policy that counts independent vantages per value (for example, a quorum rule) requires attestation-set retention — a per-value record of which signers attested each value — which this specification does not mandate; such a policy MUST declare that retention as its own precondition.

Protocol Versioning

  • protocol is a single monotonically increasing integer present in every /records response. Version 1 is this specification.
  • Versioning is declared, not negotiated. A node MUST verify a peer’s protocol is one it implements before ingesting records, and MUST skip (not error) a peer whose version it does not implement, logging the mismatch and continuing the sync cycle.
  • A node MAY serve multiple versions by honoring the optional protocol request parameter, defaulting to its highest supported version when the parameter is absent.
  • A node SHOULD advertise the versions it can serve as a supported_protocols array of integers, in its /records response and in /peers, so a peer selects a compatible version via protocol instead of discovering incompatibility by trial.

Namespaces

  • A namespace is a free-form string scoped at the record level. There is no on-chain or standardized namespace registry; coordination is out-of-band, by convention.
  • Implementations SHOULD avoid collisions using descriptive, owned, or hierarchical prefixes (e.g. agent-attestations, token-metadata). A colon (:) SHOULD delimit a sub-namespace of a parent.
  • Self-description. A node SHOULD advertise the namespaces it serves, via GET /namespaces returning { "namespaces": ["<string>", …] } or via the namespaces field of /peers.

Peer Discovery

A node SHOULD expose GET /peers for gossip-based discovery:

{
  "protocol": 1,
  "supported_protocols": [1],
  "node_version": "<impl-defined string>",
  "signerAddress": "0x…",
  "namespaces": ["<string>"],
  "peers": [
    { "url": "<string>", "signerAddress": "0x…", "healthy": true, "lastSyncAt": 1234567890 }
  ]
}

supported_protocols and namespaces are OPTIONAL. healthy is a boolean: whether the node’s last sync with that peer succeeded. lastSyncAt is the Unix time in seconds of that last sync, or null if none has happened. A node MAY pull peer lists from peers it already syncs with, bounded per cycle to limit fan-out.

/peers content and sourcePeer are self-reported. A node MUST NOT pin a peer, or trust records on a peer’s behalf, on the basis of a self-reported URL or signerAddress alone: it MUST first verify the peer’s signer through the peer’s /vni document (see Node Identity and Key Rotation).

An OPTIONAL on-chain NodeRegistry provides permissionless discovery. It is a directory from a node key to the URL that key claims; it is not a delegation-resolution path.

interface INodeRegistry {
    event NodeRegistered(address indexed signer, string url);
    event NodeUpdated(address indexed signer, string url);

    /// @notice Register or update the URL claimed by the key that signed `signature`.
    /// @dev `signature` is an ERC-191 signature (65 bytes, r || s || v) over
    ///      keccak256(bytes(string.concat("ccip-router:node:", url))).
    ///      The recovered address is the registered key. The relayer (`msg.sender`)
    ///      need not be that key.
    function register(string calldata url, bytes calldata signature) external returns (address signer);

    /// @notice The URL claimed by `signer` and the block timestamp of its latest registration,
    ///         or ("", 0) if `signer` has never registered.
    function getNode(address signer) external view returns (string memory url, uint256 registeredAt);

    /// @notice The number of distinct registered keys.
    function nodeCount() external view returns (uint256);

    /// @notice Registered keys in registration order, with their URLs and registration times.
    function getNodes(uint256 offset, uint256 limit)
        external view
        returns (address[] memory signers, string[] memory urls, uint256[] memory timestamps);
}

A later registration by the same key replaces its URL. A node SHOULD register with its identity key (for a single-key node, its only key). A registry entry is a discovery hint: a peer that finds a node through the registry MUST still verify it through its /vni document before pinning it.

Node Identity and Key Rotation

A node has two keys whose roles are deliberately separated:

  • an identity key — long-lived, MAY be kept cold; it never signs records. The node’s identity is nodeId = keccak256(identityKeyAddress), where identityKeyAddress is the 20 raw bytes of the address (packed, not left-padded).
  • a signer key — signs records and the Verifiable Node Identity (VNI) document; authorized by the identity key via a delegation.

A node MAY collapse both tiers into a single key (identity key == signer key, no delegation). This is the conformant single-tier case. Rotation requires a distinct signer key delegated by the identity key; a single-key node cannot rotate until it adopts one.

  • Delegation. The identity key signs (ERC-191, as specified in Record Commitment and Signing) the 32 raw bytes of:
delegation = keccak256(abi.encode(bytes32 nodeId, address signerAddress, uint64 validFrom))

validFrom is the Unix time in seconds at which the delegation was issued. It orders delegations (see validFrom Monotonicity); a delegation takes effect when a peer accepts it, not at validFrom.

  • The /vni document. A node SHOULD expose GET /vni. A node that supports signer rotation MUST expose it, because /vni is the delegation-resolution path: without it a rotated signer is unverifiable. When offered, /vni MUST return:
{
  "nodeId":        "0x…",
  "identityKey":   "0x…",
  "signerAddress": "0x…",
  "delegation":    "0x…",
  "validFrom":     1234567890,
  "url":           "<string>",
  "version":       1,
  "timestamp":     1234567890,
  "signature":     "0x…"
}

nodeId is as defined above. identityKey is the identity key address. signerAddress is the currently delegated signer. delegation is the identity key’s ERC-191 signature over the delegation hash for (nodeId, signerAddress, validFrom). url is the node’s own base URL. version is the protocol version (see Protocol Versioning). timestamp is the Unix time in seconds at which the document was signed. signature is the signer key’s ERC-191 signature over the 32 raw bytes of:

vniDigest = keccak256(abi.encode(
    bytes32  nodeId,
    address  identityKey,
    address  signerAddress,
    uint64   validFrom,
    bytes32  keccak256(bytes(url)),
    uint256  version,
    uint64   timestamp
))

A peer resolving a delegation MUST verify that nodeId == keccak256(identityKey), that delegation recovers to identityKey, and that signature recovers to signerAddress.

Single-key case. A single-key node sets identityKey equal to signerAddress, delegation to 0x (empty) and validFrom to 0. A verifier accepts such a document when identityKey == signerAddress, nodeId == keccak256(identityKey) and signature recovers to signerAddress; the delegation and monotonicity checks do not apply to it. When a single-key node adopts a distinct signer, its first delegation is accepted under the normal rules.

  • Pinning. Peers pin the nodeId (the identity key), not the signer. A node MUST accept records from whatever signer the pinned identity key currently delegates, and MUST reject any delegation not signed by the pinned identity key.
  • Rotation. To rotate the signer, the identity key issues a new delegation naming the new signer. Because identity is the cold identity key and not the hot signer, rotation changes no nodeId and invalidates no peer’s pin.
  • Rotation propagation. A record whose recovered signer is not currently delegated by any pinned identity key MUST trigger a delegation re-resolution: re-fetching /vni from the peer that served the record, and MAY also from the node named by its sourcePeer. If re-resolution yields a valid delegation for that signer from a pinned identity key, the record is verified and stored. If the delegation is not yet retrievable (the node is mid-rotation or briefly unreachable), the node SHOULD defer the record and retry on later sync cycles instead of dropping it, so records are not lost while the delegation propagates. Deferral MUST be bounded: a node MUST cap both the number of cycles a record stays deferred and the total size of its deferral queue, and MUST reject a record when either bound is reached. The prior signer need not remain valid; an operator MAY overlap signing with the prior key until propagation is confirmed, but the protocol does not require it.

validFrom Monotonicity

A node MUST reject any delegation whose validFrom is not strictly greater than the highest validFrom it has accepted for that nodeId, and this check MUST apply uniformly — including to delegations resolved on the rotation-propagation re-resolution path. A node MUST also reject a delegation whose validFrom is later than its own current time plus a node-local clock-skew allowance. Without a strict floor per nodeId, the rotation record is ambiguous under a race (two delegations carrying equal or out-of-order validFrom), a retired signer could be reintroduced, and the re-resolution path would lose its guarantee that the pinned identity key’s current signer is the latest one it authorized.

Rationale

  • Pull, not push. CCIP-Read gateways are stateless request/response services. A pull model needs no inbound connections, no delivery guarantees, and no central broker; convergence comes from idempotent deduplication, not coordination.
  • Declare-and-skip versioning keeps the protocol stateless. There is no in-band negotiation round-trip: a handshake would force per-peer session state for no benefit at this layer, and an integer plus optional protocol selection covers forward compatibility.
  • No namespace registry. Namespaces behave like Multipurpose Internet Mail Extensions (MIME) types: collision-avoided by convention, not by a gatekeeper. Putting them on-chain would add gas, governance and a permissioning chokepoint to a permissionless protocol for an off-chain concern. If global namespace discovery is later required, it can be layered on registry metadata without changing this protocol.
  • What the records are for. This protocol does not interpret records — a record is opaque bytes with a signature and a commitment. A motivating use is signed attestations about agent actions, whose subjects are identified by ERC-8004 agent ids, replicated so that a relying party can fetch an attestation’s bytes from any node.
  • Ingest-time since. Filtering on the record’s own timestamp loses records on multi-hop paths: a record signed at time T that reaches node B after C last polled B carries timestamp = T, earlier than C’s next since, and C never pulls it from B. Filtering on each serving node’s ingest time fixes this without changing the query parameter.
  • Signature as the node binding. Adding a node identifier to the record would add a field that a relaying node could not verify without the same signer resolution anyway. The recovered signer already identifies the originating node through its delegation, so the record format stays minimal.
  • Two-tier keys. A naive nodeId = keccak256(signer) makes every rotation an identity change that breaks every peer’s pin. A cold identity key that delegates a hot signer key decouples the two: the rarely-used identity key has a low compromise surface, and rotation is a fresh delegation, not a new identity. Single-key deployments are conformant and migrate additively.
  • The registry is discovery, not delegation. A registry that resolved delegations on-chain would need to store validFrom and the delegation signature and enforce monotonicity in a contract. /vni already carries a self-certifying delegation, so the registry stays a minimal directory and the delegation logic lives in one place.
  • Packed encoding, deliberately. The record commitment uses abi.encodePacked with a single variable-length field bracketed by fixed-size fields — unambiguous, unlike packing two adjacent dynamic fields. This matches deployed implementations byte for byte, so existing records remain valid with no signing change. The delegation and /vni digests, which have no deployed form to stay compatible with, use abi.encode.

Backwards Compatibility

Additive. A node that implements only ERC-3668 CCIP-Read is unaffected and simply does not participate in the mesh. Adding /records to such a gateway makes it a mesh node without changing its CCIP-Read behavior.

Existing single-key nodes whose nodeId = keccak256(signerAddress) are the conformant single-tier case: adopting the two-tier split makes each node’s existing key its identity key, so every nodeId and registry entry is preserved, and a node generates a hot signer key and a delegation only when it wishes to rotate.

Test Cases

The file test-vector.json in this proposal’s assets directory holds one record taken from a deployed mesh node, with its full value bytes (543 bytes, a UTF-8 JavaScript Object Notation (JSON) attestation) and every intermediate value. Summary:

inputHash  = 0xa50f50918f5886e410ced5cc5d44ad0d35dc324fcf70d3e6d833580e4d3a3da7
namespace  = "agent-attestations"
value      = 543 bytes, see the asset file
valueHash  = keccak256(value)
           = 0x86ef7df7c641ff5ac24a6011f2240b8f3590ddb7ec65d4cbc31482bf7b31db5a
timestamp  = 1779221791

commitment = keccak256(abi.encodePacked(
               bytes32 inputHash,
               string  namespace,
               bytes32 valueHash,
               uint64  timestamp))
           = 0x7f4b08ce408d831ba13b40ad02aa107676711f3c57e99dec9d6e28f7a280824b

ethSignedDigest = keccak256("\x19Ethereum Signed Message:\n32" || commitment)
                = 0xcdd55935e72cd328a296e98ff9e3badaadb63daabb9daf2a69b17535ca1ce539

signature  = 0xd428964bb569473721c5bd794c36f497a7145d03718436658f3143fd8648856448a314b46dfacb8202431c62cfe05d0274577e0eb93709161893f8c68b68bd771b
recovered  = ecrecover(ethSignedDigest, v = 27, r, s)
           = 0x85Fa13511D170FBe173761b63D7f8DD4A6f6Bf1A

Every value above can be recomputed offline from the asset file with any keccak-256 and secp256k1 implementation. A conforming verifier reproduces valueHash, commitment and recovered, and rejects the record if any byte of inputHash, namespace, value or timestamp is changed.

Reference Implementation

A TypeScript implementation runs as a multi-operator mesh of nodes serving CCIP-Read lookups, alongside an independently written gateway that also implements /records. Nodes running different implementation versions interoperate at protocol version 1. The deployed nodes operate single-key and register in a NodeRegistry deployment matching the interface above.

Security Considerations

  • Signer pinning vs. rotation. Peers pin the identity key (nodeId), not the signer (see Node Identity and Key Rotation), so a signer cannot be silently swapped: a rotation is a fresh delegation that only the pinned identity key can sign.
  • Stale rotation / replay. The strict per-nodeId floor on validFrom (see validFrom Monotonicity) prevents rollback to a retired signer, including on the rotation-propagation re-resolution path. Rejecting far-future validFrom values stops a compromised identity key from issuing one delegation that blocks every later rotation.
  • Identity key compromise. An attacker holding the identity key can delegate any signer. This standard defines no recovery from identity-key compromise; such a node needs a new identity key, and therefore a new nodeId, and peers must re-pin it out of band.
  • Namespace collision. Without a registry, two operators may pick the same namespace. Because records are also bound to their signer, collision causes no trust violation — only potential confusion; consumers should scope trust to known signers per namespace.
  • Record flooding / denial of service (DoS). A node serves /records publicly; implementations should rate-limit, bound limit, and cap per-peer ingestion per cycle to resist a peer flooding the mesh with junk records (which remain unverifiable and thus non-replicating beyond the first hop, since each must carry a valid signature).
  • Deferral queue exhaustion. Records from an unrecognized signer trigger re-resolution and may be deferred. The bounds on deferral (see Rotation propagation) stop a peer from growing a node’s deferral queue without limit by serving records under signers that never resolve.
  • Hostile peer URL. sourcePeer and /peers gossip are self-reported; trust comes only from a signer verified through /vni (see Peer Discovery).
  • Registry registration replay. The NodeRegistry registration message covers only the URL: it binds no chain id, contract address or nonce. Anyone can therefore resubmit a key’s earlier registration signature — to revert that key’s URL to a previous value, or to copy the registration to another registry deployment on any chain. A registry entry is a discovery hint only; a peer verifies the node at the claimed URL through /vni before pinning it, so a reverted or copied entry can misdirect discovery but cannot make a peer accept a forged record.
  • Clock skew. since uses the serving node’s ingest time and timestamp is set by the originating node; neither is compared against the puller’s clock except through the skew margin a puller subtracts from since. A puller that uses too small a margin may miss records ingested near the boundary until a later full re-pull.

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

Tiago Merlini (@TMerlini) <merloproductions@gmail.com>, Damon Zwicker (@damonzwicker), Jimmy Shi (@JimmyShi22), "ERC-8309: Gateway Mesh Sync Protocol for CCIP-Read [DRAFT]," Ethereum Improvement Proposals, no. 8309, June 2026. Available: https://eips.ethereum.org/EIPS/eip-8309.