3

Excerpt from page 6 of the yellow white paper:

enter image description here

I can understand the first three definitions, the fourth one is problematic. How does the m function actually work? Maybe I'm not too familiar with formal specification, but I'm specifically confused on the [i,i+1] part. Does it take the bits at position i and i+1 of the hash, sum them up and then apply modulo 2048?

1 Answer 1

1

Consider the following input

ethereum yellow paper

Consider it's Keccak-256 hash according to this website:

7f110dc4c0a897ea5187a67e2c3a7db3a43410df8d1754fbdf28351c7e58400f

The first three pairs of bytes of Keccak-256 of an input string-

{7,f},{f,1},{1,0}

1) {7,f}

low order 11 bits of each of the first three pairs of bytes calculated using this website

00110111011

Its decimal equivalent calculated using this website is 443. 443%2048 = 443

Bloom filter will set a 443'th bit of 2048 bit sequence.

2) {f,1}

low order 11 bits of each of the first three pairs of bytes calculated using this website

01100110001

Its decimal equivalent calculated using this website is 817. 817%2048 = 817

Bloom filter will set a 817'th bit of 2048 bit sequence.

3) {1,0}

00110001001

low order 11 bits of each of the first three pairs of bytes calculated using this website

Its decimal equivalent calculated using this website is 393. 393%2048 = 393

Bloom filter will set a 393'th bit of 2048 bit sequence.

[i,i+1] denotes bytes at position i and i+1

Hope it helps!

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.