2

I'm trying to implement a seeded murmur3 hash using the bip37 standard for use in bloom filters.

In hash.cpp in bitcoin core, the seed is an unsigned int value. However my understanding of bip37 to determine a seed value is defined with the formula i * BIP37 Constant + Tweak where i iterates the number of functions.

Example, If i = 4, and Tweak = 100, this would lead to an overflow since it cannot be represented in a uint32?

I would be grateful for help, and to know if I need to use a 64-bit int for my seed. Thanks.

1 Answer 1

1

Murmur3 is a 32-bit hash function. All internal variables, as well as the seed and the output, are unsigned 32-bit integers. uint32_t arithmetic is modulo 232.

Also note that BIP37 is all but dead.

2
  • Oh I see thanks, so what replaced bip37 for bloom filters?
    – Chiru
    Sep 23, 2021 at 12:44
  • 1
    It's not a direct replacement, but bip157.
    – Claris
    Sep 23, 2021 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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