Skip to content

Limit Nostr delivery targets by kind #2257

@snarfed

Description

@snarfed

Nostr delivery is somewhere between AP, where you deliver activities to everyone they touch, far and wide, and ATProto, where you write everything locally to your PDS. In Nostr, afaict you deliver replies, mentions, and quotes, to the target user's write relay, but not other activities that reference them, eg follows. This may need us to pass from_user into Protocol.target_for? Not sure.

From https://nips.nostr.com/65 :

When publishing an event, clients SHOULD:

  • Send the event to the write relays of the author
  • Send the event to all read relays of each tagged user
  • Send the author's kind:10002 event to all relays the event was published to

Recently we sent a follow to the followee's first write relay, and it rejected the event with an AUTH request, which we presumably can't satisfy. Hopefully it would have allowed events that mention or reply to them, and only rejected the follow since it shouldn't be sent there?

17:26:43.132

Receiving web follow https://snarfed.org/2025-12-16_followed-fiatjaf  AS1: {
  "objectType": "activity",
  "verb": "follow",
  "id": "https://snarfed.org/2025-12-16_followed-fiatjaf"
  "published": "2025-12-16T17:26:34-08:00",
  "content": "follows <a class=\"u-follow-of\" href=\"nostr:3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d\">fiatjaf</a>",
  "url": "https://snarfed.org/2025-12-16_followed-fiatjaf",
  "object": "nostr:3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
  "actor": {
    "objectType": "person",
    "displayName": "Ryan Barrett",
    "url": "https://snarfed.org/",
    "image": [{ "url": "https://secure.gravatar.com/avatar/8bc1fa68e66351467e5284c8a5aa45bd515c09449cea9213a9d07e59b74710d3?s=96&d=blank&r=g" }],
    "id": "snarfed.org"
  },
}
Follow snarfed.org => nostr:3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d
...
("5.9.78.12", 443) <= ["REQ", "wpfPbBj2J1pWDnb-PRBh8g", {
  "authors": ["3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
  "kinds": [0,10002],
  "limit": 20
}]
...
('5.9.78.12', 443) => ["EVENT","wpfPbBj2J1pWDnb-PRBh8g",{
  "content": "",
  "created_at": 1762090491,
  "id": "d0e33d8962407c6cccd1bdb7d33640f1a8920d925f9a583d20b8e790c2bb97d6",
  "kind": 10002,
  "pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
  "sig": "fc8722963dd016fd8985f3fd629ef6253dcef2e2528bc84ae43a2eb4e72f8e3c28539f89e9561010096a1263281ee56839bb6e4190e57a324fb18c37b2ffb55c",
  "tags": [
    ["r","wss://inbox.relays.land/","read"],
    ["r","wss://pyramid.fiatjaf.com/","write"],
    ["r","wss://relay.westernbtc.com/","write"],
    ["r","wss://pyramid.fiatjaf.com/inbox","read"]
  ]
}]
...
("144.91.118.169", 443) <= {
  "kind": 3,
  "id": "754a37d2022d9e378429f3076461b7cde6ad27ef9377980910250d1b67cacb4e",
  "pubkey": "7dcc73e9f32356da460ab01a9db54c7c8a082fb07db4ac2d44bc10608ef05cbe",
  "content": "follows fiatjaf",
  "tags": [
    ["proxy","https://snarfed.org/2025-12-16_followed-fiatjaf","web"],
    ["p","3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d","",""]
  ],
  "created_at": 1765934802,
  "sig": "1a34449bdeecea9b5e4b60ebdb18c58db7e2f7338712aa21d2b0f573eb0b6175cfae2a43e1bc69739ddef0cd7e4977501810db4901c737639837ba9856a8bfed"
}
('144.91.118.169', 443) => ["AUTH","1bc584b91e3e5961"]
relay rejected event!
Failed sending!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions