<p>I think that these articles are great for educational purpose:</p>
<p><strong>Bitcoin mining the hard way: the algorithms, protocols, and bytes</strong><br><br>
<em>This article explains Bitcoin mining in details, right down to the hex data and network traffic. If you've ever wondered what really happens in Bitcoin mining, you've come to the right place.</em><br>
<a href="http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html" rel="nofollow noreferrer">http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html</a>
<br><br></p>
<p><strong>Mining Bitcoin with pencil and paper: 0.67 hashes per day</strong><br><br>
<em>I decided to see how practical it would be to mine Bitcoin with pencil and paper. It turns out that the SHA-256 algorithm used for mining is pretty simple and can in fact be done by hand. Not surprisingly, the process is extremely slow compared to hardware mining and is entirely impractical. But performing the algorithm manually is a good way to understand exactly how it works.</em><br>
<a href="http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and-paper.html" rel="nofollow noreferrer">http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and-paper.html</a></p>
<br>
The first one include also small programs in python that mines a block and connect to a mining pool stratum server.

CC BY-SA 4.0
2021-04-22T19:50:21.517Z
2021-04-22T19:50:21.517Z
leevancleef
<p>I would like if someone could point me to a minimal program source code that does solo minig on a CPU. (Can assume a running bitcoind/full node)</p>
<p>Something that in theory (obviously not in practice) would actually be able to mine a block from the live network. This is intended for educational purposes, not for profit. Good code structure is therefore more important than performance.</p>

CC BY-SA 4.0
2021-04-22T10:51:32.103Z
https://github.com/trottier/original-bitcoin/tree/master/src ?
RedGrittyBrick
<mining-theory><source-code><education>
Educational sample of minimal working mining code
user1747134
# Educational sample of minimal working mining code

(Asked by: username_0 on 2021-04-22)

I would like if someone could point me to a minimal program source code that does solo minig on a CPU. (Can assume a running bitcoind/full node)

Something that in theory (obviously not in practice) would actually be able to mine a block from the live network. This is intended for educational purposes, not for profit. Good code structure is therefore more important than performance.

**Tags:** mining-theory, source-code, education

> **Comments:**
> **username_1**: https://github.com/trottier/original-bitcoin/tree/master/src ?  

---

## 1 answers

### Answer by username_2 on 2021-04-22. Score: 1

I think that these articles are great for educational purpose:

**Bitcoin mining the hard way: the algorithms, protocols, and bytes**  
  
*This article explains Bitcoin mining in details, right down to the hex data and network traffic. If you've ever wondered what really happens in Bitcoin mining, you've come to the right place.*  
<http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html>

**Mining Bitcoin with pencil and paper: 0.67 hashes per day**  
  
*I decided to see how practical it would be to mine Bitcoin with pencil and paper. It turns out that the SHA-256 algorithm used for mining is pretty simple and can in fact be done by hand. Not surprisingly, the process is extremely slow compared to hardware mining and is entirely impractical. But performing the algorithm manually is a good way to understand exactly how it works.*  
<http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and-paper.html>

  
The first one include also small programs in python that mines a block and connect to a mining pool stratum server.


---

