i need all block headers hash (about 500k records), i tried to get from electrum wallet files, but when i convert the file to Ascii, it doesn't have full list. please help.

  • What do you mean by "convert the file to ascii"? Do you just displaying its contents as text? If so, that won't work because block headers are ascii text, they are blobs of binary data. – Andrew Chow Aug 2 '19 at 16:02
  • i took the file "blockchain_headers" from electrum wallet and converted to ASCII format and opened in text editer in windows i see the latest block hashes but initial blocks data showing as 0's. – Vinay M Aug 2 '19 at 17:10
  • I don't know how to resolve your problem with the wallet files, but if you have a full node, you can get all hash block with the rpc framework – vincenzopalazzo Aug 4 '19 at 17:15

It seems that since v3.1.0, Electrum does not download any more the complete blockchain_headers, but only the pieces it needs to track transactions. And installing a previous version doesn't seem to work either.

So the more direct approach is probably to download the hashes from a web like https://blockchair.com/bitcoin/blocks.

It is limited to 1 million cells for free, but as you only need "Hash" column, just:

  1. deselect all checkboxes but "Hash", and click on "Export" selecting then "csv". Open this file with your spreadsheet app.

  2. If you need another column, repeat the step but just with it, and Export again to a (2) file.

  3. Open the file from (2), copy the column, and paste it next to the first column in file from (1).

  4. as the results are both ordered by time, rows coincide and you already have the desired data!

PS: As for Electrum, it is need to install a previous version below v3. With a version 2.6.4 it seems to work and produce a complete blockchain_headers file. There's a Python script to convert it to a .csv file.

| improve this answer | |
  • thanks ,the code works. In the output i see only 0's till 500k lines. looks like the electrum file doesn't contain the whole list – Vinay M Aug 6 '19 at 23:39
  • You're rigth: It seems that since v3.1.0, Electrum does not download any more the complete blockchain_headers. I've modified the answer: you may use a previous version that downloads the complete blockchain. You need the last data? Because probably I have some from a year ago or so... – circulosmeos Aug 7 '19 at 16:32
  • Electrum blockchain_headers file is not usable any more: I've changed the answer with another approach that fits your needs. – circulosmeos Aug 8 '19 at 12:08
  • Thank you so much for helping me out . It was helpful. I have one more question - i have installed bitcoind and its downloading blocks. could you please tell me how to retrieve the balance, has,tx...etc ? – Vinay M Aug 8 '19 at 23:47
  • Sorry, I do not know bitcoind: but you can post a new question and someone else will help you! :-) – circulosmeos Aug 9 '19 at 6:42

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.