What is a private relay and why does each XChat circle have one?

Last checked

On Nostr, a relay is the server that stores messages and passes them on; a private relay only lets approved accounts read from it or write to it. Each XChat circle has its own, which accepts only that circle's members, so outsiders can't post into the circle or fetch its encrypted messages. The relay can see which accounts are members and when they post, but not what they say.

Not Apple's iCloud Private Relay

If you searched for "private relay" you may have meant Apple's feature. iCloud Private Relay is part of an iCloud+ subscription: it sends your Safari browsing through two separate relays so that no single party sees both who you are and which sites you visit. It has nothing to do with messaging, and nothing to do with XChat. The rest of this page is about relays in Nostr, the open protocol XChat is built on.

Relays in plain words

Nostr has no central server. Your app signs everything you send with your private key and hands it to one or more relays: simple servers that store those signed messages and give them to apps that ask. Anyone can run a relay. Because every message is signed, an app can tell if a relay has altered one.

Most relays are public. They accept posts from almost anyone and hand them to almost anyone, which is right for a public social feed. It is a poor home for a family's group chat: even if the messages are encrypted, strangers can still post to the same relay, and on many relays anyone can fetch the encrypted messages and watch when they appear.

How a relay becomes private

Nostr has a standard way for a relay to ask an app to prove which key it holds before letting it in (NIP-42). With that, a relay can accept writes only from paying or listed accounts, and serve reads only to them. A circle's relay applies this idea strictly: it accepts reads and writes only from that circle's members, a rule checked in the relay's code. Anyone else is refused at the door.

A typical public relayAn XChat circle's relay
Who can postAlmost anyoneOnly the circle's members
Who can fetch messagesAlmost anyone who asksOnly the circle's members
What it holdsPublic posts plus other people's encrypted messagesThe circle's end-to-end encrypted messages
Strangers and spamCan post next to youTurned away
Who runs itVolunteers, companies, individualsThe XChat team
Who paysUsually free or donation-fundedThe circle creator's subscription

What the circle's relay can and can't see

Messages, photos, videos, files and voice messages in a circle are end-to-end encrypted on members' phones before they leave; group chats use the MLS protocol. The relay stores what arrives without being able to decrypt it.

  • It can see which accounts belong to the circle and when each of them posts.
  • It can't see what anyone says or sends: the text, photos and files reach it already encrypted.
  • It doesn't protect against things on the phones themselves: a member who screenshots a chat, or a phone that is lost while unlocked.
  • Deleting for everyone is a request that the relay and the apps carry out; someone may already have read or saved the message.

Why one relay per circle

Giving each circle its own relay keeps circles apart. The family circle and a small work circle don't share a relay, a member list or a stream of messages, and someone in one can't wander into the other. It also means the membership check happens before anything is stored, rather than relying only on encryption after the fact.

The XChat team runs these relays, and the circle creator's subscription pays for them. That is why a lapsed subscription matters: nobody can send new messages or files in that circle until it is renewed. You can't run a circle's relay yourself; if owning the server is what you want, see how to get a family chat server without running one for options that allow it.

Common questions

Is a private relay the same as a VPN?
No. A VPN routes all your internet traffic through another server to hide your connection. A Nostr private relay is the server that holds a group's messages and only lets members use it. It doesn't change how the rest of your phone connects.
Do members have to set up the relay?
No. The relay comes with the circle. Members join with an invite link or QR code and never configure a relay address.
Can the XChat team read our messages on the relay?
The relay stores only end-to-end encrypted messages, which it can't decrypt. What it does see is which accounts are in the circle and when they post.
Could I point an XChat circle at my own Nostr relay?
No. Each circle uses the relay the XChat team runs for it. Free Nostr apps such as 0xchat and White Noise let you choose or run your own relays, without XChat's members-only circles.

Sources

How this page was made: drafted with AI help by the XChat team. What it says about XChat was checked against the app's open-source code; what it says about other apps links to their own pages, as of the date above. Spotted a mistake? Write to support@0xchat.com.