Why Nostr? What is Njump?
2025-01-31 21:04:35
in reply to

Five on Nostr: You are right assuming it is not very efficient to try to find _all_ profiles ...

You are right assuming it is not very efficient to try to find _all_ profiles matching one name(e.g. odell). In the metadata case you cannot use a tag in your filter which leaves you the only option to use kind 0 and that is a lot of events even from one relay to sift through.
On the other hand, tag filters are restricted to one letter (e.g. "#e") type of queries for obvious indexing performance reasons. There is no "#n" tag to query for because it doesn't have a special treatment in profile metadata fields, I don't know the reason why(maybe it's there in some nips discussions).

What most devs do is that they have a logged-in current user in their app usually which means they can by default grab a follow list of this user and perhaps also extend that with some web of trust algo into an extended network of trusted pubkeys. This could be on the order of 10 thousands of pubkeys. If you only grab metadata for these (and maybe defer some fetching into the future to gradually download these after login with time and also use some caching) and that will be most likely a feasible task to do.

Not everyone uses web of trust so you can even just rely on direct follows, its up to you.
So it is important in nostr to do smart queries related to the context your user needs or might soon need, because you can be drowning in events or get substantial lags and disconnection issues pretty soon if you make wrong/unreasonable decisions.

The takeaway is, there is no global on nostr so you need to adjust your app design and expectations to reflect this reality.
Author Public Key
npub16p8v7varqwjes5hak6q7mz6pygqm4pwc6gve4mrned3xs8tz42gq7kfhdw