user106775: When i run getblocktemplate, Bitcoind gives me in the version field a decimal number, when i convert it to Hex it's 20000000
I know it must be in little endian, but to build the blockheader must i put it like this 00000020 or 02000000  ?
I am asking this question because in version 1 the blockheaders are using 01000000 and not 00000010 so i am confused
Help is appreciated
Thanks to all of you

user208: The bytes you would put in the block header would be, in order: 0x00 0x00 0x00 0x20. That's how the number 221 (= 0x20000000) is stored in 32-bit little endian encoding.
Note that this is actually a large number; that range is used for BIP9-compatible versions. Older blocks that use versions 1 through 4 predate BIP9.

106775: <p>When i run <code>getblocktemplate</code>, Bitcoind gives me in the <code>version</code> field a decimal number, when i convert it to <code>Hex</code> it's <code>20000000</code></p>
<p>I know it must be in little endian, but to build the <code>blockheader</code> must i put it like this <code>00000020</code> or <code>02000000</code>  ?</p>
<p>I am asking this question because in version 1 the blockheaders are using <code>01000000</code> and not <code>00000010</code> so i am confused</p>
<p>Help is appreciated</p>
<p>Thanks to all of you</p>
 208: <p>The bytes you would put in the block header would be, in order: 0x00 0x00 0x00 0x20. That's how the number <em>2<sup>21</sup></em> (= 0x20000000) is stored in 32-bit little endian encoding.</p>
<p>Note that this is actually a large number; that range is used for <a href="https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki" rel="nofollow noreferrer">BIP9</a>-compatible versions. Older blocks that use versions 1 through 4 predate BIP9.</p>
