Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events caching Spec? #1817

Open
securitybrahh opened this issue Mar 3, 2025 · 7 comments
Open

Events caching Spec? #1817

securitybrahh opened this issue Mar 3, 2025 · 7 comments

Comments

@securitybrahh
Copy link

I have seen relays going on their own making caches and relay aggregators, but no mention of these things in the NIP's?

Prob for the best cause, as keeping the spec simple is best.

But I think, as a starter we should have a field that says cache/priority in NIP-1 itself. {veryLow, low, medium, high, veryHigh - some numbers idk}

Because when the network grows, the relays have to decide which events to let go, now it just decides on timestamp, i suppose.

But what about pinned content?

Also in this way, clients will have some order in which they fetch from a profile/identity.

In the enire spec atleast I haven't found any mention of persistence of events, which maybe out of design but idk.

@luigi1256
Copy link

The Pinned notes are in NIP-51 for note kind 1.

Because when the network grows, relays have to decide which events to let through; now, I guess, they decide only based on the timestamp.

A relay network is not necessarily growing, new people bring new relays
one idea could be this
you can timestamp the note, NIP-3 and you can download a backup of your notes, and you can have a mechanism to tell if your note is still online fine and if it doesn't find it republish

@melvincarvalho
Copy link

new people bring new relays

Side note: Not totally sure this holds up. From what I’ve seen, as more people join, the relay network actually shrinks—not expands. More users mean more load, and then relays quietly disappear. So if anything, more users bring harder times for relays.

@staab
Copy link
Member

staab commented Mar 3, 2025

Caches/aggregators are inherently centralizing. It's fine if people want to build them for bootstrapping or for efficiency, but they're not part of the spec because nostr has to work without them. The best version of such a thing would be an indexer that explicitly doesn't provide any content, but is basically a key/value map of pubkey to kind 10002 so that clients can then find relay selections. But that already exists — it's just a relay. The main problem with this currently is that everyone just hard-codes purplepag.es or relay.nostr.band when looking for relay selections. A user preference stored in the signer or nip 05 provider for bootstrapping indexers would be a slight improvement, but hardcoding multiple indexer relays is more robust and pretty much just as good (as long as all the indexers aren't lying, and the user doesn't need some special indexer that has access to non-public profiles or something).

@luigi1256
Copy link

Not totally sure this holds up. From what I’ve seen, as more people join, the relay network actually shrinks—not expands.

thank goodness users are not increasing, when did you register this fact? Because in six months there has been no increase.

@melvincarvalho
Copy link

Caches/aggregators are inherently centralizing

Not wishing to be contrary, but I think this assumption needs to be examined more closely. The inverse might actually be true. Without caching, we don’t get decentralization—we get concentration.

Right now, the alternative to caching is everyone querying the same handful of big relays, which is exactly what we see happening today. Caching reduces the burden on relays, spreads requests across the network, and allows smaller relays to be more viable—which is what decentralization actually looks like.

If anything, resisting caching may lead to more centralization, not less.

@staab
Copy link
Member

staab commented Mar 3, 2025

It depends on what you mean by caching, I agree with what you're saying. Replicating based on social graph or the role of a relay in supporting a community, topic, feed, whatever, is a type of caching. I'm specifically referring to aggregators/indexers which attempt to provide a "global view" of the entire network.

@securitybrahh
Copy link
Author

https://github.com/nostr-protocol/nips/blob/master/11.md#event-retention

eg NIP-51,33 - example of kinds retained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants