<p>The difficulty is not really 1.</p>

<p>testnet has a "20-minute rule": if no block is successfully mined within 20 minutes, the difficulty drops to 1 until a block is mined.  Then it reverts to its previous value.  However, it appears that <code>getdifficulty</code> returns 1 whenever the most recent block was difficulty 1, even if it was accepted under the 20-minute rule; this doesn't necessarily match the "real" difficulty.  </p>

<p>I've asked a <a href="https://bitcoin.stackexchange.com/questions/18554/how-can-i-find-the-real-difficulty-on-testnet">new question</a> about how to find the real difficulty.  But by browsing blocks on <a href="http://blockexplorer.com/testnet" rel="nofollow noreferrer">http://blockexplorer.com/testnet</a>, the most recent block which was less than 20 minutes newer than its predecessor is <a href="http://blockexplorer.com/testnet/b/153337" rel="nofollow noreferrer">153337</a>, which has a difficulty of 11512.  So most likely the real difficulty right now is 11512, unless it has adjusted very recently.</p>

<p>Thus there are two possible ways for you to mine a block:</p>

<ul>
<li><p>Find a block at difficulty 11512.  If your computation was right, this will happen on average once every 2 years with your current machine.</p></li>
<li><p>Wait until it has been 20 minutes since the last block, and find a block at difficulty 1 before anyone else does.  Looking at recent timestamps, it appears that difficulty 1 blocks are typically submitted about 20 minutes and 4 seconds after the previous block.  Thus, you have about a 4 second window to find a difficulty 1 block (probably even less due to propagation delays).  Based on your computation, your probability of successfully doing this on any given block is at most about 0.0007, suggesting that you would succeed roughly once every 3 weeks on average (this is probably very optimistic as noted).  Even if you do mine a block within this time, another miner may find a block at roughly the same time; if the next miner to find a block decides to accept his instead of yours, yours will be orphaned and excluded from the chain.</p></li>
</ul>

<p>So it is not surprising that you have not successfully generated a block.</p>

CC BY-SA 3.0
2013-12-12T05:36:30.820Z
I think I'll switch to WorldCoins... They *shouldn't* be easier to mine than "value-less" testnet bitcoins, but I think they are...
BenjiWiebe
CC BY-SA 3.0
2013-12-12T00:00:14.927Z
2013-12-12T00:00:14.927Z
2017-04-13T12:47:36.707Z
Nate Eldredge
<p>First of all, this might not be impossible. The time to mine a block can vary greatly depending on your luck.</p>

<p>But 7-8 hrs is quite a long time. You should make sure your cgminer is correctly connected to your bitcoind instance. Also, I think bitcoind should be fully synchronized and being up-to-date for mainnet does not mean testnet is up-to-date as well.</p>

CC BY-SA 3.0
2013-12-11T23:37:30.483Z
If the expected time to mine a block was 1.5 hours, the probability of not mining one in 8 hours would be `e^(-8/1.5) = 0.0048`.  That would be pretty unlucky.
Nate Eldredge
CC BY-SA 3.0
2013-12-11T23:44:57.173Z
That's what I'm wondering (if cgminer is set up correctly). I am using version 2.7 or something, because later versions don't support CPU mining. Should I use a different miner?
BenjiWiebe
CC BY-SA 3.0
2013-12-11T23:45:19.597Z
Also, bitcoind is running ONLY in testnet. It IS up-to-date.
BenjiWiebe
CC BY-SA 3.0
2013-12-11T23:14:42.213Z
2013-12-11T23:48:43.390Z
2013-12-11T23:48:43.390Z
Steven Roose
<p>I am running <code>bitcoind</code>, and I have <code>cgminer</code> solo-mining on it. I am mining on <code>Testnet3</code>. My hash rate (this is an OLD computer) is <code>~800Khash/s</code>, so according to one online calculator I should be generating a block every 1.5hrs at difficulty 1. The difficulty has been one for quite some time now, and I still haven't gotten any blocks, though I have been mining for much more than 1.5hrs. More like 7 or 8 total I think.</p>

<p>What is wrong?</p>

CC BY-SA 3.0
2013-12-11T23:34:13.843Z
I don't think the difficulty is really 1; see [my question here](http://bitcoin.stackexchange.com/questions/18554/how-can-i-find-the-real-difficulty-on-testnet).
Nate Eldredge
CC BY-SA 3.0
2013-12-11T23:44:05.577Z
As far as I know, `./bitcoind getdifficulty` is the actual difficulty. Also, `./bitcoind getmininginfo`reports the same difficulty.
BenjiWiebe
CC BY-SA 3.0
2013-12-11T23:49:58.017Z
I don't think that's true.  If you browse on http://blockexplorer.com/testnet, you'll see that all the difficulty 1 blocks are just over 20 minutes apart.  If the real difficulty were 1, we should see blocks being mined much more often.  The most recent block submitted less than 20 minutes after its predecessor is [153337](http://blockexplorer.com/testnet/b/153337) which has a difficulty of 11512.  So I think the "real" difficulty on testnet is 11512, unless it has adjusted very recently.
Nate Eldredge
CC BY-SA 3.0
2013-12-11T23:57:04.653Z
Oh...are you saying that within seconds of the diff being set to 1, a block is found? And I should have to mine for 1.5 hours avg AFTER the diff reset to get a block. Correct?
BenjiWiebe
CC BY-SA 3.0
2013-12-12T00:00:42.070Z
Exactly.  I've elaborated in an answer.
Nate Eldredge
<bitcoind><hashpower><testnet><solo-mining><cpu-mining>
Not generating any blocks on testnet
BenjiWiebe
# Not generating any blocks on testnet

(Asked by: username_0 on 2013-12-11)

I am running `bitcoind`, and I have `cgminer` solo-mining on it. I am mining on `Testnet3`. My hash rate (this is an OLD computer) is `~800Khash/s`, so according to one online calculator I should be generating a block every 1.5hrs at difficulty 1. The difficulty has been one for quite some time now, and I still haven't gotten any blocks, though I have been mining for much more than 1.5hrs. More like 7 or 8 total I think.

What is wrong?

**Tags:** bitcoind, hashpower, testnet, solo-mining, cpu-mining

> **Comments:**
> **username_1**: I don't think the difficulty is really 1; see [my question here](http://bitcoin.stackexchange.com/questions/18554/how-can-i-find-the-real-difficulty-on-testnet).  
> **username_0**: As far as I know, `./bitcoind getdifficulty` is the actual difficulty. Also, `./bitcoind getmininginfo`reports the same difficulty.  
> **username_1**: I don't think that's true.  If you browse on http://blockexplorer.com/testnet, you'll see that all the difficulty 1 blocks are just over 20 minutes apart.  If the real difficulty were 1, we should see blocks being mined much more often.  The most recent block submitted less than 20 minutes after its predecessor is [153337](http://blockexplorer.com/testnet/b/153337) which has a difficulty of 11512.  So I think the "real" difficulty on testnet is 11512, unless it has adjusted very recently.  
> **username_0**: Oh...are you saying that within seconds of the diff being set to 1, a block is found? And I should have to mine for 1.5 hours avg AFTER the diff reset to get a block. Correct?  
> **username_1**: Exactly.  I've elaborated in an answer.  

---

## 2 answers

### Answer by username_1 on 2013-12-12. Score: 3 | Accepted answer

The difficulty is not really 1.

testnet has a "20-minute rule": if no block is successfully mined within 20 minutes, the difficulty drops to 1 until a block is mined. Then it reverts to its previous value. However, it appears that `getdifficulty` returns 1 whenever the most recent block was difficulty 1, even if it was accepted under the 20-minute rule; this doesn't necessarily match the "real" difficulty.

I've asked a [new question](https://bitcoin.stackexchange.com/questions/18554/how-can-i-find-the-real-difficulty-on-testnet) about how to find the real difficulty. But by browsing blocks on <http://blockexplorer.com/testnet>, the most recent block which was less than 20 minutes newer than its predecessor is [153337](http://blockexplorer.com/testnet/b/153337), which has a difficulty of 11512. So most likely the real difficulty right now is 11512, unless it has adjusted very recently.

Thus there are two possible ways for you to mine a block:

* Find a block at difficulty 11512. If your computation was right, this will happen on average once every 2 years with your current machine.
* Wait until it has been 20 minutes since the last block, and find a block at difficulty 1 before anyone else does. Looking at recent timestamps, it appears that difficulty 1 blocks are typically submitted about 20 minutes and 4 seconds after the previous block. Thus, you have about a 4 second window to find a difficulty 1 block (probably even less due to propagation delays). Based on your computation, your probability of successfully doing this on any given block is at most about 0.0007, suggesting that you would succeed roughly once every 3 weeks on average (this is probably very optimistic as noted). Even if you do mine a block within this time, another miner may find a block at roughly the same time; if the next miner to find a block decides to accept his instead of yours, yours will be orphaned and excluded from the chain.

So it is not surprising that you have not successfully generated a block.

> **Comments:**
> **username_0**: I think I'll switch to WorldCoins... They *shouldn't* be easier to mine than "value-less" testnet bitcoins, but I think they are...  

---

### Answer by username_2 on 2013-12-11. Score: 1

First of all, this might not be impossible. The time to mine a block can vary greatly depending on your luck.

But 7-8 hrs is quite a long time. You should make sure your cgminer is correctly connected to your bitcoind instance. Also, I think bitcoind should be fully synchronized and being up-to-date for mainnet does not mean testnet is up-to-date as well.

> **Comments:**
> **username_1**: If the expected time to mine a block was 1.5 hours, the probability of not mining one in 8 hours would be `e^(-8/1.5) = 0.0048`.  That would be pretty unlucky.  
> **username_0**: That's what I'm wondering (if cgminer is set up correctly). I am using version 2.7 or something, because later versions don't support CPU mining. Should I use a different miner?  
> **username_0**: Also, bitcoind is running ONLY in testnet. It IS up-to-date.  

---

