There is NIP-45, that is used to count how many events match a certain filter. So the proof ideally would prove that X (the returned count) events with valid signatures actually matched the filter(s).

Replies (2)

i must make a note to implement count on #orly - the database is designed to avoid needing to decode events before it is certain they are result candidates, so it can actually do it, at least for author/kind/timestamp filters, without decoding a single event stored in the database. probably i need to add a new index that covers the gap with tags, like pubkey/tag/timestamp, and the count function never has to decode any events. my main objection to count had to do with the excessive work required that was basically the same as if you actually just fetch the event and do that processing locally. but with the necessary indexes that doesn't have to happen. trading off the size of the database for the speed of search and count is what i'm talking about. there definitely is algorithms that would run a lot faster if they could do counts
Michael's avatar
Michael 4 months ago
It’s definitely doable but can take quite some time and resources, so it might be a fit only for archiving old data. Eg for 422k likes it would be several hours and up to 1TB of ram which would cost $6-8 per hour. The cost can be justified if the events are quite sensitive but def not for ordinary posts:) We do expect 10-100x perf improvements in the nearest future though so it might become viable at some point