Breaking Down the Relationship Between Hashrate and Mining Shares

Rather than storing and using raw hashes, mining pools leverage shares as an approximate measure of hashrate. Let’s look at how shares are leveraged in pool payout methodology and used to calculate estimated hashrate values.

sha2fiddy
Foundry
5 min readDec 7, 2022

--

Terms to Know

  • ASICs (Application-Specific Integrated Circuit): also known as ‘bitcoin miners’ or ‘mining machines’, ASICs are purpose-built computers that are exceedingly good at one task but cannot be used for general computing. With bitcoin mining, ASICs are engineered to compute SHA-256 hashes as fast as possible.
  • Hash (SHA-256): the deterministic output of a cryptographic hash function applied to an input (a piece of data). In bitcoin mining, ASIC miners take input data and compute hashes using the SHA-256 hash function. All bitcoin miners are essentially competing in a race to iterate through inputs and compute each input’s hash until one hash is considered valid and can be used to mine a block. The hash’s validity is defined by its mining difficulty.
  • Hashrate: the frequency at which one or more ASIC miners produce SHA-256 hashes, typically measured in hashes per second (h/s), and various scales of this rate. Common hashrate scales are Terahash (Th/s), Petahash (Ph/s), and Exahash (Eh/s) — 1 trillion, 1 quadrillion, and 1 quintillion hashes per second, respectively. One modern ASIC alone can produce several Th/s.
  • Mining Difficulty: a dynamic threshold parameter that a hash must satisfy to be considered valid and used to mine a block. The Bitcoin network launched with a level 1 mining difficulty — the lowest possible level. As of November 2022, the current difficulty is over 36 trillion.
  • Difficulty Adjustment: the Bitcoin network recalculates mining difficulty every 2016 blocks to maintain a target average block interval of 10 minutes. When the average block interval is faster than 10 minutes (due to an increase in total network hashrate), the adjustment will proportionally increase the difficulty in an attempt to return to a 10-minute interval, and vice versa. In ideal conditions, a block interval of exactly 10 minutes, the 2016 block difficulty adjustment would occur exactly every two weeks.
  • Mining Pool: an entity that uses software to coordinate individual miners coming together to combine their hashrate in order to mine blocks on a more regular basis. This allows participants to have a more stable income compared to solo mining. Participants are paid based on the amount of hashrate they contribute to the pool. (Note: this is a simplified explanation — most pools, including Foundry USA Pool, have varied and more nuanced payout models.)

What are mining shares and why do mining pools use them?

Mining shares is a metric used to represent the approximate number of hashes that a miner computes during a period of time. Mining pools use shares in their calculations because storing raw hashes is impractical — the numbers involved in measuring hashes are so great, it would put major constraints on the pools’ databases and communication channels with individual miners (more on this below).

How are mining shares calculated?

A mining share can be thought of as a valid hash that meets the mining difficulty criteria and can be used to mine a block. This definition is only true at a mining difficulty level 1, in which on average, a miner will produce 1 share every 2³² (4,294,967,296) hashes. For consistency, shares do not consider actual network mining difficulty and are always calculated using a difficulty level 1.

Therefore, 1 share is approximately equal to 2³² hashes. Though this conversion is not absolutely accurate, it is statistically accurate when using total shares as a representation of total hashes over 1 hour, 1 day, or longer. Modern ASICs operate with such high hashrates (trillions of hashes per second), that shares can be used with a high degree of accuracy for 1 or 5-minute intervals.

How are mining shares used?

Due to issues in computer science with transferring, storing, and performing calculations with very large numbers, it is not reasonable for individual miners to submit their raw total hashes to mining pools. Nor is it reasonable for pools to store those numbers and use them to calculate payouts. Instead, miners submit total shares, a statistically accurate representation of total hashes, which pools use to calculate payouts.

To use a simplified example, let’s assume a miner submitted 100 shares. At the end of the day, the pool would calculate the value per share (based on mining difficulty). This could be something like 0.0001 BTC per share. That miner would be paid 0.01 BTC from the pool.

How can mining shares be used to calculate estimated hashrate?

We now know that mining shares are an approximate representation of total hashes during a period of time. To convert shares to an estimated hashrate value (hashes per second), we must first convert shares to total estimated hashes, then divide by total seconds in that period:

shares * 2³² / seconds

Commonly, we will want to divide by total seconds in 1 hour (3,600) or 1 day (86,400). Below is an example using Python to convert total shares in one day to approximate daily hashrate, and common hashrate scales Terahash, Petahash, and Exahash:

total_seconds = 86400

hashrate = total_shares * 2**32 / total_seconds
hashrate_TH = (total_shares * 2**32 / total_seconds) / 1000000000000
hashrate_PH = (total_shares * 2**32 / total_seconds) / 1000000000000000
hashrate_EH = (total_shares * 2**32 / total_seconds) / 1000000000000000000

Fun Fact: typically, only accepted shares are used to calculate estimated hashrate values. Miners may also submit rejected shares (these shares do not comply with mining difficulty or are otherwise invalid), and/or stale shares (valid shares computed while mining on an old block, before the miner has heard about the latest block). Rejected and stale share numbers are usually a tiny fraction of accepted shares. More info on stale and rejected shares can be found on Foundry’s FAQ Page.

Conclusion

Since raw hashrate numbers are too large and impractical to use in mining pools, pools use mining shares as a measure of hashrate. To see how shares are leveraged in the Foundry USA Pool, visit our FAQ page for a full description of our payout methodology.

Bitcoin Stack Exchange Pages Used as Reference

Disclaimer

The contents of this post have been provided by Foundry Digital LLC (“Foundry” or “we”) for informational purposes only, and should not be construed as giving legal, financial or any other kind of advice. Although we strive to provide quality information, we do not guarantee or warrant any particular results from the use of this information or any opinions provided. Foundry accepts no liability whatsoever for any damages, costs or any other consequences resulting from any actions taken on the basis of the information or opinions provided. Furthermore, Foundry has no control over information provided in any third-party sites linked herein, and Foundry accepts no liability whatsoever over any consequences resulting from any actions taken on the basis of that information. Foundry reserves the right to make changes to this information at any time without prior notice and makes no commitment to update the information contained in this post.

--

--

sha2fiddy
Foundry

Consumer of #Bitcoin Data and Memes | https://nostr4newbies.com/ | npub1sha2fddyx7ysjvch0jvfea8gm5dwt7q5sayker3szfdymvq2ckcsrxcqyj