<p>You can download the blockchain headers <a href="https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-methods.html#blockchain-block-header" rel="nofollow noreferrer">using ElectrumX</a>. The data is binary packed, but can be deserialized easily enough. You seem to be trying to solo mine, which is a bad idea at the best of times, let alone with JavaScript. You also seems to be trying to build a SPV client. An easier way would just be to use <a href="https://blockchain.info/latestblock" rel="nofollow noreferrer">https://blockchain.info/latestblock</a> to get the lastblock hash and use that.</p>

CC BY-SA 3.0
2015-12-30T20:55:59.603Z
Anyone have writeups on how to ingest the binary packed electrum data, or at least more info on what it is, exactly?
David Manheim
CC BY-SA 3.0
2017-08-01T16:40:51.260Z
The data is the "block header" struct exactly -- https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers has the documentation.  It's a fixed-length binary struct described there.
user295691
CC BY-SA 4.0
2020-02-18T05:26:43.010Z
https://headers.electrum.org/blockchain_headers is no longer found in DNS.
Is there a replacement?
nealmcb
CC BY-SA 4.0
2022-10-01T09:06:59.667Z
@nealmcb https://electrum.readthedocs.io/en/latest/protocol.html#blockchain-block-get-header perhaps...
Lee
CC BY-SA 4.0
2014-03-12T01:03:07.860Z
2022-12-15T22:32:15.030Z
2022-12-15T22:32:15.030Z
Bardi Harborow
<p>I am just developing and testing Bitcoin mining application in plain Javascript
(slow but can be run off-line).</p>

<p>To test it to work correctly I need to download Bitcoin block headers
from Blockchain.info , 6 input parameters .</p>

<p>Are you aware how to call Blockchain API 
<a href="https://blockchain.info/api/blockchain_api" rel="nofollow">https://blockchain.info/api/blockchain_api</a></p>

<p>I don't use Bitcoin address, no other mining app, just need to download
a number block headers from hashed blocks.</p>

<p>Any idea, demo, example or csv file coming with 6 input parameters
as described in Bitcoin hashing algorithm</p>

<p><a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a></p>

CC BY-SA 3.0
2014-01-28T16:25:20.297Z
ever thought of using testnet?
T9b
CC BY-SA 3.0
2014-03-12T13:43:25.433Z
It might be easier to test (and more profitable to run) should you target an alt-coin rather than Bitcoin
Joe Pineda
<api><blockchain.info>
How to download Bitcoin block headers from Blockchain.info and save to file?
darius
# How to download Bitcoin block headers from Blockchain.info and save to file?

(Asked by: username_0 on 2014-01-27)

I am just developing and testing Bitcoin mining application in plain Javascript
(slow but can be run off-line).

To test it to work correctly I need to download Bitcoin block headers
from Blockchain.info , 6 input parameters .

Are you aware how to call Blockchain API
<https://blockchain.info/api/blockchain_api>

I don't use Bitcoin address, no other mining app, just need to download
a number block headers from hashed blocks.

Any idea, demo, example or csv file coming with 6 input parameters
as described in Bitcoin hashing algorithm

<https://en.bitcoin.it/wiki/Block_hashing_algorithm>

**Tags:** api, blockchain.info

> **Comments:**
> **username_1**: ever thought of using testnet?  
> **username_2**: It might be easier to test (and more profitable to run) should you target an alt-coin rather than Bitcoin  

---

## 1 answers

### Answer by username_3 on 2014-03-12. Score: 2

You can download the blockchain headers [using ElectrumX](https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-methods.html#blockchain-block-header). The data is binary packed, but can be deserialized easily enough. You seem to be trying to solo mine, which is a bad idea at the best of times, let alone with JavaScript. You also seems to be trying to build a SPV client. An easier way would just be to use <https://blockchain.info/latestblock> to get the lastblock hash and use that.

> **Comments:**
> **username_4**: Anyone have writeups on how to ingest the binary packed electrum data, or at least more info on what it is, exactly?  
> **username_5**: The data is the "block header" struct exactly -- https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers has the documentation.  It's a fixed-length binary struct described there.  
> **username_6**: https://headers.electrum.org/blockchain_headers is no longer found in DNS. Is there a replacement?  
> **username_7**: @username_6 https://electrum.readthedocs.io/en/latest/protocol.html#blockchain-block-get-header perhaps...  

---

