Why is such a large int (uint32) used for the transaction version field

0

1

The transaction version field is a unsigned 32 bit integer. [Source Code] [Docs]

This will allow for 0 through 4,294,967,295 (2^32 − 1) versions. So far, only versions 0, 1, 2 have been used. It seems that the amount of storage for this field is wasteful. Surely unsigned 8 bit integer would be more than enough. What was the rational for using such a large integer?

Could this be reduced with a new block version? Could this be done without a hard fork?

Gary van der Merwe

Posted 2017-08-14T10:40:21.967

Reputation: 239

Answers

2

What was the rational for using such a large integer?

Because Satoshi did not care about it. Bitcoin transaction serialization is not optimized for size.

Could this be reduced with a new block version?

No

Could this be done without a hard fork?

No. But you can implement new way to serialize data on disk and on network and encode/decode transaction contents on-the-fly. In fact nobody cares about these bytes.

amaclin

Posted 2017-08-14T10:40:21.967

Reputation: 5 763