joshstevens19 / ethereum-bloom-filters

Ability to check bloom filters on ethereum.
MIT License
87 stars 8 forks source link

How do you create a bloom filter and add elements to it? #1

Open gubatron opened 4 years ago

gubatron commented 4 years ago

I only see functions to perform checks on a bloom filter, but no functions to create one and add elements to it. Not sure how I'd be able to use the library without a bloom filter in the first place. Does solidity or web3 provide bloom filter primitives?

joshstevens19 commented 4 years ago

Hey @gubatron thanks a lot for raising this issue. The library was initially created for easy looks ups from “logBlooms” and topic blooms which are returned on blocks from Ethereum itself (so ethereum give you the blooms). This libs functions are used in big ethereum libraries like web3js as utils for developers to query data against the blooms given to them on every new block. So it only exposes functions which you pass it a value and a bloom and it tells you if it exists in that bloom filter or not.

Happy to extend this library to have ability to create a new bloom, add to it and remove elements from it for sure. Is that something you would like to see in this library?

I’m on vacation till Monday but will look when back. Let me know if you would like to see anymore then:

Thanks 👍