Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mustyoshi on May 12, 2013, 09:11:21 PM



Title: 32Bit timestamps in the block headers?
Post by: mustyoshi on May 12, 2013, 09:11:21 PM
Why would Satoshi (group or indiv.) use 32 bit timestamps which would overflow before the last coin was designed to be minted?

The fix is simple, just up it to 64bit unsigned integers to represent the date.


Title: Re: 32Bit timestamps in the block headers?
Post by: Come-from-Beyond on May 12, 2013, 09:31:27 PM
Why would Satoshi (group or indiv.) use 32 bit timestamps which would overflow before the last coin was designed to be minted?

The fix is simple, just up it to 64bit unsigned integers to represent the date.

This problem will rise in 2100+ A.D. only.


Title: Re: 32Bit timestamps in the block headers?
Post by: mustyoshi on May 12, 2013, 09:34:26 PM
Why would Satoshi (group or indiv.) use 32 bit timestamps which would overflow before the last coin was designed to be minted?

The fix is simple, just up it to 64bit unsigned integers to represent the date.

This problem will rise in 2100+ A.D. only.
Which is 34 years before the reward is due to be zero. This is going to be a problem eventually, so why not fix it now?


Title: Re: 32Bit timestamps in the block headers?
Post by: jackjack on May 12, 2013, 09:37:03 PM
Why would Satoshi (group or indiv.) use 32 bit timestamps which would overflow before the last coin was designed to be minted?

The fix is simple, just up it to 64bit unsigned integers to represent the date.

This problem will rise in 2100+ A.D. only.
Which is 34 years before the reward is due to be zero. This is going to be a problem eventually, so why not fix it now?
Because everybody now complains about the blockchain being too big
Not exactly the right time to increase the size of headers (I know it won't be noticeable but you know how that works...)


Title: Re: 32Bit timestamps in the block headers?
Post by: Come-from-Beyond on May 12, 2013, 09:38:15 PM
Which is 34 years before the reward is due to be zero. This is going to be a problem eventually, so why not fix it now?

It's a low priority problem. If Gavin doesn't fix problems related to ever-growing blockchain, we won't face "year 2100 problem" at all.


Title: Re: 32Bit timestamps in the block headers?
Post by: leijurv on May 13, 2013, 01:39:04 PM
Maybe I'm missing something, but won't 32-bit timestamps overflow in 2038?
http://en.wikipedia.org/wiki/Year_2038_problem


Title: Re: 32Bit timestamps in the block headers?
Post by: Caesium on May 13, 2013, 01:40:16 PM
It's unsigned, so that buys a few extra years. See 'Solutions' in your wiki link, its mentioned there.


Title: Re: 32Bit timestamps in the block headers?
Post by: Come-from-Beyond on May 13, 2013, 01:40:20 PM
Maybe I'm missing something, but won't 32-bit timestamps overflow in 2038?
http://en.wikipedia.org/wiki/Year_2038_problem

In Bitcoin the timestamp is unsigned.


Title: Re: 32Bit timestamps in the block headers?
Post by: etotheipi on May 13, 2013, 02:07:10 PM
This is basically a non-issue.  Just interpret the timestamp as the lower 32-bits of an infinite timestamp.  It "wraps around" every 138 years, and it's pretty easy to figure out how many times it's wrapped since Bitcoin was created, so it's easy to convert the stored 32-bit value, into your own 64-bit value.


Title: Re: 32Bit timestamps in the block headers?
Post by: leijurv on May 13, 2013, 02:29:31 PM
This is basically a non-issue.  Just interpret the timestamp as the lower 32-bits of an infinite timestamp.  It "wraps around" every 138 years, and it's pretty easy to figure out how many times it's wrapped since Bitcoin was created, so it's easy to convert the stored 32-bit value, into your own 64-bit value.
+1


Title: Re: 32Bit timestamps in the block headers?
Post by: TierNolan on May 13, 2013, 10:39:37 PM
This is basically a non-issue.  Just interpret the timestamp as the lower 32-bits of an infinite timestamp.  It "wraps around" every 138 years, and it's pretty easy to figure out how many times it's wrapped since Bitcoin was created, so it's easy to convert the stored 32-bit value, into your own 64-bit value.

Right, in fact, they should define it exactly like that.  You work out the timestamp of a block so that it minimised the difference in time relative to the previous block.

This works unless blocks take decades to arrive.