<p>For your purposes may be this dataset is sufficient: <a href="http://headers.electrum.org/blockchain_headers" rel="nofollow noreferrer">http://headers.electrum.org/blockchain_headers</a></p>
<p>It spans from block 0 to <a href="https://blockchair.com/bitcoin/block/477636" rel="nofollow noreferrer">477636</a> (2017-07-26 09:03 (just 9 months ago)) and contains just the <a href="https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers" rel="nofollow noreferrer">block headers</a>.</p>
<p>It is binary, but can be easily converted to a csv ASCII file with this Python script:</p>
<pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python
# convert binary file http://headers.electrum.org/blockchain_headers 
# to CSV ASCII

import binascii

STRUCT_OF_BLOCK = [ 4, 32, 32, 4, 4, 4 ] # blockchain_headers does not contain always &quot;0x00&quot; txn_count
BLOCK_SIZE = sum(STRUCT_OF_BLOCK)

FILE_OUT= open('blockchain_headers.csv','w')

FILE_OUT.write( &quot;version,prev_block,merkle_root,timestamp,bits,nonce,txn_count\n&quot; )

with open('blockchain_headers','rb') as FILE:
    block = FILE.read(BLOCK_SIZE)
    while block != b'':
        position = 0
        for i in STRUCT_OF_BLOCK:
            FILE_OUT.write( bytearray(binascii.hexlify( block[position:(position+i)][::-1] )).decode('ascii') + ',')
            position += i
            if position &gt;= BLOCK_SIZE:
                FILE_OUT.write(&quot;00\n&quot;) # blockchain_headers does not contain always &quot;0x00&quot; txn_count
        block = FILE.read(BLOCK_SIZE)
</code></pre>

CC BY-SA 4.0
2018-05-08T18:32:14.357Z
thank you  . No plans to have full block headers updated from time to time ?  http://headers.electrum.org/
darius
CC BY-SA 4.0
2018-05-08T21:41:55.563Z
You can install electrum, and that very same file will be regenerated live on ~/.electrum after you add a wallet: any a public address will suffice for this purpose.
circulosmeos
CC BY-SA 4.0
2018-05-28T20:59:39.227Z
@darius : has been the answer helpful? Please consider voting it in that case :-)
circulosmeos
CC BY-SA 4.0
2018-06-14T17:32:44.527Z
I am really sorry for my late response but stackexchange log in fails if you start from email link, since my first log in is via StackOverflow and login credentials are not cashed for SE via cookies. Just let me to test your script for 1-2 days and let me to install electrum to get full and updated blockchain headers.  Just give me 2 days. I am sure your answer is the best on our globe ;)
darius
CC BY-SA 4.0
2018-06-14T18:25:04.577Z
https://electrum.com/ is alibaba company ;)  Warning: A fake copy of Electrum, named 'Electrum Pro', is actually bitcoin-stealing malware. More information here  https://electrum.org/#download  My desktop win32 Win XP is no more supported, have number of Android tablets and the latest comes with Win 10 64bit, not sure what selection is best, since 3 tablets come with 3G support , so I need to move SIM card from 3G modem to 3G SIM slot in tablet. Win 10 tablet comes without 3G modem. Have another deskop Vista 32bit installed (P4), have 3G wireless router, . Any advice ?
darius
CC BY-SA 4.0
2018-06-15T06:03:56.200Z
You could try "Installation from Python sources" in which you'll find both pyqt5 and python in 32 bit versions. To install the electrum zip just unzip it.
circulosmeos
CC BY-SA 4.0
2018-06-17T17:43:58.907Z
Ok, but how to discover which number identifies 32bit version.  https://download.electrum.org/ i moved back to electrum-3.0.0.exe and still not the correct win32 version . Installation from Python sources refers to https://electrum.org/#download electrum-3.1.1 which is not the correct win32 version Which compiler do I need to avoid Troian/virus report https://www.reddit.com/r/Bitcoin/comments/7b4mwe/electrum_and_trojanwin32bitrepa/  https://www.virustotal.com/pl/file/d584118028972d64a39674c76789819fb884da1a017642d9e305351f2793d4bd/analysis/1501419900/  BTW My new tablet runs 64bit Windows 10
darius
CC BY-SA 4.0
2018-06-22T06:16:23.970Z
Win32 installation requires just: install python (32 bits) from https://www.python.org/downloads/windows/, install PyQt5,
Install Electrum-3.1.3.zip (as indicated at https://electrum.org/#download ). But you can also install "electrum Bitcoin wallet" on an Android device, and after running it, you'll find the file with block headers at /sdcard/org.electrum.electrum/blockchain_headers
circulosmeos
CC BY-SA 4.0
2018-06-25T22:25:42.570Z
Python 3.4.4 installed (the latest supported by WinXP 32) and is on

print (“Hello World!”) from http://dooling.com/index.php/2006/03/14/python-on-xp-7-minutes-to-hello-world/#footnote_0_48

print ("Hello World") supported
ok
In the electrum directory, run 'python3 electrum'
not supported, since  PyQt5 not installed
 temporarily set environment variables, open Command Prompt and use the set command:

C:\>set PATH=C:\Program Files\Python 3.6;%PATH%
C:\>set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib
C:\>python
from https://docs.python.org/3/using/windows.html
darius
CC BY-SA 4.0
2018-06-25T22:32:24.183Z
not sure how to install PyQt5 from https://riverbankcomputing.com/software/pyqt/download5
 pip3 install PyQt5
refers to
https://www.riverbankcomputing.com/software/sip/download
refers to
https://pypi.org/project/SIP/
should I download wheel for win32 
to run 
pip3 install sip
Wheels for 32 and 64-bit Windows, 64-bit OS X and 64-bit Linux can be installed from PyPI: ????
how to start ?
darius
CC BY-SA 4.0
2018-06-26T21:55:50.293Z
You can also install "electrum Bitcoin wallet" on an Android device, and after running it, you'll find the file with block headers at /sdcard/org.electrum.electrum/blockchain_headers
circulosmeos
CC BY-SA 4.0
2018-06-28T23:16:52.203Z
thank you
I feel myself close to a solution, to install electrum Bitcoin wallet on my Win32 WinXP PC.
The only problem is how to install PyQt5 since
Before you can build PyQt5 you must have already built and installed SIP
to install SIP I need 
So long as you are using a supported version of Python you can install PyQt5 from PyPi by running:

    pip3 install PyQt5
how can I handle wheels in Win32 ?
To get android tablet to work, I need to insert 3G sim card into it to get Internet access
I live on a single SIM card already inserted into my 3G usb modem inserted into PC
darius
CC BY-SA 4.0
2018-06-30T19:05:56.207Z
you can't use pip3? * If not, why?: It should be available on your Windows python directory under Python34\Scripts. * If yes, what is the output from "pip3 install PyQt5"?
circulosmeos
CC BY-SA 4.0
2018-07-08T22:45:46.493Z
I have installed Python27 for win32, no such directory Python27/Scripts  Scripts come with Python27/Tools/Scripts no pip3
darius
CC BY-SA 4.0
2018-07-12T18:52:27.113Z
Ok: follow these instructions in order to install pip for your Python27 (seems to be a vesion <2.7.9 'cause it's integrated nowadays): https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows
circulosmeos
CC BY-SA 4.0
2018-07-13T20:45:43.447Z
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retr
ies exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499:
 error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
'),)) - skipping
  Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip   https://bootstrap.pypa.io/get-pip.py     
Install setuptools
Install pip
no .msi file https://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
darius
CC BY-SA 4.0
2018-07-13T21:11:28.967Z
downloaded get-pip.py
run
python get-pip.py
which generated error listing
pip.msi installer not found at the place advised
Life is not easy but I am working hard ;) to get pip.msi finally
since what I get are wheels only
darius
CC BY-SA 4.0
2018-07-14T10:57:05.833Z
I don't know if this work, but you can download https://download.lfd.uci.edu/pythonlibs/l8ulg3xw/pip-10.0.1-py2.py3-none-any.whl and open it as a zip file (just change the extension to .zip), and copy the two folders inside (pip & pip-10.0.1.dist-info) to your folder "...Python27\Lib\site-packages\" ,and see what happens...
circulosmeos
CC BY-SA 4.0
2018-07-14T11:10:50.897Z
Or alternatively, you can follow these instructions to **install a wheel without pip**, that work also to install "pip.whl" without pip: https://stackoverflow.com/questions/36132350/install-python-wheel-file-without-using-pip#49524140
circulosmeos
CC BY-SA 4.0
2018-07-16T00:22:04.380Z
D:\Python27>python D:\Python27\Lib\site.py
sys.path = [
    'D:\\Python27\\Lib',
    'C:\\WINDOWS\\system32\\python27.zip',
    'D:\\Python27\\DLLs',
    'D:\\Python27\\lib\\plat-win',
    'D:\\Python27\\lib\\lib-tk',
    'D:\\Python27',
    'D:\\Python27\\lib\\site-packages',
]
USER_BASE: 'C:\\Documents and Settings\\a\\Dane aplikacji\\Python' (doesn't exis
t)
USER_SITE: 'C:\\Documents and Settings\\a\\Dane aplikacji\\Python\\Python27\\sit
e-packages' (doesn't exist)
ENABLE_USER_SITE: True

D:\Python27>
darius
CC BY-SA 4.0
2018-07-16T06:35:05.610Z
Ok, have you tried to copy the two pip wheel unzipped folders to your 'D:\\Python27\\lib\\site-packages' ?
circulosmeos
CC BY-SA 4.0
2018-07-25T23:21:04.990Z
I did exactly what you have asked me to do for.
I need to learn some basics of Python and make my win10 tablet to get Internet access via OTG 3G modem, since moving SIM card back and forth, between 2 tiny slots (first in 3G modem a second in win10 tablet) may destroy it soon.
Ok, it looks like wheels just act as compressed packages, unfortunately pip3 failed to run
I will keep trying to run Python under WinXP
darius
CC BY-SA 4.0
2018-07-26T17:43:44.057Z
Bear in mind that the folders copied to your D:\\Python27\\lib\\site-packages provide the command **pip** not **pip3** (this is for Python **3**). Try using **pip**...
circulosmeos
CC BY-SA 4.0
2018-04-15T22:14:57.970Z
2023-05-10T19:16:56.990Z
2023-05-10T19:16:56.990Z
circulosmeos
<p>do you know any download site for full blockchain header data (6 variables) in CSV ASCII format ?</p>

<p>I would like to enter block header data for every block from No.0 to latest into mining simulator to let students see, every nonce calculated works and any other nonce, random selected fails.</p>

<p>thank you</p>

<blockchain><raw-data><block-header>
Do you know any download site for full blockchain header data (6) in CSV ASCII format?
darius
# Do you know any download site for full blockchain header data (6) in CSV ASCII format?

(Asked by: username_0 on 2017-12-29)

do you know any download site for full blockchain header data (6 variables) in CSV ASCII format ?

I would like to enter block header data for every block from No.0 to latest into mining simulator to let students see, every nonce calculated works and any other nonce, random selected fails.

thank you

**Tags:** blockchain, raw-data, block-header


---

## 1 answers

### Answer by username_1 on 2018-04-15. Score: 1

For your purposes may be this dataset is sufficient: http://headers.electrum.org/blockchain_headers
It spans from block 0 to 477636 (2017-07-26 09:03 (just 9 months ago)) and contains just the block headers.
It is binary, but can be easily converted to a csv ASCII file with this Python script:
#!/usr/bin/env python
# convert binary file http://headers.electrum.org/blockchain_headers 
# to CSV ASCII

import binascii

STRUCT_OF_BLOCK = [ 4, 32, 32, 4, 4, 4 ] # blockchain_headers does not contain always "0x00" txn_count
BLOCK_SIZE = sum(STRUCT_OF_BLOCK)

FILE_OUT= open('blockchain_headers.csv','w')

FILE_OUT.write( "version,prev_block,merkle_root,timestamp,bits,nonce,txn_count\n" )

with open('blockchain_headers','rb') as FILE:
    block = FILE.read(BLOCK_SIZE)
    while block != b'':
        position = 0
        for i in STRUCT_OF_BLOCK:
            FILE_OUT.write( bytearray(binascii.hexlify( block[position:(position+i)][::-1] )).decode('ascii') + ',')
            position += i
            if position >= BLOCK_SIZE:
                FILE_OUT.write("00\n") # blockchain_headers does not contain always "0x00" txn_count
        block = FILE.read(BLOCK_SIZE)

> **Comments:**
> **username_0**: thank you  . No plans to have full block headers updated from time to time ?  http://headers.electrum.org/  
> **username_1**: You can install electrum, and that very same file will be regenerated live on ~/.electrum after you add a wallet: any a public address will suffice for this purpose.  
> **username_1**: @username_0 : has been the answer helpful? Please consider voting it in that case :-)  
> **username_0**: I am really sorry for my late response but stackexchange log in fails if you start from email link, since my first log in is via StackOverflow and login credentials are not cashed for SE via cookies. Just let me to test your script for 1-2 days and let me to install electrum to get full and updated blockchain headers.  Just give me 2 days. I am sure your answer is the best on our globe ;)  
> **username_0**: https://electrum.com/ is alibaba company ;)  Warning: A fake copy of Electrum, named 'Electrum Pro', is actually bitcoin-stealing malware. More information here  https://electrum.org/#download  My desktop win32 Win XP is no more supported, have number of Android tablets and the latest comes with Win 10 64bit, not sure what selection is best, since 3 tablets come with 3G support , so I need to move SIM card from 3G modem to 3G SIM slot in tablet. Win 10 tablet comes without 3G modem. Have another deskop Vista 32bit installed (P4), have 3G wireless router, . Any advice ?  
> **username_1**: You could try "Installation from Python sources" in which you'll find both pyqt5 and python in 32 bit versions. To install the electrum zip just unzip it.  
> **username_0**: Ok, but how to discover which number identifies 32bit version.  https://download.electrum.org/ i moved back to electrum-3.0.0.exe and still not the correct win32 version . Installation from Python sources refers to https://electrum.org/#download electrum-3.1.1 which is not the correct win32 version Which compiler do I need to avoid Troian/virus report https://www.reddit.com/r/Bitcoin/comments/7b4mwe/electrum_and_trojanwin32bitrepa/  https://www.virustotal.com/pl/file/d584118028972d64a39674c76789819fb884da1a017642d9e305351f2793d4bd/analysis/1501419900/  BTW My new tablet runs 64bit Windows 10  
> **username_1**: Win32 installation requires just: install python (32 bits) from https://www.python.org/downloads/windows/, install PyQt5, Install Electrum-3.1.3.zip (as indicated at https://electrum.org/#download ). But you can also install "electrum Bitcoin wallet" on an Android device, and after running it, you'll find the file with block headers at /sdcard/org.electrum.electrum/blockchain_headers  
> **username_0**: Python 3.4.4 installed (the latest supported by WinXP 32) and is on  print (“Hello World!”) from http://dooling.com/index.php/2006/03/14/python-on-xp-7-minutes-to-hello-world/#footnote_0_48  print ("Hello World") supported ok In the electrum directory, run 'python3 electrum' not supported, since  PyQt5 not installed  temporarily set environment variables, open Command Prompt and use the set command:  C:\>set PATH=C:\Program Files\Python 3.6;%PATH% C:\>set PYTHONPATH=%PYTHONPATH%;C:\My_python_lib C:\>python from https://docs.python.org/3/using/windows.html  
> **username_0**: not sure how to install PyQt5 from https://riverbankcomputing.com/software/pyqt/download5  pip3 install PyQt5 refers to https://www.riverbankcomputing.com/software/sip/download refers to https://pypi.org/project/SIP/ should I download wheel for win32  to run  pip3 install sip Wheels for 32 and 64-bit Windows, 64-bit OS X and 64-bit Linux can be installed from PyPI: ???? how to start ?  
> **username_1**: You can also install "electrum Bitcoin wallet" on an Android device, and after running it, you'll find the file with block headers at /sdcard/org.electrum.electrum/blockchain_headers  
> **username_0**: thank you I feel myself close to a solution, to install electrum Bitcoin wallet on my Win32 WinXP PC. The only problem is how to install PyQt5 since Before you can build PyQt5 you must have already built and installed SIP to install SIP I need  So long as you are using a supported version of Python you can install PyQt5 from PyPi by running:      pip3 install PyQt5 how can I handle wheels in Win32 ? To get android tablet to work, I need to insert 3G sim card into it to get Internet access I live on a single SIM card already inserted into my 3G usb modem inserted into PC  
> **username_1**: you can't use pip3? * If not, why?: It should be available on your Windows python directory under Python34\Scripts. * If yes, what is the output from "pip3 install PyQt5"?  
> **username_0**: I have installed Python27 for win32, no such directory Python27/Scripts  Scripts come with Python27/Tools/Scripts no pip3  
> **username_1**: Ok: follow these instructions in order to install pip for your Python27 (seems to be a vesion <2.7.9 'cause it's integrated nowadays): https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows  
> **username_0**: Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retr ies exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499:  error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version '),)) - skipping   Could not find a version that satisfies the requirement pip (from versions: ) No matching distribution found for pip   https://bootstrap.pypa.io/get-pip.py      Install setuptools Install pip no .msi file https://www.lfd.uci.edu/~gohlke/pythonlibs/#pip  
> **username_0**: downloaded get-pip.py run python get-pip.py which generated error listing pip.msi installer not found at the place advised Life is not easy but I am working hard ;) to get pip.msi finally since what I get are wheels only  
> **username_1**: I don't know if this work, but you can download https://download.lfd.uci.edu/pythonlibs/l8ulg3xw/pip-10.0.1-py2.py3-none-any.whl and open it as a zip file (just change the extension to .zip), and copy the two folders inside (pip & pip-10.0.1.dist-info) to your folder "...Python27\Lib\site-packages\" ,and see what happens...  
> **username_1**: Or alternatively, you can follow these instructions to **install a wheel without pip**, that work also to install "pip.whl" without pip: https://stackoverflow.com/questions/36132350/install-python-wheel-file-without-using-pip#49524140  
> **username_0**: D:\Python27>python D:\Python27\Lib\site.py sys.path = [     'D:\\Python27\\Lib',     'C:\\WINDOWS\\system32\\python27.zip',     'D:\\Python27\\DLLs',     'D:\\Python27\\lib\\plat-win',     'D:\\Python27\\lib\\lib-tk',     'D:\\Python27',     'D:\\Python27\\lib\\site-packages', ] USER_BASE: 'C:\\Documents and Settings\\a\\Dane aplikacji\\Python' (doesn't exis t) USER_SITE: 'C:\\Documents and Settings\\a\\Dane aplikacji\\Python\\Python27\\sit e-packages' (doesn't exist) ENABLE_USER_SITE: True  D:\Python27>  
> **username_1**: Ok, have you tried to copy the two pip wheel unzipped folders to your 'D:\\Python27\\lib\\site-packages' ?  
> **username_0**: I did exactly what you have asked me to do for. I need to learn some basics of Python and make my win10 tablet to get Internet access via OTG 3G modem, since moving SIM card back and forth, between 2 tiny slots (first in 3G modem a second in win10 tablet) may destroy it soon. Ok, it looks like wheels just act as compressed packages, unfortunately pip3 failed to run I will keep trying to run Python under WinXP  
> **username_1**: Bear in mind that the folders copied to your D:\\Python27\\lib\\site-packages provide the command **pip** not **pip3** (this is for Python **3**). Try using **pip**...  

---

