<p>The <a href="https://bitcoin.org/en/glossary/difficulty" rel="nofollow">network difficulty</a> is equal to the maximum allowed (least difficult) <a href="https://bitcoin.org/en/glossary/nbits" rel="nofollow">target</a> divided by the current target; if you set your minimum target to <em>x</em> and it's still at <em>x</em>, then that would also be a relative difficulty of 1.</p>

<p>An easy way to confirm this is to look at the calculated difficulty for your genesis block (or block 1 if you got your genesis block from somewhere else).</p>

<pre><code>bitcoin-cli getblockhash 0
bitcoin-cli getblock &lt;hash_from_above&gt;
</code></pre>

<p>If it also says difficulty is one, then you know difficulty hasn't changed since you started mining.</p>

<p>As an interesting side note, as of (I think) Bitcoin Core 0.11.0, Bitcoin's regtest supports "instant" block generation even though its official maximum target is much lower (more difficult).  This means that it has difficulties far below 1:</p>

<pre><code>$ bitcoin-cli -regtest getmininginfo
{
  "blocks": 0,
  "currentblocksize": 0,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "errors": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications",
  "genproclimit": -1,
  "networkhashps": 0,
  "pooledtx": 0,
  "testnet": false,
  "chain": "regtest",
  "generate": false
}
</code></pre>

CC BY-SA 3.0
2015-11-03T04:01:17.850Z
2015-11-03T04:01:17.850Z
David A. Harding
<p>I am simulating a private bitcoin network that I started with the <code>initial difficulty set to (1/2)^16</code>, however after about 20 blocks of mining on the network it increased to <code>1</code> and has been constant since then. As far as I understand from the source code, it is supposed to increase after every 2016 blocks, so how did it increase after only 20 blocks.<a href="https://i.sstatic.net/c8LAP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/c8LAP.png" alt="Notice the difficulty=1"></a></p>

<p>Change of <code>powLimit</code> in my bitcoind instances.</p>

<pre><code>strNetworkID = "regtest";
        consensus.nSubsidyHalvingInterval = 210000;
        consensus.nMajorityEnforceBlockUpgrade = 51;
        consensus.nMajorityRejectBlockOutdated = 75;
        consensus.nMajorityWindow = 100;
        consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
        consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
        consensus.nPowTargetSpacing = 10 * 60;
        consensus.fPowAllowMinDifficultyBlocks = true;
        consensus.fPowNoRetargeting = false;
</code></pre>

CC BY-SA 3.0
2015-11-02T17:13:57.407Z
Are you sure it didn't say difficulty 1 all along?  On Bitcoin mainnet, difficulty is equal to the maximum (least difficult) target divided by the current  target; if you set your minimum target to x and it's still at x, then that would also be a relative difficulty of 1.
David A. Harding
CC BY-SA 3.0
2015-11-03T03:04:54.797Z
@DavidA.Harding yeah I figured that out later from the bitcoin documentation. Thanks.
bawejakunal
CC BY-SA 3.0
2015-11-03T04:01:34.423Z
Cool.  Turned it into an answer.
David A. Harding
<bitcoind><difficulty><proof-of-work>
Abrupt increase in difficulty of proof-of-work
bawejakunal
# Abrupt increase in difficulty of proof-of-work

(Asked by: username_0 on 2015-11-02)

I am simulating a private bitcoin network that I started with the `initial difficulty set to (1/2)^16`, however after about 20 blocks of mining on the network it increased to `1` and has been constant since then. As far as I understand from the source code, it is supposed to increase after every 2016 blocks, so how did it increase after only 20 blocks.[![Notice the difficulty=1](https://i.sstatic.net/c8LAP.png)](https://i.sstatic.net/c8LAP.png)

Change of `powLimit` in my bitcoind instances.

```
strNetworkID = "regtest";
        consensus.nSubsidyHalvingInterval = 210000;
        consensus.nMajorityEnforceBlockUpgrade = 51;
        consensus.nMajorityRejectBlockOutdated = 75;
        consensus.nMajorityWindow = 100;
        consensus.powLimit = uint256S("0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
        consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
        consensus.nPowTargetSpacing = 10 * 60;
        consensus.fPowAllowMinDifficultyBlocks = true;
        consensus.fPowNoRetargeting = false;

```

**Tags:** bitcoind, difficulty, proof-of-work

> **Comments:**
> **username_1**: Are you sure it didn't say difficulty 1 all along?  On Bitcoin mainnet, difficulty is equal to the maximum (least difficult) target divided by the current  target; if you set your minimum target to x and it's still at x, then that would also be a relative difficulty of 1.  
> **username_0**: @username_1 yeah I figured that out later from the bitcoin documentation. Thanks.  
> **username_1**: Cool.  Turned it into an answer.  

---

## 1 answers

### Answer by username_1 on 2015-11-03. Score: 1

The [network difficulty](https://bitcoin.org/en/glossary/difficulty) is equal to the maximum allowed (least difficult) [target](https://bitcoin.org/en/glossary/nbits) divided by the current target; if you set your minimum target to *x* and it's still at *x*, then that would also be a relative difficulty of 1.

An easy way to confirm this is to look at the calculated difficulty for your genesis block (or block 1 if you got your genesis block from somewhere else).

```
bitcoin-cli getblockhash 0
bitcoin-cli getblock <hash_from_above>

```

If it also says difficulty is one, then you know difficulty hasn't changed since you started mining.

As an interesting side note, as of (I think) Bitcoin Core 0.11.0, Bitcoin's regtest supports "instant" block generation even though its official maximum target is much lower (more difficult). This means that it has difficulties far below 1:

```
$ bitcoin-cli -regtest getmininginfo
{
  "blocks": 0,
  "currentblocksize": 0,
  "currentblocktx": 0,
  "difficulty": 4.656542373906925e-10,
  "errors": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications",
  "genproclimit": -1,
  "networkhashps": 0,
  "pooledtx": 0,
  "testnet": false,
  "chain": "regtest",
  "generate": false
}

```


---

