From the documentation: https://ww.getmonero.org/resources/developer-guides/daemon-rpc.html#get_hashesbin

The description is not clear:

block_ids - binary array of hashes; first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block

start_height - unsigned int

Can you give an example?

What does block_ids and start_height do?


I believe the documentation maybe slightly outdated / misleading. Looking at the source code, the vector of block hashes, block_ids, would have the hashes (in binary form) starting with your local most recent few block hashes and ending with the genesis block's hash (so in reverse chronological order). start_height is used to specify the height of your most recent block hash.

Let's assume you have the block hashes in block_ids of [B10, B9, B8, B0] and start_height set to the height of B10 (where Bn is the hash of block n).

If the remote node you are calling the method on has blocks B0 through B2000, it would return, in m_block_ids, the hashes for blocks B1010 through B10 and return start_height as the height of block hash B1010. As you see, only a maximum of 1000 hashes are returned (think of it like a page of hashes), so you can then call the method again but this time with block_ids of hashes [B1010, B0] and start_height as returned from the last call's response start_height (so the height of block hash B1010).

Note, this method, and the other .bin methods, are binary encoded, not JSON.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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