Since there are strict storage and computational limits forced by a VM some operations for enterprise-level contracts are impossible. Is there some Bloom filter implementation available in existing library for use in Solidity? It could be used to optimise some algorithms. I do not feel ready for porting some algorithm myself :(

  • Please provide an example of what you claim is impossible.
    – T9b
    Apr 16, 2016 at 14:01
  • Agreed. Need a better example. Ethereum events actually function from bloom filters.
    – VoR0220
    Apr 16, 2016 at 18:56
  • Looks like the Aldekein is simply looking for a library which implements a bloom filter. There are op-codes for various hashes and Bitwise logic operations so should be possible to implement a simple she256 based BF Apr 16, 2016 at 20:20
  • @JackWinters is correct, I'm searching for a library.
    – Aldekein
    Apr 19, 2016 at 0:38

1 Answer 1


I don't think bloom filter would be useful in contracts as it is prone to bloating attacks.

Malicious user can add to a bloom filter a number of entries specifically prepared to increase number of false positives (by increasing number of 1-bits in filter).

  • 1
    Though in a private Ethereum-based blockchain, where you could all but guarantee the safety of the network, such attacks wouldn't be a concern :-) Mar 3, 2017 at 22:03
  • It depends! A pre-committed bloom filter could be useful for specific types of whitelist where the contract doesn't mind a certain number of false positives. Apr 16 at 1:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.