jb55 on Nostr: On the plane I came up with an algorithm that does the following: given a set of ...
On the plane I came up with an algorithm that does the following:
given a set of filters, find all filters that are redundant. It pretty simple, you just determine if a filter is a subset of any other filter in the set, and then you prune those.
Example: everything is a subset of {}, the filter that matches everything, so this algorithm could take a list of 100 filters, and if {} was present it would only return that 1 filter.
This is useful for notedeck, as you would only need to open the minimal number of subscriptions remotely, while still having granular local filters active on nostrdb.
Will write up this algo soon, i have some of the code done already.
gm nostr
Published at
2024-11-02 14:39:37Event JSON
{
"id": "3c4076c9c6e650a000a8081946206ba6113fe6a14158c881b9a9f936f8ea50d5",
"pubkey": "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"created_at": 1730558377,
"kind": 1,
"tags": [],
"content": "On the plane I came up with an algorithm that does the following:\n\ngiven a set of filters, find all filters that are redundant. It pretty simple, you just determine if a filter is a subset of any other filter in the set, and then you prune those.\n\nExample: everything is a subset of {}, the filter that matches everything, so this algorithm could take a list of 100 filters, and if {} was present it would only return that 1 filter.\n\nThis is useful for notedeck, as you would only need to open the minimal number of subscriptions remotely, while still having granular local filters active on nostrdb.\n\nWill write up this algo soon, i have some of the code done already.\n\ngm nostr",
"sig": "a363cefa5abbebfb99845ae6310f00457acc41135d9b81e8962f214e8567f08c67d846747dfad2d20dac5118221fc26b91a9e83ee01a1dbfc7fb10d16a01b522"
}