Need help to /block

{
“network_identifier”: {
“blockchain”: “bitcoin”,
“network”: “mainnet”,
“sub_network_identifier”: {
“network”: “shard 1”,
“metadata”: {
“producer”: “0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5”
}
}
},
“block_identifier”: {
“index”: 1123941,
“hash”: “0x1f2cc6c5027d2f201a5453ad1119574d2aed23a392654742ac3c78783c071f85”
}
}

I want to know where the request parameter block_identifier of /block can be obtained. Index I know it is the block height, but where can the corresponding hash field be obtained?

Hi @woxihuanmoon , welcome to Rosetta community.

So technically you don’t need block hash to get the block. It is possible there are two block with same index and different hash (in case of re-orgs). So in that case, if you know the blockhash you can pass that. If not then if you just give the block height, you will get the block which is included in that chain. Assuming your chain supports both fetching block by hash and block by number. Here’s a reference implementation for Ethereum which you could refer.

Let me know if there are more questions.