MichaelJ 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.
Published at
2025-01-15 13:37:55Event JSON
{
"id": "bf4c680b3c2f10cf432c01308289ea8b1844678147d1e052b4d22061f74ebd1c",
"pubkey": "70122128273bdc07af9be7725fa5c4bc0fc146866bec38d44360dc4bc6cc18b9",
"created_at": 1736948275,
"kind": 1,
"tags": [
[
"e",
"9e8e40f6177d61e2670ee8c492115a8dafd00c91814c88fdf768ed3df15ed03d",
"",
"root"
],
[
"e",
"3249f69f83038054d3e463e5d0a04cf251a9c831b1078d2ecdce0a5bbd6a096f"
],
[
"e",
"e682b51034bf622cc08e9270fb3afa4a63b631a2e9e569ed989a37dd33c08c4e",
"",
"reply"
],
[
"p",
"fd208ee8c8f283780a9552896e4823cc9dc6bfd442063889577106940fd927c1"
],
[
"p",
"7317f913c3de739e83ab2ddc6700a8f5caf45fac5a02c6a886b55ef9b7e34d41"
]
],
"content": "In principle, it's pretty simple. Each user reads from some relays and writes to others.\n\nIf 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.\n\nLikewise, if A wants to ensure B can see a note, A should send to the relays B reads from, i.e., his inbox relays.\n\nHow do you identify a user's inboxes and outboxes? There are a few ways:\n- Query some common relays and download the user's relay list event.\n- Use relay hints in events or event addresses themselves, as detailed by the protocol.\n- Keep track of which event authors show up on which relays, and maintain a running list in-app of inboxes and outboxes.\n\nOther methods are likely possible. The first two are the most straightforward; any client dev can start with those.",
"sig": "b14e08bc669fb033bb36d101e3424ce7edccc3738a21dcb4790951d16cefcdeaa0f5ecbfc3777493ebfa5235bb48943df9237a91955fe3b5e7c2992ce31bb8ce"
}