<p>You do not need append padding, this step already implemented under the hood in the cryptographic library function sha256. As I remember, when I solve the same task and read this doc from stratum pool a few inconsistencies in the documentation that had to be solved empirically. </p>

<p>One of the nuances on which note that miners software do not know anything about the segwit and coinbase transaction for the miner job should be represented in the old format.  </p>

CC BY-SA 4.0
2018-07-13T17:03:39.037Z
2018-07-13T17:08:41.503Z
2018-07-13T17:08:41.503Z
bitaps.com
<p>When I studied the stratum on <a href="https://slushpool.com/help/manual/stratum-protocol" rel="nofollow noreferrer">here</a>,I found that there were little difference between the stratum and solo mining for building block header.</p>

<p>The stratum tell us that we needed to pad the header to uint512.</p>

<p>'000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'</p>

<p>The bits is different to the algorithm of sha256's padding. </p>

<p>But when I practiced the <a href="https://testnet.blockexplorer.com/block/000000002076870fe65a2b6eeed84fa892c0db924f1482243a6247d931dcab32" rel="nofollow noreferrer">example</a> which solved testnet3 block,I couldn't use the information to calculate the hash until I discarded the padding.</p>

<p>In real-work,whether I need to pad or not?</p>

<p>By the way,the previous hash provided from  <a href="https://slushpool.com/help/manual/stratum-protocol" rel="nofollow noreferrer">notification</a> is not correct,you need to find it on <a href="https://testnet.blockexplorer.com/block/000000002076870fe65a2b6eeed84fa892c0db924f1482243a6247d931dcab32" rel="nofollow noreferrer">there</a>.</p>

<testnet><sha256><stratum>
How to Build Block Header in stratum?
davoschih
# How to Build Block Header in stratum?

(Asked by: username_0 on 2018-07-13)

When I studied the stratum on [here](https://slushpool.com/help/manual/stratum-protocol),I found that there were little difference between the stratum and solo mining for building block header.

The stratum tell us that we needed to pad the header to uint512.

'000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'

The bits is different to the algorithm of sha256's padding.

But when I practiced the [example](https://testnet.blockexplorer.com/block/000000002076870fe65a2b6eeed84fa892c0db924f1482243a6247d931dcab32) which solved testnet3 block,I couldn't use the information to calculate the hash until I discarded the padding.

In real-work,whether I need to pad or not?

By the way,the previous hash provided from [notification](https://slushpool.com/help/manual/stratum-protocol) is not correct,you need to find it on [there](https://testnet.blockexplorer.com/block/000000002076870fe65a2b6eeed84fa892c0db924f1482243a6247d931dcab32).

**Tags:** testnet, sha256, stratum


---

## 1 answers

### Answer by username_1 on 2018-07-13. Score: 0 | Accepted answer

You do not need append padding, this step already implemented under the hood in the cryptographic library function sha256. As I remember, when I solve the same task and read this doc from stratum pool a few inconsistencies in the documentation that had to be solved empirically.

One of the nuances on which note that miners software do not know anything about the segwit and coinbase transaction for the miner job should be represented in the old format.


---

