<p>Each individual client checks the validity of each block it receives. If it receives an invalid block, it ignores that block as if it didn't exist.</p>

<p>If you mine a block and other clients ignore it, you don't get your 50 Bitcoins. You only get to keep your 50 Bitcoins if the block you mined becomes a link in the accepted public chain.</p>

<p>One of the first things that is checked by the client when it receives a block is that the block meets the difficulty target that it calculates based on how quickly blocks have been generated. If that client doesn't think that block meets the difficulty target that it calculated, then it ignores the block.</p>

<p>So you have to mine a block that other clients will accept, or you don't get your 50 Bitcoins.</p>

CC BY-SA 3.0
2011-09-10T18:00:40.040Z
2011-09-10T18:00:40.040Z
David Schwartz
<p>Software. The Bitcoin network runs on a set of previously-agreed-upon rules that are built into the Bitcoin client software.</p>

<p>One such rule is that the difficulty should be changed every 2016 blocks to make a new block take, on average, 10 minutes to mine. As the economics change, miners will startup and shutdown making the average block take more or less than 10 minutes to find but the next time another 2016th block is mined, the difficulty will again be re-adjusted.</p>

<p>I would actually reword your question as well since a block's difficulty isn't technically set to a time but a number. Instead you might want to ask, "What keeps the average time to mine a block at 10 minutes?"</p>

CC BY-SA 3.0
2011-09-10T21:48:22.727Z
2011-09-10T21:48:22.727Z
weex
<p>The difficulty is adjusted every 2016 blocks by the whole network so as to average the Bitcoin generation to a block every 10 minutes. If the coins were on average generated too fast since the last adjustment, the difficulty is increased, if they were generated too slow - it is decreased.</p>

<p>What the rich can only do is do their best to have the highest possible hashing speed. This would make them brake the block more often (they would earn more money), as well as increase the difficulty higher, so people with lower-end machines could not brake a block without using a pool in a reasonable time (as is the case currently).</p>

<p>What the rich can also do is hoard the Bitcoins, so their value would increase. Keep in mind that even if someone would own 99+% of all the Bitcoins the currency would still be as usable as with bigger pool of coins (Bitcoins currently can be divided to up to 8 decimal places, and there is nothing stopping a future implementation from dividing them up even further).</p>

<p>Of course if someone wants to depreciate the value he or she can undermine the trust people have in the coins. For example, the hacking of <a href="https://mtgox.com/" rel="nofollow">Mt.Gox</a> caused a lot of people to be more reserved when handling the coins.
On the other hand, if one wants to increase the value of Bitcoins, one should promote them, convince new people to invest in them and be a contributing member of the community.</p>

CC BY-SA 3.0
2011-09-10T19:28:45.743Z
2011-09-10T19:28:45.743Z
ThePiachu
<p>The bitcoin network rules define which difficulty each block has. This is done through a simple formula that only depends on the block chain itself. This means that if you give me a blockchain with blocks 1 through N, I can tell you with 100% accuracy what the difficulty of block N+1 will need to be, and I can reject any block which has the wrong difficulty. This means it is not really "the network" deciding on a difficulty, but really <strong>each separate node calculating and enforcing it independently</strong>.</p>

<p>The actual formula is this: at every block N which is a multiple of 2016, look at the time stamps of the past 2015 blocks, and change the difficulty for what follows to old_difficulty*(2 weeks)/(time the past 2015 blocks took). Additional rules on which time stamps are allowed in blocks prevent cheating (mostly).</p>

<p>In short, by using a bitcoin client, you agree to its network rules, and those include the difficulty adjustment.</p>

CC BY-SA 3.0
2017-12-23T18:19:43.433Z
OH, it's 2 weeks and 2016 blocks, not 10 minutes. 2 weeks = 20160 minutes / 2016 = 10 minutes per block.
Chloe
CC BY-SA 4.0
2019-03-07T08:58:44.437Z
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
CC BY-SA 4.0
2019-03-07T17:54:05.007Z
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
CC BY-SA 3.0
2011-09-10T19:30:55.133Z
Hmm, 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
CC BY-SA 3.0
2011-09-11T00:00:39.937Z
I 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
CC BY-SA 3.0
2011-10-10T13:20:11.203Z
@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
CC BY-SA 3.0
2012-01-22T06:09:06.713Z
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
CC BY-SA 3.0
2012-01-22T06:47:18.447Z
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
CC BY-SA 3.0
2012-03-20T02:51:48.797Z
@MeniRosenfeld I believe so, yes.  And it's "14 * 24 * 60 * 60; // two weeks" (first mention of nTargetTimespan in main.cpp)
Chris Moore
CC BY-SA 4.0
2011-09-10T18:00:26.837Z
2018-05-20T03:31:39.490Z
2018-05-20T03:31:39.490Z
Pieter Wuille
<p>I've been told "the network" sets the difficulty level such that there will be one new block mined every ten minutes.</p>

<p>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.</p>

<p>(By rich and poor, I mean only according to how many BTC someone has.)</p>

<p>What's the force saying "No, forget your petty self-interest and set the difficulty to 10 minutes."?</p>

CC BY-SA 4.0
2023-02-24T23:29:11.247Z
Only approximately every 10 minutes: https://bitcoin.stackexchange.com/questions/77783/shortest-and-longest-block-interval-time-ever-recorded-in-bitcoin
Rexcirus
<security><economic-theory><difficulty><block-interval><mining-theory>
What keeps the average block time at 10 minutes?
billpg
# What keeps the average block time at 10 minutes?

(Asked by: username_0 on 2011-09-10)

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."?

**Tags:** security, economic-theory, difficulty, block-interval, mining-theory

> **Comments:**
> **username_1**: Only approximately every 10 minutes: https://bitcoin.stackexchange.com/questions/77783/shortest-and-longest-block-interval-time-ever-recorded-in-bitcoin  

---

## 4 answers

### Answer by username_5 on 2011-09-10. Score: 63 | Accepted answer

The bitcoin network rules define which difficulty each block has. This is done through a simple formula that only depends on the block chain itself. This means that if you give me a blockchain with blocks 1 through N, I can tell you with 100% accuracy what the difficulty of block N+1 will need to be, and I can reject any block which has the wrong difficulty. This means it is not really "the network" deciding on a difficulty, but really **each separate node calculating and enforcing it independently**.

The actual formula is this: at every block N which is a multiple of 2016, look at the time stamps of the past 2015 blocks, and change the difficulty for what follows to old\_difficulty\*(2 weeks)/(time the past 2015 blocks took). Additional rules on which time stamps are allowed in blocks prevent cheating (mostly).

In short, by using a bitcoin client, you agree to its network rules, and those include the difficulty adjustment.

> **Comments:**
> **username_8**: Hmm, 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.)  
> **username_0**: I 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.  
> **username_9**: @username_0 - 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).  
> **username_10**: 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?  
> **username_10**: 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)?  
> **username_11**: @username_10 I believe so, yes.  And it's "14 * 24 * 60 * 60; // two weeks" (first mention of nTargetTimespan in main.cpp)  
> **username_6**: OH, it's 2 weeks and 2016 blocks, not 10 minutes. 2 weeks = 20160 minutes / 2016 = 10 minutes per block.  
> **username_7**: 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?  
> **username_5**: 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.  

---

### Answer by username_2 on 2011-09-10. Score: 12

Each individual client checks the validity of each block it receives. If it receives an invalid block, it ignores that block as if it didn't exist.

If you mine a block and other clients ignore it, you don't get your 50 Bitcoins. You only get to keep your 50 Bitcoins if the block you mined becomes a link in the accepted public chain.

One of the first things that is checked by the client when it receives a block is that the block meets the difficulty target that it calculates based on how quickly blocks have been generated. If that client doesn't think that block meets the difficulty target that it calculated, then it ignores the block.

So you have to mine a block that other clients will accept, or you don't get your 50 Bitcoins.


---

### Answer by username_3 on 2011-09-10. Score: 4

Software. The Bitcoin network runs on a set of previously-agreed-upon rules that are built into the Bitcoin client software.

One such rule is that the difficulty should be changed every 2016 blocks to make a new block take, on average, 10 minutes to mine. As the economics change, miners will startup and shutdown making the average block take more or less than 10 minutes to find but the next time another 2016th block is mined, the difficulty will again be re-adjusted.

I would actually reword your question as well since a block's difficulty isn't technically set to a time but a number. Instead you might want to ask, "What keeps the average time to mine a block at 10 minutes?"


---

### Answer by username_4 on 2011-09-10. Score: 3

The difficulty is adjusted every 2016 blocks by the whole network so as to average the Bitcoin generation to a block every 10 minutes. If the coins were on average generated too fast since the last adjustment, the difficulty is increased, if they were generated too slow - it is decreased.

What the rich can only do is do their best to have the highest possible hashing speed. This would make them brake the block more often (they would earn more money), as well as increase the difficulty higher, so people with lower-end machines could not brake a block without using a pool in a reasonable time (as is the case currently).

What the rich can also do is hoard the Bitcoins, so their value would increase. Keep in mind that even if someone would own 99+% of all the Bitcoins the currency would still be as usable as with bigger pool of coins (Bitcoins currently can be divided to up to 8 decimal places, and there is nothing stopping a future implementation from dividing them up even further).

Of course if someone wants to depreciate the value he or she can undermine the trust people have in the coins. For example, the hacking of [Mt.Gox](https://mtgox.com/) caused a lot of people to be more reserved when handling the coins.
On the other hand, if one wants to increase the value of Bitcoins, one should promote them, convince new people to invest in them and be a contributing member of the community.


---

