A Nostr Relay is a server that implements the Nostr protocol, accepting signed event objects from clients, storing them, and forwarding them to subscribed clients according to filter criteria. Relays are the infrastructure backbone of the Nostr decentralised social network: because there is no central server or consensus chain, the network’s availability and censorship-resistance derive entirely from the federated mesh of independently operated relays. Relays communicate with clients over persistent WebSocket connections using a simple JSON message format.

Content

  • The Nostr protocol (Notes and Other Stuff Transmitted by Relays) was created by fiatjaf and published in 2020 as a minimalist alternative to federated protocols like ActivityPub. The design philosophy rejected both blockchain consensus and federated server agreements, instead making individual relays autonomous: any relay can accept or reject any event, and clients choose which relays to trust and publish to. The simplicity of the protocol — essentially a publish-subscribe system over WebSockets with secp256k1 signatures — enabled rapid implementation across dozens of languages.
  • A relay implements a small set of message types: EVENT (publish or receive), REQ (subscribe with filter), CLOSE (cancel subscription), and NOTICE (relay-to-client messages). Filters can match on event kinds (text notes, metadata, reactions, zaps), author public keys, referenced event IDs, and time ranges. Relays store events in local databases (SQLite, PostgreSQL) and may apply policies: paid relays require Lightning micropayments to write, curated relays whitelist specific pubkeys, and ephemeral relays discard events after delivery.
  • Nostr relays are the infrastructure layer for a growing ecosystem including Damus and Prism (Twitter-like clients), Zap.stream (live video), and Snort (web client). Lightning Network integration via NIP-57 zaps enables direct micropayments attached to any event, creating economic incentives for both relay operators and content creators. The protocol’s NIP-05 identifier standard maps human-readable names to pubkeys via DNS, enabling discoverable identities without centralised registries.
  • By 2024-2025, the Nostr relay ecosystem has fragmented productively into specialised niches: Strfry and Nostream are high-performance open-source implementations handling millions of events per day, while relay.tools and Nostrich.house offer managed hosting. Relay-side spam filtering using proof-of-work (NIP-13) and reputation scoring is an active area. Integration with W3C DIDs positions Nostr relays as infrastructure for verifiable credential exchange across decentralised social and identity systems.