nostr:npub1zuuajd7u3sx8xu92yav9jwxpr839cs0kc3q6t56vd5u9q033xmhsk6c2uc question about NDK filters:

Do the filters assume that each tag will only contain 2 values? The tag letter and the value? Or would the NDK filters work with a tag like this:

[“r”, “url”, “title”, “id”]

?

Reply to this note

Please Login to reply.

Discussion

It’s a bit in the middle. Right now NDK doesn’t have convenience methods for accessing the values past the second but you can access the values just like any other array.

When filtering, relays don’t filter on any other value except the first anyway so it doesn’t matter for that.

Sounds like it’s best to just have multiple r tags for the same post then. Maybe like

[“r”, websiteURL],

[“r”, plainTextName],

The idea with the plain text format is to allow references to slowly become more “NOSTR native” over time. Use external databases as a crutch, until it’s not needed.

Maybe that is what a consistently formatted hashtag (“t” tag) is for though. Not sure

With both NDK and the newish relay search filters not supporting more than two items in a tag array, the underscore “l” tag in NIP-32 will have issues. Especially since the “quality” rating is the 4th item in the array and that value will need quick access for aggregation

I’m not sure I understand the issue. You will have access to everything in the tag. You just can’t search on the 3rd+ tag values (AFAIK)

If grabbing that data isn’t supported at the top level of the library (NDK or something like Noswhere), i thought it would be very inefficient. Maybe it’ll work ok though!

We need to definitely split multiple references into multiple ‘r’ tags though. Otherwise we won’t be able to say “grab all posts with this reference” if that reference is in the 3rd spot.