Pages:
Author

Topic: Fake block timestamps can cause a temporary fork? - page 2. (Read 2371 times)

legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political

I think when designing a distributed consensus system, such as Bitcoin, one should be cautious about making a decision based on node time. Node time is different at different nodes and this a source of disagreement that potentially destroys consensus. Hopefully just temporarily.


.

The timestamping is done for difficulty adjustments, not for ordering of blocks.  The rules are there
to make sure that things don't get too far out of whack (You can't go too far backward or forward),
and yes they are specifically designed to converge the chain even if there is temporary disagreement.
legendary
Activity: 3472
Merit: 4801
Why would a miner want only half the network to build on their block?

That makes no sense... what is the +2hr timestamp miner trying to accomplish?
It would create a temporary fork and perhaps some confusion. Maybe even break some badly coded bitcoin applications if they do not handle forks well.

Temporary forks happen every day (they are often called "orphan" blocks).  Every time two miners (or pools) solve a block at close to the same time, some of the network hears about one block first, while some of the network hears about the other block first.  Bitcoin is designed to work this way, and to adapt properly to the longest fork once another block is found.

Any "badly coded bitcoin applications" are already broken if they don't handle this daily occurrence properly.
sr. member
Activity: 349
Merit: 250
Why would a miner want only half the network to build on their block?

That makes no sense... what is the +2hr timestamp miner trying to accomplish?


It would create a temporary fork and perhaps some confusion. Maybe even break some badly coded bitcoin applications if they do not handle forks well.
legendary
Activity: 1652
Merit: 2301
Chief Scientist
Why would a miner want only half the network to build on their block?

That makes no sense... what is the +2hr timestamp miner trying to accomplish?
sr. member
Activity: 250
Merit: 253
The miner has to choose the block time when the start hashing the block, not after they've already found the block.  The block time is part of the header being hashed.

Since it is impossible for a miner to know how long it will take them to mine a block, it is impossible for them to accurately set a timestamp that will be exactly 2:00:00 ahead of the time that they will broadcast it.

They could potentially set a blocktime that is significantly more than 2:00:00 ahead, and then if they solve the block they can hold on to the block until the timestamp is exactly 2:00:00 in the future.  However, they then stand a significant risk that someone else will solve and broadcast a block before they get around to broadcasting their own.  That's a very expensive 25+ BTC risk for a small chance at creating an orphaned block.
You need to update the block header after every hash to change the nonce, and at least every 4.2 billion hashes when your nonce value hits its maximum. If mining software doesn't already keep the timestamp within, say, 5 seconds of the true value, it could (I'm almost certain) easily be modified to keep it at the right time without significantly affecting your hashrate.

You will, of course, broadcast it immediately upon finding it; you can guess that 50% of the network will get it in 4-5 seconds, so simply set it 2:00:05 or so ahead of your very-accurate "current time".
full member
Activity: 217
Merit: 259
If someone finds a block on top of the new block with the faked timestamp all miners will immediately jump to the new chain, right? Then, the worst that can happen is that someone ignores the new block and builds on the old block.  For him, there is a high risk that his block gets orphaned but the attacker also risks that his block gets orphaned.  In any case the fork will be quickly resolved.
legendary
Activity: 3472
Merit: 4801
Every block includes a timestamp as set by the miner who mined the block. There is a rule that other nodes reject the block if its timestamp is more than 2 hours in the future. It is a hard limit: if the timestamp is 2:00:01 in the future relative to node time, the node rejects it; if it's only 1:59:59 in the future, the node accepts it.

What happens if a miner finds a block and sets its timestamp exactly 2 hours in the future relative to some accurate time source? Since the clocks of all other nodes are never perfectly synchronized and distributed somewhere around the true time, I would expect that approximately half of the nodes (whose clock is slightly ahead of the true time) accept the block, while the other half will reject and forget it. Half of the miners will accept the block and start building a new block on top of it (with half of the original hash power), the other half will continue working on the previous block. We've got a blockchain fork caused by misbehavior of just one node. One of the two forks will eventually win but, before that, transaction confirmations might be delayed. Did I get anything wrong?

I think when designing a distributed consensus system, such as Bitcoin, one should be cautious about making a decision based on node time. Node time is different at different nodes and this a source of disagreement that potentially destroys consensus. Hopefully just temporarily.

The miner has to choose the block time when the start hashing the block, not after they've already found the block.  The block time is part of the header being hashed.

Since it is impossible for a miner to know how long it will take them to mine a block, it is impossible for them to accurately set a timestamp that will be exactly 2:00:00 ahead of the time that they will broadcast it.

They could potentially set a blocktime that is significantly more than 2:00:00 ahead, and then if they solve the block they can hold on to the block until the timestamp is exactly 2:00:00 in the future.  However, they then stand a significant risk that someone else will solve and broadcast a block before they get around to broadcasting their own.  That's a very expensive 25+ BTC risk for a small chance at creating an orphaned block.
legendary
Activity: 965
Merit: 1033
Every block includes a timestamp as set by the miner who mined the block. There is a rule that other nodes reject the block if its timestamp is more than 2 hours in the future. It is a hard limit: if the timestamp is 2:00:01 in the future relative to node time, the node rejects it; if it's only 1:59:59 in the future, the node accepts it.

What happens if a miner finds a block and sets its timestamp exactly 2 hours in the future relative to some accurate time source? Since the clocks of all other nodes are never perfectly synchronized and distributed somewhere around the true time, I would expect that approximately half of the nodes (whose clock is slightly ahead of the true time) accept the block, while the other half will reject and forget it. Half of the miners will accept the block and start building a new block on top of it (with half of the original hash power), the other half will continue working on the previous block. We've got a blockchain fork caused by misbehavior of just one node. One of the two forks will eventually win but, before that, transaction confirmations might be delayed. Did I get anything wrong?

I think when designing a distributed consensus system, such as Bitcoin, one should be cautious about making a decision based on node time. Node time is different at different nodes and this a source of disagreement that potentially destroys consensus. Hopefully just temporarily.

Pages:
Jump to: