Author

Topic: For educational purposes, I've created a bitcoin miner! (Read 424 times)

brand new
Activity: 0
Merit: 0
Hobby Bitcoin mining can still be fun and even profitable if you have cheap electricity and get the best and most efficient Bitcoin mining
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Since scrypt (used for Litecoin) is more complicated, I decided to start a visual demonstration of the algorithm and also did the same for Double_SHA256. Since the pictures are big here are the direct links:
SHA256: https://i.imgur.com/KhItpCG.jpg
scrypt: https://i.imgur.com/dfOwNyY.jpg
Hopefully they can help. I'll also publish the optimized version of scrypt algorithm soon.



legendary
Activity: 1232
Merit: 1080
Appreciate the comments including in the miner. I think this could be a good thing combined with a mining introduction course where students could potentially take a look at the inner workings of the miner. Possibly a thought when theymos implements these courses he indicated he might be doing.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
Since this project has been getting some traffic on GitHub and some clones I decided to prioritize it for now.

Added scrypt-miner for litecoin to only work with the algorithm and see how LTC mining works, it is not optimized at all. Also since every code I post is written 100% by me from scratch sometimes I end up with much faster code (SHA256 and HMAC are 60% faster than .Net framework's) and sometimes I end up with much slower code (scrypt). These functions are from the library I'm working on so they are thoroughly tested and they are all generalized instead of being specific to mining the 80 byte array!

https://github.com/Autarkysoft/LearnMining/commit/0dd1c4121e0aa8b0654ac1fe07df79efae9df118

I haven't decided whether to focus on optimizing this or move to CryptoNight algorithm since it uses AES among other things and I've already been working on that for my AEZEED project.
legendary
Activity: 1042
Merit: 2805
Bitcoin and C♯ Enthusiast
I've started a new project: https://github.com/Autarkysoft/LearnMining
It serves 3 purposes:
1. Helps with learning how mining works
2. It works with the hash algorithm under the hood
3. Explores optimization of code written in C#

It is a work in progress and I have written everything from scratch purely based on documentations without any kind of "code translation" or "code copying" from other projects so it might contain some mistakes.
Currently it only has bitcoin mining (double SHA256). But I plan on adding other hash algorithms, possibly Scrypt (what LTC uses) be next. I am open to suggestions.
The code has tons of comment on it and I believe it is easy to understand what is going on, I can add more if something is unclear.
Since this is obviously not meant for actually mining anything, parallelization is avoided and it works only on CPU.

Please check it out and tell me what you think. Specially the part about Target here and here, not sure if I'm missing some endian swaps there.
Jump to: