3

By what duration can a miner manipulate block.timestamp? Can they manipulate it by 10min, 5sec, 2hrs...?

From here I can see that the average block time on the ethereum blockchain is 13 seconds.

This answer that references this github thread says that:

The miner could cheat in the timestamp by a tolerance of 900 seconds. So if you check outside this intervall you are safe

Then from the consensys docs they talk about the fifteen second rule. Which argues that since the constrains of block.timestamp are

  1. It must be after the previous block timestamp.
  2. It cannot be far in the future.

So, by what duration can a miner manipulate block.timestamp? Can they manipulate it by 15sec or is it 15min?

I am trying to create a fixture smart contract that has a start time and an end time. You can only set the status of the fixture to ended 2hrs after game start time. Is it safe to use block.timestamp in this case?

2

There is no written rule on this, miners and full nodes can set themselves what kind of block timestamp skew they tolerate.

In practice, there has not been any notable timestamp skew ever. The block time itself is ~15 seconds (I guess that where the misconception raises), so my rule of thumb is it would be accurate to a minute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.