ZooBC wiki
Integrations

Relays

You are looking at an old version of this page: revision #64 by zoobc.how, 2026-10-26 20:39 UTC. See the current version

The ZooBC wallet can show which contacts are online and set up calls between accounts. Two browsers usually cannot connect to each other directly, so they need a meeting point on the open internet. A relay is that meeting point. It carries the signalling over which two wallets find each other, tells them which servers to use for the call itself, and reports who is online. Relays are listed on the chain, so wallets find them without any central directory.

What a relay does

A relay serves wallets in three ways:

  • Signalling: the short messages two wallets exchange to set up a call, carried over a WebSocket at /relay/ws.
  • Presence: which accounts are online at the moment.
  • Connection help: the TURN and ICE servers that let two browsers behind home routers reach each other for the call.

The official web wallet also passes the signed moves of channel games through a relay (channel apps).

Each relay describes itself at /relay/info: the operator's pay-to address, its rate, its TURN servers and its signalling path. Relayed data is paid for by sending ZBC to the operator's address, and accounts with no funds are refused.

Signing in

A relay must know which account is really online, or anyone could pretend to be anyone. A wallet therefore signs in by signing a single-use challenge from the relay with its account key. The challenge cannot be reused, and the key never leaves the wallet.

Two wallets each connected to a relay for signalling and presence, signing in with account and signature, with the call itself running between them via TURN; RegisterRelay records the relay key, domain, URL and the owner's gateway
Two wallets each connected to a relay for signalling and presence, signing in with account and signature, with the call itself running between them via TURN; RegisterRelay records the relay key, domain, URL and the owner's gateway

Listing a relay on the chain

The owner lists a relay with RegisterRelay (type 48), naming:

  • the relay's own key, written ZBR_…;
  • the key of the gateway it belongs to, which must be an active gateway owned by the same account;
  • its domain and its URL, under the same rules as a gateway's: letters, digits, dots and hyphens for the domain, and a URL beginning with https://.

No stake is locked. The owner withdraws the entry with UnregisterRelay (type 49), and wallets find relays at GET /api/v1/registry/relays. When its gateway fails, the web wallet re-reads the on-chain lists of gateways, relays and archival services.

What relays do not do

  • They do not forward transactions. Nodes pass transactions to their peers themselves, without charging for it.
  • They do not watch other chains for the bridge; keeper programs beside registered nodes do that (bridge and wrapped coins).
  • They do not make blocks; only registered nodes do (running a node).
  • They never hold a user's key.

See also