0

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

2

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.

1
  • Thank you for your answer – Hamita Aug 3 '20 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.