How to code the Simplest BitCoin CPU Miner?

16

7

How would I go about making the simplest form of a CPU bitcoin miner? I have not been able to find documentation on the whole process...

ExtremeCoder

Posted 2011-09-26T09:14:25.230

Reputation: 261

This same question was asked on Stack Overflow.

David Schwartz 2011-09-26T16:42:42.250

Answers

8

If you're fluent in Python, there is a reference RPC miner, written by one of bitcoin's developers: https://github.com/jgarzik/pyminer

Pieter Wuille

Posted 2011-09-26T09:14:25.230

Reputation: 54 032

2I am looking for a more generic document that explains the steps involved. Thanks for this though :)ExtremeCoder 2011-09-26T09:54:19.860

2I would say python functions pretty well as pseudo-codeEarlz 2013-12-04T21:24:22.900

5

Here, a nice explanation (even if the post is old) http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html

gdlm

Posted 2011-09-26T09:14:25.230

Reputation: 151

3

This is a great tutorial for that, if you are familiar with python:

https://github.com/philipperemy/my-first-bitcoin-miner

DavideC

Posted 2011-09-26T09:14:25.230

Reputation: 31

2

Welcome to Bitcoin.SE! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

MeshCollider 2017-12-12T23:31:03.460

My answer is in the same still and of the same quality of the others, but I have got a downvote and a comment saying: "We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed." The other answers are very similar to mine, just show another tutorial. I think this is very, very unfair.DavideC 2018-01-02T13:13:02.160

Apologies, you're correct, in general link-only answers are discouraged but there's no reason that the other answers got upvotes while yours was downvoted. I'm sorryMeshCollider 2018-01-02T19:13:19.740