-
Notifications
You must be signed in to change notification settings - Fork 619
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
Question regarding NIP-12 #278
Comments
I thought this might already be possible by virtue of prefix filtering. Some relays allow as per nip-1 I think to send pubkey prefixes in author queries, so it would make sense to extend that to "#p" tags, making a filter for One relay (wss://nostr-pub.wellorder.net) returns no results while another relay (wss://relay.damus.io) gives me:
|
@Giszmo thanks for your quick response, can confirm! Plus looking at the code of e.g. relayer https://github.com/fiatjaf/relayer/blob/d7750ad15f213687e4bc01da235604e7a8606c6a/storage/postgresql/query.go#L91 the intended behaviour is to ignore queries without tag values |
not so easy, afaict, to implement prefix matching in SQL when there is an unknown length array of strings to consider for each event, unlike pubkey/id which have just a single string for each event. I could be wrong though, not an SQL expert. |
If the intention of the note-writer is to make their event index-able via a specific "topic name", they can just put a If you want to see which events have a specific tag (like |
The tag filters only match the second string and not the others. The filter |
@Giszmo Where can I find more information about the prefix filtering? Is this standardized? |
@Giszmo Ok, it talks only about
Do we need another NIP for that? |
Yeah, probably. I'm not sure how many of the relays or clients support prefix queries. |
@Giszmo Geohashes are encoded in base32, so a character like "*" could be used for prefix queries. For example, I could either search exactly "dqcjqcpew" or search a prefix "dqcjqcp*". This "*"-format could be used as well for other tags that contain base32/base64/hex data, but I think each one should have its own NIP to explain why it is important (indexing irrelevant data for prefix-search might cost the relay operators significantly). Tags that contain random texts might contain the "*" character, so this requires escaping the character and might not be backward compatible - but this is out of scope for now. |
First off: I'm really enjoying exploring the Nostr protocol, amazing work so far! One thing is not entirely clear to me though: What's the rationale behind only allowing tag queries in which there is at least one tag value in common with the filter and event in NIP-12? This prevents filtering for events with a specific tag name in cases where the client doesn't care about the tag value. I can image clients filtering e.g. for all kind 1 events with a reference (tag r) or geohash tag set (tag g). Wouldn't it be useful if clients could filter for events which match the tag name only?
The text was updated successfully, but these errors were encountered: