Why Nostr? What is Njump?
2025-03-20 21:14:48

ciori on Nostr: fiatjaf Kind of a strange question as I don't really know how clients usually handle ...

Kind of a strange question as I don't really know how clients usually handle this kind of stuff, but let's say I want to build a relay that needs to process different Kinds requests in different manners, for example in the cashu world there are kinds that only the owner should retrieve and others that possibly anyone could ask for.

Now as I understand with #khatru based relays I don't see any problem when I need to check a new "write" event request, as it will only have one kind, but for "read" actions (I am referring to the `relay.RejectFilter` function) you have the input `filter` variable that contains the list of Kinds requested by the client, so it could be multiple kinds. In this last case, what is the best practice to handle this type of logic? Should I assume to expect only one kind from the client request and then process them "individually"? Should a relay process them in particular ways as I could get a filter with both a "private" (example: 17375) and a "public" (example: 10019) kind in the list?

Maybe the last two kinds are not a really good example as a wallet client will probably never ask them both on the same request, but you get the point. I hope I made my doubt clear.
Author Public Key
npub1hupmmajeu337x9t54lmknr8c8dxdsx430q5uytmatn8hd74vmw7s6unnm6