Bitcoin Forum
May 08, 2024, 11:02:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Questions about version number in block header  (Read 126 times)
polaker (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


View Profile
January 27, 2020, 05:45:36 PM
Merited by ABCbits (1)
 #1

I got these questions while reading the protocol doc.

1) I noticed that the version number could be different for blocks. How could we introduce a new version number by soft forking?

2) Why doesn't it use compact Int to save bytes?
1715166163
Hero Member
*
Offline Offline

Posts: 1715166163

View Profile Personal Message (Offline)

Ignore
1715166163
Reply with quote  #2

1715166163
Report to moderator
1715166163
Hero Member
*
Offline Offline

Posts: 1715166163

View Profile Personal Message (Offline)

Ignore
1715166163
Reply with quote  #2

1715166163
Report to moderator
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715166163
Hero Member
*
Offline Offline

Posts: 1715166163

View Profile Personal Message (Offline)

Ignore
1715166163
Reply with quote  #2

1715166163
Report to moderator
1715166163
Hero Member
*
Offline Offline

Posts: 1715166163

View Profile Personal Message (Offline)

Ignore
1715166163
Reply with quote  #2

1715166163
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
January 27, 2020, 07:01:33 PM
Merited by Foxpup (2), ABCbits (2), Husna QA (1)
 #2

1) I noticed that the version number could be different for blocks. How could we introduce a new version number by soft forking?
A soft fork isn't required to use a different version number. Some numbers cannot be used, but, for the most part, miners can set whatever block version number they want. This is what allows them to use the version number to signal soft fork readiness and also allows them (unfortunately) to use asicboost.

2) Why doesn't it use compact Int to save bytes?
Compact int isn't very compact. There is not much space to be saved there, and really no reason for the version to be a super expandable field.

gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8412



View Profile WWW
January 27, 2020, 07:15:02 PM
Merited by Foxpup (3), ABCbits (2), Husna QA (1)
 #3

Consensus rules set how things are hashed not how they're communicated.

If you wanted to store or communicate (to compatible software) headers using a compact int you're free to do so... but it would be a mostly pointless savings (two byte? meh. and even then only if you weren't representing current common numbers which have higher bits set, or using an alternative compact int format).

The size of them going into a hash is pretty irrelevant, because unless you reduce the compression function run count the hash takes essentially the same time.

The bytes of prev which are forced to be zero because of this block's difficulty are a much more sensible thing to save, particularly because as difficultly increases the amount of nonce you need increases proportionally... so it would have been logical to use the zeros for additional nonce and to have made the separate nonce field just 8-bits. With that and updating time to be current no one would need extranonce.
polaker (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


View Profile
January 27, 2020, 10:09:56 PM
 #4

1) I noticed that the version number could be different for blocks. How could we introduce a new version number by soft forking?
A soft fork isn't required to use a different version number. Some numbers cannot be used, but, for the most part, miners can set whatever block version number they want. This is what allows them to use the version number to signal soft fork readiness and also allows them (unfortunately) to use asicboost.


Does this mean that version number actually is not part of the consensus rule, since miners could set whatever version number they want?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
January 27, 2020, 11:35:01 PM
Merited by ABCbits (1)
 #5

Does this mean that version number actually is not part of the consensus rule, since miners could set whatever version number they want?
There are consensus rules regarding what the version number can be. But there is no consensus rule saying that the version number must be a particular value.

E.g. there is a rule saying that the number cannot be less than 3. But there is no rule saying that it must be 4, so it can be 4, 5, or any other number so long as it is greater than 3.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!