Relayer & prover
Components · 2 of 2 — the off-chain engine that carries packets and produces proofs.
The relayer is a single Go binary that runs both bridge directions and embeds the prover. It observes each chain, transports packets and client updates across, and generates the Groth16 signature proof the light client checks as one step of each update — the proof attests the validators' Ed25519 signatures, not the whole client-update check. It is fully untrusted — it can delay a message, never forge one.
Two responsibilities
- Relayer — observes
sendPacketon one side and submitsrecvPacket/ackPacket/updateClienton the other. It transports data; it never attests to validity. - Prover — re-executes the source chain's consensus check off-chain and produces the Groth16 proof that the packed validators' Ed25519 signatures over the header are valid (a batch signature proof). A computationally heavy step performed off-chain, leaving on-chain verification at constant gas. The ⅔ voting-power quorum is not part of the proof — it is summed on-chain in Solidity (see light client § UpdateClient).
Structure — services by direction
The relayer is organized by bridge direction. config.json lists one module per direction (cosmos_to_eth, eth_to_cosmos); each drives a Services instance built from a few concrete pieces:
| Component | Role |
|---|---|
EventListener (Subscriber) | Watches the source chain and turns its IBC events (send / ack / timeout) into packet batches — SubscribeCosmos over the CometBFT websocket, SubscribeEth over ICS26Router logs. |
| Worker | Holds the TransactionHandler (builds + submits txs on both chains) and the Prover (generates the Groth16 batch proof for the Cosmos→ETH light-client update). |
| BatchBuilder | Buffers packets and flushes a batch when its size or period is reached, onto the per-direction channel the run loop drains. |
Endpoints, contract addresses and trust parameters come from each module's config; signing, retry and batching are shared infrastructure. To operate it, see Running the relayer.
Another Cosmos source chain is just configuration. Spectre is an IBC bridge, so a new source is another Cosmos (CometBFT) chain — and since they all share Tendermint / Ed25519 consensus, they reuse the same circuit, prover and relayer. Onboarding one is a new cosmos_to_eth config plus an ICS-07 client deployed for it, no new code. (A non-Cosmos source with a different consensus engine would instead need its own EventListener, circuit and proof handling — outside the Cosmos↔Ethereum path Spectre targets today.)
The two directions
The two legs are not symmetric — they verify the counterparty's consensus with different machinery.
- Cosmos → Ethereum — the ZK direction, and the reason the prover exists. The relayer watches Cosmos IBC events; for each batch it first advances the Groth16 light client on Ethereum (
updateClient, carrying the prover's batch proof), then submitsrecvPacket/ackPacket/timeoutPacketto theICS26Routerwith an ICS-23 membership proof. - Ethereum → Cosmos — no ZK. Ethereum finality is checked by a standard
08-wasmsync-committee light client on Cosmos, so the relayer waits for beacon finality, advances that wasm client, and submitsMsgRecvPacket/MsgAcknowledgementwith an Ethereum storage proof. No Groth16 proof on this leg.
One rule holds on both: the client update runs before delivery — a packet is relayed only once the counterparty light client is current enough to verify it.
Prover
The prover serves the Cosmos→Ethereum leg only. For each client update it picks the smallest bucket that covers the quorum signers, pads the remaining slots with deterministic dummy keys, and produces one Groth16 batch proof — the heavy step, done once off-chain so on-chain verification stays a constant-cost pairing check. The circuit and bucketing are detailed in Optimizations and Light client.