I keep waiting for relay hints to start appearing in e tags but they never do. Same with DMs, I simply can't DM certain people because their client doesn't look in the right place. This is probably the most important thing to fix on nostr.
Discussion
https://github.com/damus-io/damus/issues/1147 patches and PRs welcome 🙏
it would help a lot since most relays act like POP with DMs and don't share them around
I have several TODOs in my code to add relay hints, and every time I want to start to implement them I remind myself why I didn’t add them yet: I don’t know which relay hint to add.
For example when I receive most posts from "wss://filter.nostr.wine/npub1n0sturny6....?broadcast=true" I can't add that as a relay hint, its a relay for my account.
I received many posts from wss://relay.damus.io, but can't add that it was recently nuked so the posts might not be there anymore.
Querying all relays to see if the posts are still there would put unnecessary stress on the relays.
I can't just rebroadcast posts because some relays don't accept old posts.
How do other clients do it? Is there a good solution?
Any hint is better than no hint, so I don't think there's any reason to overthink it too much. But the heuristic Coracle uses is:
1. Get rid of non-shareable relay urls (localhost, tor, auth'd relays)
2. Grab a random write relay from the event's author's 10002 list
3. Fall back to the relay the note was seen on
4. Fall back to a random read relay from the user's list
Hints aren't really a complete solution unfortunately. They'll eventually rot as relays go away or user selections change. This doesn't matter for most notes, which are effectively ephemeral, but for older notes we do need a more robust strategy. This could be done using an indexer, or establishing conventions around copying a user's existing notes to their new relay selections.
This could even be done by the relays themselves — scan the network, when you find that a user has added your relay as a "write" relay, scrape the network for that user's notes and copy them to your database. That would be kind of interesting.
Grabbing a write relay from the author is the piece of the puzzle I was missing, still not great but better than nothing yes.
It's not related to nostr protocol, but few months ago I started working on a tool that listens events you need and trigger some actions (webhook for example, but telegram or discord could be added easily I think)
I should go back working on it, I think