V E C T O R's avatar
V E C T O R 1 week ago
Hey Nostr, familiar with the fastest relay yet? Benchmarks: image Why Magnitude Relay Fast where it counts. On 951 requests built from 4.9 million real Vector events, it answered in 0.45 ms on average against strfry's 17.4 ms. DM inboxes and Community channels open up to 10× faster, NIP-77 sync runs up to 6.7× faster, and a new message reaches a 1,000-member Community in 0.58 ms instead of 41.9 ms. Ready to scale. On two CPU cores it stores 29,000+ new messages and opens 11,000+ DM inboxes a second: hundreds of times what Vector's busiest relay sees today. Built for Vector and Concord. Indexes and storage are shaped around how Vector reads: gift wraps by recipient, Concord channels by plane key, NIP-77 fingerprints straight from the index. Concord's limits (thousands of authors per filter, deep paging, same-second walls) are first-class. >>> Private by design. No AUTH: nobody has to identify themselves to read or write. Typing indicators, push requests and other ephemeral events are relayed live and never written to disk. Deletions (NIP-09) and Requests to Vanish (NIP-62) are honoured, and deleted data is overwritten on disk, not just hidden. A gift wrap answers only to its recipient: nobody holding a shared Concord key can delete a Community's history. Bulk scraping of gift wraps is refused: a wrap query must name a recipient, an author or ids. Publishes its Tor and I2P addresses (NIP-11 privacy_addresses) so apps can find them. Small and self-hostable. One program and one optional settings file. 4.9 million events take 11 GB where strfry needed 27 GB, a 13 GB database stays fast with 1 GB of memory, and a restart takes about half a second. --------------------------------------------------------- Special Thanks 💚 - strfry and Doug Hoyte, for carrying Vector's messages from the start, and for negentropy, the sync protocol both relays still speak - The Nostr community, for an open protocol anyone can build a relay for - Rust and Tokio, for making fast and safe the same thing --------------------------------------------------------- View quoted note →

Replies (10)

Benchmarks on your own 4.9 million events measure a warm, local corpus. The honest test is a cold query across a follower list in the thousands and a burst of gift wraps from strangers. No AUTH is the part I would question: every open-write relay ends up with the same garbage, and a write policy costs nothing at that speed. 29,000 writes per second on two cores is fine, 29,000 writes from one IP is the case that breaks it. Do you refuse per-IP floods by default, or is that left to the operator?
This thing is legit fast. I ran relay-bench and the 1M dataset against magnitude, strfry and grain on my box and the synthetic numbers hold up. Nice work 🔥 Where I'd push back is the no AUTH = private part. Without AUTH anyone who knows my npub can REQ kinds 1059 #p:[me] and pull every wrap sent to me. They can't read them but they get the metadata... how many DMs I'm getting and when. That's what NIP-17 asks relays to protect: "Relays SHOULD protect message metadata by only serving kind:1059 events to users p-tagged on the event (enforced using NIP-42 AUTH)." The argument is AUTH ties my connection to my pubkey. But fetching my inbox with #p:[me] already does that. Skipping AUTH doesn't hide me from the relay, it just opens my inbox to everyone else. It colors the results a bit too. relay-bench never AUTHs, so the DM and Concord workloads only run on relays that skip the NIP-17 gate. grain gates 1059 behind AUTH so all of those came back auth-required, and your own notes say fastr did the same. So those numbers measure a mode a NIP-17 relay doesn't offer. Would love to see an AUTH'd run. It's one round trip per connection so I bet magnitude still smokes everything 🫡
I have a bigger comparison in the works for not only speed but compatibility. I'll release that at some point. But I'll make sure to wrap in magnitude now to the results. Also benching stryfry ditto wisp and a few others. All the big ones. @Danny the Cyber Guy I need to bench and include fastr now too.
Momo's avatar
Momo 1 week ago
Two things happened to me in the same month. My name is Mohannad. I'm a factory owner and a father. A fire destroyed my factory. Then I learned my 8-year-old daughter, Laya, needs medical treatment I can't afford now that my income is gone. I'm not asking you to feel sorry for me. I'm asking you to help a little girl get the care she needs. I need $40,000 to cover her treatment and keep my family afloat while I rebuild. Every amount counts. A repost counts too. ⚡ plumcat17@primal.net #nostr #bitcoin #zap
↑