Nexus: The First Hybrid Peer-to-Peer Nostr Relay
Nexus: The First Hybrid Peer-to-Peer Nostr Relay
Nexus is the world’s first hybrid peer-to-peer (P2P) Nostr relay. It speaks the ordinary Nostr relay protocol (NIP-01) over WebSocket, so any client can use it like any other relay — but it also coordinates clients to exchange recent events directly with each other over WebRTC, instead of every event always flowing through the server. The protocol is specified as NIP-NX.
- Live relay:
wss://nexus.libernet.app - Specification (NIP-NX): https://nexus.libernet.app/nip · NIP-NX.md on GitHub
- Source code (open, MIT): https://github.com/lucianocasalunga/nexus-relay
- Author: Luciano Casalunga (Barak) — LiberNet
The problem Nexus solves
Nostr distributes every event through relays. As a relay grows popular, it ends up sending the same recent events to many clients, over and over. That is bandwidth the relay operator pays for, and it concentrates the network on a handful of servers. If a popular relay goes down, the clients that depended on it go quiet.
Nexus asks a simple question: if two clients are online and one already holds the event the other wants, why route it through the server at all?
How Nexus works
Nexus keeps the relay, but turns clients into optional helpers — a peer-assisted distribution model, conceptually similar to how peer-assisted content delivery reduces server load.
- A client connects to Nexus over WebSocket, exactly like NIP-01.
- It optionally registers as a peer and caches the recent events it receives.
- It tells the relay which event IDs it holds.
- When another client wants those events, the relay points the two peers at each other.
- They open a WebRTC data channel and transfer the events directly, peer to peer.
- If the peer-to-peer path fails, the relay serves the events normally — the fallback is transparent.
Every event, whether it arrives peer-to-peer or from the relay, is an ordinary signed Nostr event and is verified by its ID hash and signature. Peer-to-peer changes the transport, never the trust model — a peer can never forge or tamper with an event, because the author’s signature is the only thing that grants authenticity.
Three kinds of node
| Node | Who | Role |
|---|---|---|
| Seed Node | the Nexus relay | authoritative source, peer coordinator, and fallback |
| Super Peer | stable clients | cache recent events and serve them to others over WebRTC |
| Casual Peer | regular clients | receive events peer-to-peer; the default role |
Peers that serve reliably build reputation, bound to their Nostr public key. Reputation can later be used to reward useful peers — for example with Lightning zaps proportional to how much they helped the network.
Why it matters
- Decentralization that actually distributes load. Not just “many centralized servers”, but clients contributing capacity back to the network.
- Resilience. If the relay is unreachable, peers can keep exchanging the events they already hold.
- Lower cost to run a relay, which lowers the barrier to operating Nostr infrastructure.
- Data sovereignty. Nexus keeps distribution inside the Nostr transport and pushes it peer-to-peer — the opposite direction from approaches that move data onto external HTTP servers.
How Nexus relates to other Nostr standards
Nexus is a strict, backwards-compatible extension of NIP-01. Clients that don’t know about NIP-NX simply use Nexus as a normal relay and never see the peer-to-peer messages. It changes nothing about how events are authored, signed, kinded, or subscribed to.
It sits in the family of Nostr work focused on network-native, peer-to-peer data sovereignty, distinct from HTTP file-storage approaches (such as NIP-96 and Blossom) that move media onto dedicated web servers. Nexus is about distributing events themselves more efficiently and more resiliently.
Note on numbering: Nexus’s protocol is published as NIP-NX (a letter-coded community NIP, in the spirit of lettered NIPs like NIP-B7). It was earlier floated in the official NIPs repository as NIP-95 (nostr-protocol/nips#2293, now closed). The letter code avoids the crowded, contested NIP-95 number and gives the protocol a clean, unambiguous identity.
Status
The Nexus relay is open source (MIT) and has been running in production as a standard Nostr relay since April 2026 at wss://nexus.libernet.app, with the peer-coordination layer built in. The peer-to-peer event-exchange layer is in active development — the honest state of the project, including what works and what is still being hardened, is tracked openly in the repository. Nexus works fully as a normal relay with or without the P2P path.
Try it
Point any Nostr client at wss://nexus.libernet.app and it works as a relay today. To read the protocol, see https://nexus.libernet.app/nip. To read the code or contribute, see the GitHub repository.
Nexus is built by LiberNet — an ecosystem of sovereign, Nostr-native applications. “The first P2P relay of the Nostr network.”
Write a comment