Project

hashrate

0.0
No commit activity in last 3 years
No release in over 3 years
A calculator for expected bitcoin mining profit based on the future difficulty of the blockchain
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

> 1.7
~> 0.3.1
 Project Readme

hashrate

Bitcoin mining profit calculator based on difficulty.

Uses difficulty data from the blockchain.info API and extrapolates data with simple linear regression (via. linefit).

If used in production, I strongly encourage these results to be verified with the bitcoinx profit calculator.

Note: this calculator currently uses a static 25 bitcoin reward. It won't work very well for calculations before 2013 or after 2016.

Note also that I designed this to be used in Rails, so it caches the json from blockchain's API for six hours before requesting it again.

Installation

$ gem install hashrate

Or, if used in a gemfile (like in Rails):

gem 'hashrate'

Example Usage

How much would a 100 GH/s machine have earned running for the last six months?

>> require 'hashrate'
=> true
>> now = Time.new.to_i
>> Hashrate.earning(now - (60 * 60 * 24 * 30 * 6), now, 1000 * Hashrate::GH)
=> 201.08229099734106

201 bitcoins - wow!

What do we expect this machine to earn in the next six months?

>> Hashrate.earning(now, now + (60 * 60 * 24 * 30 * 6), 1000 * Hashrate::GH)
=> 9.280482914219407

Only 9 bitcoins - ouch. Should've started running it six months ago.