ERC-8309 Gateway mesh synchronization protocol (Gateway Mesh Sync Protocol for CCIP-Read)

Draft · Other · created 2026-06-13

A standard that lets CCIP-Read gateways periodically replicate each other's signed records, so that if one gateway goes down, another gateway can still serve the same data.

Why it is needed

CCIP-Read (ERC-3668) lets a contract point to an off-chain gateway, but the data ultimately lives on only that one gateway. If the single gateway holding the record goes down, the lookup itself fails even though the same data could in principle be reconstructed. Operators have patched around this with their own replication or centralized failover, but there was no standardized way to share signed records between different operators or implementations. As a result, it was impossible for multiple gateways to form a single mesh that replicated each other's data; trust (signature verification) had already been solved, but availability (whether the data is still alive) remained unresolved.

What to implement

In depth

The /records endpoint and queries

Each node serves records in the form GET /records?namespace=&since=&limit=&cursor=&protocol=. namespace is required, and since is compared not against the record's own timestamp but against the ingest time, the time the node received and stored that record. This is because a relayed record keeps its original timestamp, so filtering by timestamp could cause records that passed through a multi-hop path to be missed. Records are sorted by ascending ingest time, with ties broken by ascending inputHash and value, so that cursor pagination behaves reliably. limit cannot exceed the cap set by the node, and cursor is null when there are no more records to fetch. A polling interval of 30 seconds to 5 minutes is recommended, and since should be set with a margin (at least 60 seconds recommended) subtracted to cover clock skew between the two nodes.

Record commitment and signing

The object signed for a record is commitment = keccak256(abi.encodePacked(inputHash, namespace, keccak256(value), timestamp)). Since namespace is the only variable-length field and it sits between fixed-length fields, even abi.encodePacked cannot let two different combinations produce the same byte sequence. The signature uses ERC-191's personal_sign (version 0x45): 65 bytes (r||s||v, with v being 27 or 28) produced over keccak256("\x19Ethereum Signed Message:\n32" || commitment). The record itself carries no identifier of which node created it; the address recovered from the signature is the only evidence pointing to the origin node.

Deduplication and divergence

Deduplication merges only records that are completely identical across all three values: (inputHash, namespace, value). signature, timestamp, and sourcePeer are auxiliary information rather than part of a record's identity, so records signed by different signers over the same value are still merged (the one received first is kept). On the other hand, if there are two or more records with the same (inputHash, namespace) but different values, this is treated as a divergence: all of them must be preserved and all of them must be served via /records. A node's stored state for each (inputHash, namespace) is exactly one of three cases: a single value, a divergence, or none, and a node must not silently drop a divergence or present it as if consensus had been reached. A separate interpretation policy may be applied to the node's own query responses, but it cannot be applied to /records output.

Node identity and key rotation

A node maintains two kinds of keys: a long-term identity key, which never signs records and can be kept cold, and a signer key, which signs both records and the /vni document. The node's identity is fixed as nodeId = keccak256(identityKeyAddress), and peers pin this identity key. The identity key delegates the signer key by signing (nodeId, signerAddress, validFrom), and this delegation and the /vni document are exposed via GET /vni. To change the signer, the identity key simply issues a new delegation; since the nodeId does not change, existing peer pins are not broken. A node using a single key is treated as a special case where identityKey and signerAddress are the same and the delegation is empty (0x).

validFrom Monotonicity Check

For a given nodeId, a peer must only accept a new delegation if its validFrom is greater than the largest validFrom it has accepted so far, and this check applies equally to delegations re-fetched during rotation propagation. The peer must also reject any validFrom that lies in the future beyond the node's allowed clock skew tolerance. Without this lower bound, a race condition where two delegations are issued nearly simultaneously would leave it ambiguous which one is newer, a retired signer could be revived, and the re-fetch path would lose the guarantee that the pinned identity key's current signer is the most recently approved one.

Peer Discovery and NodeRegistry

A node can expose the list of peers it knows via GET /peers (URL, signerAddress, status, last sync time). However, since both the /peers contents and a record's sourcePeer are self-reported, a node must not trust a peer based solely on a self-reported URL or signerAddress, and must always verify the signer first via that peer's /vni document. The on-chain NodeRegistry is an optional discovery mechanism, a simple directory holding the URL a key claims, not a path for resolving delegations. Nodes found through the registry must also be verified via /vni before being pinned.

Protocol Versioning

The protocol field is a monotonically increasing integer included in every /records response, and this standard defines version 1. Versioning is declarative rather than negotiated: a node must first check whether a peer's protocol value matches a version it has implemented before accepting records, and if the version is unknown, it skips that peer without raising an error, logs it, and continues the next sync cycle. A node can advertise the versions it can handle via a supported_protocols array, letting peers select a compatible version without trial and error.

Proposal status

This ERC-8309 is in Draft status, written in June 2026. It has not yet undergone community review or reached consensus, so details such as the endpoint format, key structure, and registry interface may change going forward, or discussion may stall.

Things to watch out for

Original ERC · ← ERCs