> 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/wiki/blocks-and-the-blockchain/blockchain/target.md).

# Target

The **target** is a 256-bit number that all Bitcoin clients share. The double SHA-256 [Hashing](/wiki/mining-and-consensus/mining.md) of a block's header must be less than or equal to the current target for the block to be accepted by the network. The lower the target, the more difficult it is to generate a block. It's important to realise that block generation is not a long, set problem (like doing a million hashes), but more like a lottery. Each hash is a random number between 0 and the maximum value of a 256-bit number (2^256-1). If a hash is below the target, the node wins. If not, you increment the nonce (completely changing the hash) and try again. The Bitcoin network tries to produce one block every ten minutes on average. As mining hash power changes over time, it achieves this through changing the target value. Historically (prior to forking from BTC in August 2017), Bitcoin changed its target every 2016 blocks (exactly two weeks if a block time of 10 minutes was kept perfectly). This change in the target is known as a 'difficulty adjustment'. Under the original difficulty adjustment paradigm, when adjusting the target, every Bitcoin client compared the actual time it took to generate 2016 blocks with the two week goal and modified the target by the percentage difference. A single retarget never changes the target downwards (increasing difficulty) by more than a factor of 4, or upwards (decreasing difficulty) by more than a factor of 0.75. This prevents large changes in difficulty. After the duplication of the Bitcoin transaction ledger by operators of the BTC network in August 2017, Bitcoin's original difficulty adjustment algorithm was changed to what was named the Emergency Difficulty Adjustment (EDA) algorithm. The EDA had the capacity to update the target value every time a new block was found (as opposed to every 2016 blocks), while still targeting a ten minute block time average. The EDA was changed to the Difficulty Adjustment Algorithm (DAA) on 17 November 2017 to address instabilities associated with the EDA. The DAA uses a moving average of the last 144 blocks to determine changes to the target and like the EDA, the target can change every block. A single DAA retarget never changes the target downwards (increasing difficulty) by more than a factor of 2, or upwards (decreasing difficulty) by more than a factor of 2. This sets the maximum bounds for any change in difficulty. The reason the EDA (and later the DAA) needed to be implemented was due to the creation of the competing BTC network which was expected to garner significantly more hash power than Bitcoin (known as Bitcoin Cash at the time). These measures were put in place so that block production could remain relatively stable due to Miners' ability to instantaneously re-allocate hash between the networks. The DAA remains in use on the BSV network to maintain stability in block production.

1. How is the target stored in blocks? Each block stores a packed representation in its block header (called Bits) for its actual \[] target. The target can be derived from Bits via a predefined formula. For example, if the packed target in the block is 0x1b0404cb, the hexadecimal target is: 0x0404cb x 256^(0x1b - 3) = 0x00000000000404CB000000000000000000000000000000000000000000000000 Note that the 0x0404cb value is a signed value in this format. The largest legal value for this field is 0x7fffff. To make a larger value you must shift it down one full byte. Also 0x008000 is the smallest positive valid value.
2. What is the current target? Check the Bits field of the most recent block on a [block explorer](https://whatsonchain.com/).
3. What is the maximum target? The maximum target used by SHA256 mining devices is: 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF Because Bitcoin stores the target as a floating-point type, this is truncated: 0x00000000FFFF0000000000000000000000000000000000000000000000000000 The maximum target is the target used in the Genesis Block and represents a difficulty of 1. Its packed representation as Bits is 0x1d00ffff. Since a lower target makes Bitcoin generation more difficult, the maximum target is the **lowest** possible difficulty.
4. Related Links See also Difficulty
5. Attribution This content is based on content sourced from <https://en.bitcoin.it/wiki/Target> under [Creative Commons Attribution 3.0](https://creativecommons.org/licenses/by/3.0/). Although it may have been extensively revised and updated, we acknowledge the original authors.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hub.bsvblockchain.org/wiki/blocks-and-the-blockchain/blockchain/target.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
