buttercat1791 on Nostr: In principle, it's pretty simple. Each user reads from some relays and writes to ...
In principle, it's pretty simple. Each user reads from some relays and writes to others.
If User A wants to read an event from User B, User A should query the relays User B writes to, i.e., his outbox relays.
Likewise, if A wants to ensure B can see a note, A should send to the relays B reads from, i.e., his inbox relays.
How do you identify a user's inboxes and outboxes? There are a few ways:
- Query some common relays and download the user's relay list event.
- Use relay hints in events or event addresses themselves, as detailed by the protocol.
- Keep track of which event authors show up on which relays, and maintain a running list in-app of inboxes and outboxes.
Other methods are likely possible. The first two are the most straightforward; any client dev can start with those.
If User A wants to read an event from User B, User A should query the relays User B writes to, i.e., his outbox relays.
Likewise, if A wants to ensure B can see a note, A should send to the relays B reads from, i.e., his inbox relays.
How do you identify a user's inboxes and outboxes? There are a few ways:
- Query some common relays and download the user's relay list event.
- Use relay hints in events or event addresses themselves, as detailed by the protocol.
- Keep track of which event authors show up on which relays, and maintain a running list in-app of inboxes and outboxes.
Other methods are likely possible. The first two are the most straightforward; any client dev can start with those.