Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I need to display the pool and worker hashrates on my website. The pool uses PSQL.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

hashesPerSecond = math.pow(2, 32) * proofsOfWork / secondsElapsed

where proofsOfWork is the number of difficulty 1 proofs of work (aka shares) that the user or pool has found during secondsElapsed seconds.

If you use variable difficulty, then you can count a proof of work from someone mining at difficulty X the same as X proofs of work at difficulty 1.

For mhps divide by 1e6. For ghps divide by 1e9. And so on..

math.pow(2, 32) == 4294967296

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.