52
23
I've been told "the network" sets the difficulty level such that there will be one new block mined every ten minutes.
I imagine the rich would instead prefer to keep difficulty as high as possible to prevent other people winning their 50 BTC and causing inflation, whereas the poor would prefer as low a difficulty as possible in order to get a greater share of the BTC available.
(By rich and poor, I mean only according to how many BTC someone has.)
What's the force saying "No, forget your petty self-interest and set the difficulty to 10 minutes."?
1@billpg - Correct. It would be more accurate to say difficulty is set by the algorithm. It is adjusted every 2016 blocks based on average execution time for prior 2016 blocks to ensure future average execution time remains ~10 minutes. Of course a miner could ignore/break this algorithm but then they wouldn't be mining valid bitcoin blocks (they would be mining a fork). – DeathAndTaxes – 2011-10-10T13:20:11.203
Just to be completely clear: "time the past 2015 blocks took" means "Timestamp of block 2016N-1 minus timestamp of block 2016N-2016"? And without the off-by-one bug, it would have been block 2016N-2017? – Meni Rosenfeld – 2012-01-22T06:09:06.713
And another question - is it multiplied by 2 weeks (1209600 seconds, the desired time to create 2016 blocks) or by 1209000 (the desired time to create 2015 blocks)? – Meni Rosenfeld – 2012-01-22T06:47:18.447
@MeniRosenfeld I believe so, yes. And it's "14 24 60 * 60; // two weeks" (first mention of nTargetTimespan in main.cpp) – Chris Moore – 2012-03-20T02:51:48.797
OH, it's 2 weeks and 2016 blocks, not 10 minutes. 2 weeks = 20160 minutes / 2016 = 10 minutes per block. – Chloe – 2017-12-23T18:19:43.433
What would happen if my bitcoin client where cheating and not agree to its network rules, and put less or more transactions in the block? – Damian – 2019-03-07T08:58:44.437
There is no rule that requires a specific number of transactions to be put in a block. This question and answer is about proof of work in blocks, not transactions. – Pieter Wuille – 2019-03-07T17:54:05.007
3Hmm, could you be more precise about the "time stamp" used? Afaik the time in the block header can be very inaccurate, and block propagation can induce some delay between nodes (so, if they record the time they first heard of the block, not everyone would exactly agree on the same difficulty). And, what would happen if one generated blocks with a computer whose clock is out-of-sync (like, days in the past/future)? (If this is not adequate as a comment I can make a separate question.) – Artefact2 – 2011-09-10T19:30:55.133
3
@Artefact2: from the wiki: "A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours. "Network-adjusted time" is the median of the timestamps returned by all nodes connected to you."
– None – 2011-09-10T21:55:49.927I think the important thing is that it's not a buncha servers voting on what the difficulty should be, which is what it sounds like when people tell me that the difficulty is set by the network. – billpg – 2011-09-11T00:00:39.937