> For the complete documentation index, see [llms.txt](https://doc.cryptostone.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cryptostone.org/crypto-stone/crypto-stone-wp-cn/wa-kuang-xi-tong/23-kuang-chi-nan-du-de-tiao-zheng.md).

# 23. 矿池难度调整

当参与者增加并导致整体 Mining Power 上升时，宝石可能会被过快挖掘。为了防止这种情况，各矿池会根据整体 Mining Power 调整难度。

当宝石池 `j` 的整体 Mining Power 为 `P_j`，Target Pool Power 为 `P_j^*`，矿池难度为 `D_j` 时，计算如下：

$$
D\_j = \max(1, P\_j \div P\_j^\*)
$$

CryptoStone 的基准值如下：

$$
P\_j^\* = 40,000,000 \text{ Power}
$$

示例如下：

| Target Pool Power | Total Pool Mining Power | 计算                                          | Pool Difficulty |
| ----------------- | ----------------------: | ------------------------------------------- | --------------: |
| 40,000,000        |              20,000,000 | 20,000,000 ÷ 40,000,000 = 0.5 → max(1, 0.5) |            1.0x |
| 40,000,000        |              40,000,000 | 40,000,000 ÷ 40,000,000 = 1.0               |            1.0x |
| 40,000,000        |              80,000,000 | 80,000,000 ÷ 40,000,000 = 2.0               |            2.0x |
| 40,000,000        |             200,000,000 | 200,000,000 ÷ 40,000,000 = 5.0              |            5.0x |

该公式中采用 `max(1, ·)` 结构，是为了在整体 Mining Power 低于 Target Pool Power 时，也不会让难度低于 1.0x。也就是说，即使在参与者较少的初期阶段，也可以防止挖矿速度过度快于基准值。

相反，当整体 Mining Power 超过 Target Pool Power 时，Pool Difficulty 会按比例上升。例如，当某一矿池的整体 Mining Power 增加至 80,000,000 Power 时，Pool Difficulty 为 2.0x。在这种情况下，同一用户挖掘 1 个 NFT 所需时间也约增加为 2 倍。

在智能合约实现中，可以采用 BPS 方式以避免小数计算：

$$
D\_{j,\mathrm{BPS}} = \max(10,000, P\_j \times 10,000 \div P\_j^\*)
$$

其中，10,000 BPS = 1.0x。

这一结构使参与者增加时整体挖矿速度能够自然调整，并防止各宝石供应在短时间内被过度耗尽。


---

# 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://doc.cryptostone.org/crypto-stone/crypto-stone-wp-cn/wa-kuang-xi-tong/23-kuang-chi-nan-du-de-tiao-zheng.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.
