> ## Documentation Index
> Fetch the complete documentation index at: https://kb.talostrading.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Difficulty

## Contents

* [Difficulty](https://kb.talostrading.com/coinmetrics/network-data/network-data-overview/mining/difficulty.md#difflast)
* [Mean Difficulty](https://kb.talostrading.com/coinmetrics/network-data/network-data-overview/mining/difficulty.md#diffmean)

## Difficulty

### Definition

The difficulty of the last block in the considered time period. Difficulty represents how hard it is to find a hash that meets the protocol-designated requirement (i.e., the difficulty of finding a new block) that day. The requirement is unique to each applicable cryptocurrency protocol. Difficulty is adjusted periodically by the protocol as a function of how much hashing power is being deployed by miners.

| Name | MetricID | Unit | Interval |
| - | - | - | - |
| Difficulty | DiffLast | Dimensionless | 1 day, 1 hour |

### Details

* This metric is not comparable across all chains as its value is dependent on the hashing function used by each chain.

### Chart

![](https://mintcdn.com/talos-trading/9m6tIKuinLLOp5jj/coinmetrics/images/BTC_Blocktime_vs._Difficulty_Adjustments.png?fit=max\&auto=format\&n=9m6tIKuinLLOp5jj\&q=85\&s=d1567be823e84276bfee24ad430e6314)

### Chart

![](https://mintcdn.com/talos-trading/9m6tIKuinLLOp5jj/coinmetrics/images/Coin_Metrics_Network_Data_2022-09-15T15-37.png?fit=max\&auto=format\&n=9m6tIKuinLLOp5jj\&q=85\&s=0cd33aa3e1581d0c5018082bc463b9c2)

Source: CM Network Data Charts

### Asset-Specific Details

* This metric is only available for PoW chains.

### Examples

* Bitcoin’s mining difficulty is a network-determined parameter that automatically adjusts roughly every 2 weeks (2,016 Bitcoin blocks) to target a 10-minute block interval. To maintain this frequency, the algorithm steps in and increases or decreases the difficulty of mining Bitcoin depending on the mining activity on the network. When China banned BTC mining in Q2 of 2021, we saw a drop in mining activity on the network, therefore the difficulty dropped as well.

### Release History

* Released in the 4.2 release of NDP

### Interpretation

* Difficulty is a measure of how difficult it is to mine a block. The greater the difficulty, the more computational power is needed to mine a block.

### Availability for Assets

[https://coverage.coinmetrics.io/asset-metrics/DiffLast](https://coverage.coinmetrics.io/asset-metrics/DiffLast)

## Mean Difficulty

### Definition

The mean difficulty of finding a hash that meets the protocol-designated requirement (i.e., the difficulty of finding a new block) that day. The requirement is unique to each applicable cryptocurrency protocol. Difficulty is adjusted periodically by the protocol as a function of how much hashing power is being deployed by miners.

| Name | MetricID | Unit | Interval |
| - | - | - | - |
| Mean Difficulty | DiffMean | Dimensionless | 1 day |

### Details

* This metric is not comparable across all chains as its value is dependent on the hashing function used by each chain.

### Chart

![](https://mintcdn.com/talos-trading/9m6tIKuinLLOp5jj/coinmetrics/images/BTC_Mean_Difficulty___Price%20\(1\).png?fit=max\&auto=format\&n=9m6tIKuinLLOp5jj\&q=85\&s=57e6f9a9c2afbf786b9669eca09a5cd4)

Source: CM Network Data Charts

### Examples

* When the majority of the Bitcoin blocks are produced at 10 minutes, the difficulty adjustments will not be significant. This could indicate new miners are not getting online and existing ones are not shutting off their operations.

### Asset-Specific Details

* This metric is only available for PoW chains.

### Interpretation

* This measures how difficult and time consuming it is to find the right hash for each block

### Release History

* Released in the 1.0 release of NDP

### Availability for Assets

[https://coverage.coinmetrics.io/asset-metrics/DiffMean](https://coverage.coinmetrics.io/asset-metrics/DiffMean)

## Block Difficulty

### Definition

The raw block difficulty value as reported by the protocol.

| Name | MetricID | Unit | Interval |
| - | - | - | - |
| Block Difficulty | block\_difficulty | Dimensionless | 1 day |
| Block Difficulty Change | block\_difficulty\_change | Dimensionless | 1 day |

### Details

* `block_difficulty` reports the raw difficulty value set by the protocol for the latest block in the interval.
* `block_difficulty_change` measures the change in block difficulty between intervals, useful for tracking adjustment events.
* These metrics are only available for PoW chains.

### Availability for Assets

[https://coverage.coinmetrics.io/asset-metrics/block\_difficulty](https://coverage.coinmetrics.io/asset-metrics/block_difficulty)

## API Endpoints

metrics can be accessed using these endpoints:

* `timeseries/asset-metrics`

and by passing in the metric ID's `Diff*` or `block_difficulty*` in the `metrics` parameter.

`GET /timeseries/asset-metrics`

> [tab] Shell
>
> ```shell theme={null}
> curl --compressed "https://api.coinmetrics.io/v4/timeseries/asset-metrics?metrics=DiffMean&assets=btc&pretty=true&api_key=<your_key>"
> ```

> [tab] Python
>
> ```python theme={null}
> import requests
> response = requests.get('https://api.coinmetrics.io/v4/timeseries/asset-metrics?metrics=DiffMean&assets=btc&pretty=true&api_key=<your_key>').json()
> print(response)
> ```

> [tab] Python Client
>
> ```python theme={null}
> from coinmetrics.api_client import CoinMetricsClient
>
> api_key = "<API_KEY>"
> client = CoinMetricsClient(api_key)
>
> print(
>     client.get_asset_metrics(
>         metrics="DiffMean", 
>         assets="btc",
>     ).to_dataframe()
> )
> ```
