Questions About How Bitcoin Network Works

6 replies 376 views
max.ravenNewbie
Posts: 3 · Reputation: 36
#1Mar 27, 2024, 03:47 PM
Hey everyone, Been diving into Bitcoin books lately. Got a few things bothering me though. How exactly is the timestamp on a mined block determined? Like, I assume when a miner finishes a block, they send the epoch time to their peers. But if that’s outside the block, won’t it be up for changes? So I guess it has to be in the block itself right?
7 Reply Quote Share
m1kes4tFull Member
Posts: 167 · Reputation: 252
#2Mar 27, 2024, 05:57 PM
The timestamp is part of the block header, my dude. Once it’s there, it’s locked in. Miners can’t mess with it after the fact. The time needs to fall within a certain range, like being within the average of the last 11 blocks and not more than 2 hours ahead. No need for pinpoint accuracy.
2 Reply Quote Share
max.ravenNewbie
Posts: 3 · Reputation: 36
#3Mar 27, 2024, 09:12 PM
What if I’m mining block 22, and I get it confirmed? I check the timestamp right after that and it’s 11:54:19. So I use that for my block 23 header and start mining. If I spend 6 minutes finding my nonce, is the timestamp still 11:54:19?
3 Reply Quote Share
MadNovaHero Member
Posts: 278 · Reputation: 3536
#4Mar 29, 2024, 06:36 AM
To add to what mcdouglasx said, Yeah, the miner sets the timestamp when they create the block. As long as it’s valid, it stays as part of the block data. The timestamp just has to be greater than the median time of the last 11 blocks and can be up to 2 hours ahead. So if you start at 11:54:19, that’s cool for 6 minutes.
3 Reply Quote Share
alex.byteLegendary
Posts: 170 · Reputation: 5910
#5Mar 29, 2024, 07:02 AM
Right, it’s definitely chosen by the miner. There are rules, like it can’t be less than the median time of previous blocks. And like 2 hours ahead is a no-go. But miners sometimes push those timestamps in test networks to see what they can get away with. The range keeps it practical.
4 Reply Quote Share
max.ravenNewbie
Posts: 3 · Reputation: 36
#6Mar 29, 2024, 11:12 AM
Ahhh I get it now. I thought it was more exact for timing the blocks, kinda like syncing difficulty with mining power. I didn’t realize it was more flexible within a range. Also, I used to think there was a super efficient method for picking combos in mining that everyone used, something set in stone. But now I’m wondering if that’s not the case. My Bitaxe gamma didn’t let me tweak anything.
0 Reply Quote Share
alex.byteLegendary
Posts: 170 · Reputation: 5910
#7Mar 29, 2024, 05:31 PM
In theory, nodes could be stricter about timestamps, but it wouldn’t help with past data. If a block has a timestamp, you can’t tell if it’s real or adjusted. You’d need to have been part of the network back then to trust it. For instance, starting a new regtest node shows a timestamp like 1296688602. Just goes to show, timestamps can be tricky.
3 Reply Quote Share

Related topics