<p>It's just a simple moving average with a window of 30 blocks:</p>
<pre><code>next_D = sum(past 30 D) / sum(past 30 solvetimes) * 600
</code></pre>
<p>This isn't exactly what it's doing, but it's darn close.</p>

CC BY-SA 3.0
2017-11-19T07:31:09.303Z
Thank you. Is this fomula calculated every blocks? And why is 600?
Anderson
CC BY-SA 4.0
2018-09-20T12:47:19.460Z
Time is calculated in terms of millisecond i believe
VforVendetta
CC BY-SA 4.0
2017-11-17T15:14:07.113Z
2020-12-21T15:09:50.843Z
2020-12-21T15:09:50.843Z
zawy
<p>Bitcoin Gold claimed to have per-block difficulty adjustment, how does it work? I find this <a href="https://github.com/BTCGPU/BTCGPU/pull/151" rel="nofollow noreferrer">https://github.com/BTCGPU/BTCGPU/pull/151</a>, but still don't understand how it work by change some parameters.</p>

<bitcoin-gold><difficulty-retargetting>
How does Bitcoin Gold difficulty adjustment work?
Anderson
# How does Bitcoin Gold difficulty adjustment work?

(Asked by: username_0 on 2017-11-13)

Bitcoin Gold claimed to have per-block difficulty adjustment, how does it work? I find this <https://github.com/BTCGPU/BTCGPU/pull/151>, but still don't understand how it work by change some parameters.

**Tags:** bitcoin-gold, difficulty-retargetting


---

## 1 answers

### Answer by username_1 on 2017-11-17. Score: 1

It's just a simple moving average with a window of 30 blocks:
next_D = sum(past 30 D) / sum(past 30 solvetimes) * 600

This isn't exactly what it's doing, but it's darn close.

> **Comments:**
> **username_0**: Thank you. Is this fomula calculated every blocks? And why is 600?  
> **username_2**: Time is calculated in terms of millisecond i believe  

---

