Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NIP-01] Subscription for Author/Authors redundant #34

Closed
scsibug opened this issue Dec 11, 2021 · 3 comments
Closed

[NIP-01] Subscription for Author/Authors redundant #34

scsibug opened this issue Dec 11, 2021 · 3 comments

Comments

@scsibug
Copy link
Contributor

scsibug commented Dec 11, 2021

The "author" and "authors" fields in a REQ message are redundant.

Since these fields are ANDed together, if a subscription filter includes author=A, and authors=[B,C], then it will never return any results. If the filter uses author=A, authors=[A,B,C], it is equivalent to only sending the authors field.

Since it never makes sense to use both of these fields at the same time, and "authors" is more general than "author", I suggest dropping the "author" field from REQ altogether.

@fiatjaf
Copy link
Member

fiatjaf commented Dec 11, 2021

@Kukks do you remember the reason for this? I also have a vague memory of there being a reason, but was checking in my own implementation and used all my reasoning power but couldn't find it. It seems to make absolute sense to drop it. That will make the protocol simpler at no cost.

@fiatjaf
Copy link
Member

fiatjaf commented Dec 11, 2021

OK, I remember now.

The authors field is used to request events from multiple different authors. For example, if you're doing a Twitter clone and want posts from a list of pubkeys you follow you'll use the authors combined with a kind: 1, for example.

Meanwhile, if you want posts from a single pubkey you would use author.

It showed up this way because first I had only the author field and later added authors.

It was good to remember the reason on why this exists, but of course it makes no sense to keep both fields, we can have just authors and set it to an array containing a single element and it will be the same.

@fiatjaf
Copy link
Member

fiatjaf commented Dec 16, 2021

I'll go ahead and remove the author field from the spec, it will be better without it.

scsibug added a commit to scsibug/nostr-rs-relay that referenced this issue Dec 17, 2021
The `authors` field is sufficient to represent all queries that
`author` could have been used in.  See
nostr-protocol/nostr#34 for the discussion leading
to this removal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants