online resources

how to Calculate hash of block header

I'm trying to calculate the hash of block header. This is the block: { "hash" : "008b2471d9d3433712e4a21abb4ff7cb45c050bd4da11f4f79a1eabd7b89604a", "miner" : "1FZ2aoY2kLuDNNfzSorMruNq9vmdMnx8ACyoTJ", "confirmations" : 4, "size" : 647, "height" : 431, "version" : 3, "merkleroot" : "2af3c346a3e28b5f8c3fb014ea332f33e9a0f083d9eb0be59303decee35878ac", "tx" : [ "85b450ba649c5803251bc74371b4872bdf6e29790b430648507a53db97e12ee7", "a9f37988c25f5d36cba0e3d23ee7e9c86066c83094223231523f107c0ffaaac7" ], "time" : 1618564451, "nonce" : 21, "bits" : "2000ffff", "difficulty" : 5.96046447753906e-8, "chainwork" : "000000000000000000000000000000000000000000000000000000000001b000", "previousblockhash" : "006878b5c22330d92e1449d89de10bc9588c8a638e5591da30020a08e10c209a", "nextblockhash" : "00132d4c4bb2db396551af392d30e0969e69bfe64abaa7e77dc60ebadf1f861b" } so, i already trying, first step i need these values : Version : 3 hash prev block : 006878b5c22330d92e1449d89de10bc9588c8a638e5591da30020a08e10c209a merkleroot : 2af3c346a3e28b5f8c3fb014ea332f33e9a0f083d9eb0be59303decee35878ac time :1618564451 bits : 2000ffff nonce : 21 after formating the values, i get these…

Continue Reading how to Calculate hash of block header

What is the proper way to handle reorgs when fetching headers

I work on bitcoin-s, and we've found a problem where if a node is stopped with it's chain tip being a one that is later reorged out it will not be able to continue syncing headers. This happens because we request headers using a get headers message with hashes= <current chain tip> and stopHash=<00000..0000>. Since, our chain tip is reorged out we will receive the first 2000 block headers of the network. My current solution is to walk back our chain tip, and each iteration check if don't get the first 2k blocks. However, I recognize this is a poor…

Continue Reading What is the proper way to handle reorgs when fetching headers

End of content

No more pages to load