> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/section-4-proof-of-work-bitcoin-whitepaper/difficulty-adjustment-and-block-validation.md).

# Difficulty Adjustment and Block Validation

<figure><img src="https://3421145409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRTEKu4E7Fvtss3GI9CYU%2Fuploads%2FYO9YKJR5JtwKpwLN6v7G%2Fdifficulty.gif?alt=media&amp;token=537c186b-292b-45ad-9603-383d00ea5ceb" alt=""><figcaption></figcaption></figure>

*To compensate for increasing hardware speed and varying interest in running nodes over time, the proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour. If they're generated too fast, the difficulty increases.*

\- Satoshi Nakamoto, Bitcoin Whitepaper

To maintain a consistent rate of block discovery, the Bitcoin network employs a **difficulty adjustment algorithm**. This algorithm dynamically adjusts the difficulty of the PoW process based on the total computational power of the network and the time taken to mine previous blocks. The goal is to ensure that, on average, a new block is added to the blockchain approximately every ten minutes.

#### Difficulty Adjustment Mechanism:

* **Moving Average**: The difficulty is recalibrated based on the average time taken to mine the last 2016 blocks, which corresponds to roughly two weeks of mining.
* **Increased Difficulty**: If blocks are being mined too quickly, the difficulty increases to slow down the rate of block creation.
* **Decreased Difficulty**: Conversely, if blocks are being mined too slowly, the difficulty decreases to encourage faster block generation.

This adaptive mechanism ensures that the network remains stable and that the block validation process is efficient, regardless of fluctuations in hashing power or the number of active nodes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/section-4-proof-of-work-bitcoin-whitepaper/difficulty-adjustment-and-block-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
