Pairing a nostr query with a nostrscript(wasm) filter makes a lot of sense: the nostrscript can be jit-compiled and cached, and the query plan is determined from the base nostr query so that the results can start returning instantly and efficiently. I think I just came up with a new kind of database powered by nostr ๐ค
Arbitrary but fast sandboxed code execution to query a database sounds really cool, and it can be really fast, fast as strfry.
What if instead of just filtering, we pass a reducer, so you could effectively do map-reduce over nostr data ๐ค this can be used for counting and grouping nostr notes in arbitrary ways, directly from a query, efficiently. Holy shit.
Login to reply
Replies (2)
@elsat new weekend ๐๐ณ๏ธ just dropped
I've been thinking about this more, I think I would instead do a turing-incomplete language for arbitrary queries on public relays. the queries could have an execution budget like rusty's bitcoin script varops proposal.
otherwise wasm is fine for local queries.