SHA’ing on your computer

By | April 23, 2015

Understand how bitcoin mining works can seem like a huge task. They key is to break it down piece by piece.

The first step is to understand what SHA256 is. Search on Google and read all you can about it. Then read this document: fips-180-4.pdf. The Federal Information Processing Standards Publication. Spend 2 weeks reading this over and over again.

Step 2: Google SHA256 code in your favourite coding language. You don’t have to write it from scratch and reinvent the wheel. Beside, if you do, you’ll probably get it wrong the first time and lost weeks in the process. Get some code created by someone else, and if you can find improvements, contribute back so someone can benefit as well.

Analyse the code, really understand the code and relate it back to the FIPS doc. Don’t forget to brush up on your binary and hex skills too.

Step 3: Start SHA’ing data with a nonce and play with the leading Zero concept. ie finding a hash starting with a certain number of leading zeros. What I did is used a bash script to loop over nonce values from this post here: https://bitcointalk.org/index.php?topic=162760.0. @qbits, I’ll make a donation when I earn my first bitcoins!

These 3 steps may seem easy, but it took me over 3 months. Sure you can download code, run it and get up and running within a week but if you don’t understand 100% what is going on, you’ll get yourself into trouble somewhere down the track.

Good luck!

Leave a Reply

Your email address will not be published.