forex forum binary options trade - Binance - Сryptocurrency exchanges - How to calculate the version (eg. in Python)?
  • Welcome to forex forum binary options trade. Please login or sign up.

How to calculate the version (eg. in Python)?

Started by Bitcoin, Mar 14, 2022, 12:25 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


How to calculate the version (eg. in Python)?

I'm working through this medium post that describes all header fields of a block. The explanation of the version field is a little unclear for me.

For starters I'm trying to consider version = 1, as in the very beginning of the chain:

version_int = 1
version_hex = hex(version_int)
# from my understanding I need to add value 0x100000000 to the version
# though I do not understand why, currently I'm just taking this as a given fact
version_hex_min = hex(int(0x100000000) + version_int)[-8:]
# of course I need the little endian notation:
version_hex_min_le = binascii.hexlify(binascii.unhexlify(version_hex)[::-1])

This gives me the little-endian based hex value:


That I can obviously use to calculate the header hash for version 1.

When I check the latest block headers, I see a version like that:


That would result in the big endian hex representation:


And to an decimal int:


How does that number refers to the actual and current version and how do I extract the extra information that the miner used for this so called "overt ASIC boost"?

Source: How to calculate the version (eg. in Python)?