# What is the value of hashrate?

The value of a given amount of hashrate over a chosen period of time is ultimately a function of the mining difficulty over the period. To deal with this complexity, we at Block Green, have developed a machine learning-driven approach named the `miner-rewards-model`.

## Miner rewards model

The Block Green `miner-rewards-model` aims to predict the BTC value of a given amount of hashrate over a given period of time. For example, with the BG model, we are able to answer the question: how much BTC will 10 PH/s generate in the coming 6 months. In turn, we can use this information to price opportunities on the platform.

Note: Although the model is capable of predicting on any horizon, at present, the model has been tuned to predict most accurately at 3 and 6-month horizons where we have the greatest focus for opportunities on the platform.

## Methodology

#### From NHR to BTC rewards

The aim of the game is to estimate the BTC rewards (subsidy + fees) that a specified amount of hashrate will deliver over a chosen period of time. To achieve this objective, we have designed and implemented a multi-component, predictive, time-series machine learning model where each component either models (green boxes below) or calculates (red boxes below) a different component of the "NHR to BTC rewards" computation.&#x20;

<figure><img src="https://1455297423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnqQgpcyBVjC88X9lQYN1%2Fuploads%2FHDApenQpTfuB7aMUYrW0%2FMethodology.png?alt=media&#x26;token=5963c54d-9fe9-44b1-9d6e-71287fac2b00" alt=""><figcaption></figcaption></figure>

From the predicted network hashrate, we are able to derive the predicted mining difficulty which in turn enables a calculation of the predicted number of blocks that will, on average, be mined by the specified amount of hashrate. Since both BTC fees and subsidy are directly driven by the number of blocks we have a basis for predicting BTC rewards.&#x20;

Note: our approach derives mining difficulty meaning that the BTC generating potential of a given amount of hashrate is always evaluated on each day in the context of mining difficulty on that day. For example, 10 PH/s will generate more BTC on a low-difficulty day than it will during a high-difficulty period making it a very important factor to control when predicting the number of blocks. Lastly, it is worth noting that since subsidy still far outweighs the income from fees, we have focussed modeling efforts primarily on Network Hashrate prediction.

Note: Given that >90% of BTC rewards are made up of subsidy issuance, at present the focus of the `miner-rewards-model` is placed on subsidy prediction. Of course, as the network and market matures and subsidy become negligible a greater focus and modeling effort on BTC fees will be required.

#### Predicting NHR

It is the network hashrate prediction of the Block Green `miner-rewards-model` where machine learning is leveraged to predict \*\*\*network hashrate\*\*\* for every day over a chosen period of time (prediction horizon).

In the Block Green `miner-rewards-model` codebase we have a model store comprised of a variety of different model formulations. We regularly test each of "candidate" models on a range of prediction horizons to ensure we are always using the most accurate and statistically robust model choice given the data.&#x20;

Today, the "best" model for our 3/6 month focus is "Multivariate Prophet model with Black Swan Event Simulation". Under the hood, we are leveraging Facebook's [Prophet](https://towardsdatascience.com/time-series-analysis-with-facebook-prophet-how-it-works-and-how-to-use-it-f15ecf2c0e3a) model which is a GLM that leverages piecewise linear regression to capture trend, seasonality, and residuals through the detection of changepoints and parametric modeling of relationships between endpoints.

<figure><img src="https://1455297423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnqQgpcyBVjC88X9lQYN1%2Fuploads%2FowtTcXAlrJQVc71u8X2X%2FSlide1.jpeg?alt=media&#x26;token=fbb3cb8a-40c9-440d-b858-86b309913131" alt=""><figcaption></figcaption></figure>

## Why this model?

The Network Hashrate time series has three key characteristics which make it difficult to model:&#x20;

1\) Rapid growth trajectory: requiring extrapolation with more parameterized statistical approaches

2\) Heteroskedasticity: volatility around the trend which is not constant

3\) Epoch-level seasonality which doesn’t correlate with dates but rather number of blocks mined\


The Prophet trend model is able to capture the dominant phenomenon with this time series, namely the rapidly growing trend. In the use case of pricing new opportunities, we are much less concerned about capturing volatility and much more concerned with getting the model to capture the average relationships. This is because we care that we can accurately estimate the total BTC rewards delivered over the period much more than predicting the specific rewards on a given day. &#x20;

i.e. Let's say over the last 4 days we have observed NHR to be 1e20, 2e20, 1e20, 2e20. We are aiming for a model that would predict 1.5e20 for all 4 days as this captures the overall difference.

This model currently only uses one additional covariate to explain network hashrate, this is the Black Swan Event feature. To be clear, we do not attempt to predict when a black swan event will happen but include a feature that allows us to suppose that on a given date there would be a black swan event and view the impact on network hashrate. This allows us to generate scenarios with respect to black swan events and outputs ranges of BTC rewards generated in each scenario.

Note: Some examples of other good explanatory variables include: Mining profitability, BTC price, public miner growth plans, difficulty estimates, and energy prices. However in time series forecasting if you include explanatory variables you also need to predict/forecast those. At this time, we decided to opt for a simpler, more parsimonious model until we are better placed to have a forward-looking view of Network Hashrate's explanatory variables/drivers.

## Where do we get our data?

* Network hashrate: We are collecting all blockchain data from Coinmetrics via their API.
* Black swan event calendar: Derived from inspection of the network hashrate time series

## How we use the "miner-rewards-model" to price opportunities

The `miner-rewards-model` predicts BTC rewards for each day over a chosen prediction horizon. However, to account for uncertainty in the model's prediction, at Block Green, we capture the BTC rewards prediction across the 95% confidence interval.

<figure><img src="https://1455297423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnqQgpcyBVjC88X9lQYN1%2Fuploads%2FLpTIJtGvmtZyJvaFL9ps%2FSlide2.jpeg?alt=media&#x26;token=3d366aac-08fd-457e-9c5e-d72df7cfa594" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1455297423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnqQgpcyBVjC88X9lQYN1%2Fuploads%2FBrXMXFcQ4ujao3DL8evX%2FSlide3.jpeg?alt=media&#x26;token=ba36a62f-0665-4dc5-b096-7e8fd8daee36" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1455297423-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnqQgpcyBVjC88X9lQYN1%2Fuploads%2Fb4VdpkU0IkRjD8CZOeo2%2FSlide4.jpeg?alt=media&#x26;token=b5c1ad04-5651-428d-94b7-48f4faad1a52" alt=""><figcaption></figcaption></figure>

We directly use these confidence intervals based on upper and lower bounds in our contracts to protect both sides of the agreement. The lower bound is the most important in our pricing approach. It ensures that the miner will very likely (\~95% chance) be able to produce the promised amount of BTC and therefore satisfy the agreement. This also highly benefits the LP as they have more security / lower risk of default by the miner.

\


\
\


\
