<p>check this:</p>

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

<p><a href="https://bitcoin.stackexchange.com/questions/44579/how-is-a-block-header-hash-compared-to-the-target-bits">How is a block header hash compared to the target (bits)?</a></p>

<p>[EDIT]
Also this <a href="https://bitcoin.stackexchange.com/questions/67791/calculate-hash-of-block-header/67792#67792">Calculate hash of block header</a></p>

CC BY-SA 3.0
2018-01-07T13:26:13.547Z
2018-01-07T14:58:28.390Z
2018-01-07T14:58:28.390Z
CamiloARG
<p>good afternoon</p>

<p>I set myself a task to understand the work of the miner, but as you understand it is difficult for a beginner. Constantly there are questions.
Without conditionally, I turn to Google search and find the answers but not always.</p>

<p>Guys help sort out a few points</p>

<p>How to compose a block header?
I appeal to the instructions on such sites as:

</p>

<p>I understand the headline is formed by the principle:
Version + prevhash + merkle_root + ntime + nbits + '00000000' +
'000000800000000000000000000000000000000000000000000000000000000000000000000080020000'</p>

<p>Where merkle_root should be in the reverse order of the byte and only it.
But other sources and sources give different examples of header formation. Someone does not translate merkle_root in the reverse order of a byte, but translates ntime and nbits</p>

<p>The question is how to properly form the header of the block and what incoming data should be specified in the reverse order of the byte. Most likely something I do not understand until the end and I hope for help.</p>

<p>And can someone tell me a good manual</p>

CC BY-SA 3.0
2017-08-04T16:14:24.863Z
The best documentation, and the only one that's truly authoritative, is the [Bitcoin Core source code](https://github.com/bitcoin/bitcoin).
Nate Eldredge
CC BY-SA 3.0
2017-08-04T17:25:43.793Z
possible duplicate of https://bitcoin.stackexchange.com/questions/46021/bitcoin-mining-block-structure/46024#46024
Nick ODell
<block-header>
How to generate a block header?
Maxim  Lavr
# How to generate a block header?

(Asked by: username_0 on 2017-08-04)

good afternoon

I set myself a task to understand the work of the miner, but as you understand it is difficult for a beginner. Constantly there are questions.
Without conditionally, I turn to Google search and find the answers but not always.

Guys help sort out a few points

How to compose a block header?
I appeal to the instructions on such sites as:

I understand the headline is formed by the principle:
Version + prevhash + merkle\_root + ntime + nbits + '00000000' +
'000000800000000000000000000000000000000000000000000000000000000000000000000080020000'

Where merkle\_root should be in the reverse order of the byte and only it.
But other sources and sources give different examples of header formation. Someone does not translate merkle\_root in the reverse order of a byte, but translates ntime and nbits

The question is how to properly form the header of the block and what incoming data should be specified in the reverse order of the byte. Most likely something I do not understand until the end and I hope for help.

And can someone tell me a good manual

**Tags:** block-header

> **Comments:**
> **username_1**: The best documentation, and the only one that's truly authoritative, is the [Bitcoin Core source code](https://github.com/bitcoin/bitcoin).  
> **username_2**: possible duplicate of https://bitcoin.stackexchange.com/questions/46021/bitcoin-mining-block-structure/46024#46024  

---

## 1 answers

### Answer by username_3 on 2018-01-07. Score: -2

check this:

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

[How is a block header hash compared to the target (bits)?](https://bitcoin.stackexchange.com/questions/44579/how-is-a-block-header-hash-compared-to-the-target-bits)

[EDIT]
Also this [Calculate hash of block header](https://bitcoin.stackexchange.com/questions/67791/calculate-hash-of-block-header/67792#67792)


---

