<p>I share a small Python script that can parse off-line the data which is stored in blk*.dat files.</p>

<p>You can try it <a href="https://github.com/ragestack/blockchain-parser" rel="nofollow noreferrer">here</a>.</p>

<p>If you want, you can turn-off the strings savings that you does not need.</p>

CC BY-SA 4.0
2018-06-14T17:22:43.330Z
Thank you Denis,  your Python script looks great and highly professional. Following the last collapse in bitcoin and cryptos I have lost any hope, recovery to ever come, but studying blocks in the blockchain still makes me busy and happy. First of all I need to extract nonce for all bloks to let me verify if some services, publishing individual block headers don't cheat us. An old bug was to have any block header generated with nonce preset to "0".  Thank you once again. There is an old problem in stackexchange logging in if Bitcoin is your first login site. Email refers to SE and login fails.
darius
CC BY-SA 4.0
2018-06-19T09:34:28.413Z
@darius what do you mean `An old bug was to have any block header generated with nonce preset to "0"`?
Denis Leonov
CC BY-SA 4.0
2018-06-20T23:50:02.463Z
read this thread
https://bitcoin.stackexchange.com/questions/66878/why-do-block-explorer-apis-say-the-nonce-in-the-block-header-is-0

I checked now 
https://www.blockcypher.com/dev/bitcoin/?shell#block
and it looks like nonce = 0 bug has gone
darius
CC BY-SA 4.0
2018-06-13T10:19:26.977Z
2019-10-01T14:29:29.960Z
2019-10-01T14:29:29.960Z
Denis Leonov
<p>I am looking for on-line or off-line run Bitcoin Blockchain Parser to get all block headers only</p>

<p>All I need is</p>

<pre><code>########## Block Header ##########
Version:         1
Previous Hash    00000000000000000000000000000000
Merkle Root    4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Time             1231006505
Difficulty       1d00ffff
Nonce            2083236893
</code></pre>

<p>No transactions data.</p>

<blockchain><block-header>
Bitcoin Blockchain Parser to get all block headers
darius
# Bitcoin Blockchain Parser to get all block headers

(Asked by: username_0 on 2018-01-08)

I am looking for on-line or off-line run Bitcoin Blockchain Parser to get all block headers only

All I need is

```
########## Block Header ##########
Version:         1
Previous Hash    00000000000000000000000000000000
Merkle Root    4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
Time             1231006505
Difficulty       1d00ffff
Nonce            2083236893

```

No transactions data.

**Tags:** blockchain, block-header


---

## 1 answers

### Answer by username_1 on 2018-06-13. Score: 1

I share a small Python script that can parse off-line the data which is stored in blk\*.dat files.

You can try it [here](https://github.com/ragestack/blockchain-parser).

If you want, you can turn-off the strings savings that you does not need.

> **Comments:**
> **username_0**: Thank you username_1,  your Python script looks great and highly professional. Following the last collapse in bitcoin and cryptos I have lost any hope, recovery to ever come, but studying blocks in the blockchain still makes me busy and happy. First of all I need to extract nonce for all bloks to let me verify if some services, publishing individual block headers don't cheat us. An old bug was to have any block header generated with nonce preset to "0".  Thank you once again. There is an old problem in stackexchange logging in if Bitcoin is your first login site. Email refers to SE and login fails.  
> **username_1**: @username_0 what do you mean `An old bug was to have any block header generated with nonce preset to "0"`?  
> **username_0**: read this thread https://bitcoin.stackexchange.com/questions/66878/why-do-block-explorer-apis-say-the-nonce-in-the-block-header-is-0  I checked now  https://www.blockcypher.com/dev/bitcoin/?shell#block and it looks like nonce = 0 bug has gone  

---

