Relays have 2 tasks: 1. Storing notes 2. Allowing people to query them When you connect to a relay, it uses the WebSocket protocol to communicate (that is what the wss:// is). HTTP is like asking someone something and getting an answer, WebSockets are like real time chat. Which is better for real time applications. When you first make and sign a note, you send it to a set of relays. Each relay takes your note and stores it, and adds it to indexes, like: - all kind 1 notes - all notes by semisol etc. Now, you can ask for it! You ask the relay for, for example all kind 1 notes from who you follow, and it checks the indexes for those, and sends you the matching notes it found. This is how a relay works. But on top there can be many features, for example: - nostr.land charges a fee for writing - many people host relays with whitelists - aggr.nostr.land reads all notes from other relays, spam filters them and stores them - hist.nostr.land retains multiple versions of events like a follow list - relays like blastr or nostr.land broadcast your events to hundreds of relays

Replies (6)

He said what relays do. But what ARE THEY? we know what they do. Where do they live? What are they made of? How do we stop them?.etc
Thanx for the explanation! You guys should post more educational content like this so dumb fucks like myself understand how nostr relays work. 🙌🏻
Some new stuff in here I didn't know fully, but otherwise guess I had a good enough sense about it. Never understood what a websocket is, so maybe I'll make a point to read something about that (now that I know how they fit in). Would be curious to learn more about indexing, another time, as that sounds interesting but complex (and I'll likely never need to concern myself with details in practice since I don't dev)