Bitcoin Webminer

This project became a highlight of my summer vacation, fueled by the idea of printing money off the school computers once break was over. Mining cryptocurrency is something that's always interested me, as is creating things from scratch, so taking this on just made a lot of sense.  

I opted to mine Bitcoin over other cryptocurrencies such as Dogecoin largely for its ease of implementation. Bitcoin Core, a software for validating the blockchain, has some handy features for sending data to Python.

Mining Bitcoin is straightforward: a hashed string is publicly shared, and computer algorithms rapidly attempt to guess its solution. While hashing is similar to encryption, it is a one-way process. Unlike encryption, which can be reversed with a key, hashed data cannot be converted back to its original form.

Block info and CPU usage

The operation begins with Bitcoin Core transmitting the latest blockchain information to a Python script, which calculates the mining target and forwards it to a server. The server hosts a webpage containing HTML and JavaScript designed for client-side hashing.

In the future there's so much that could be done to expand on this project! Beyond making the UI look better, the mining itself can be improved. Keeping JavaScript as the main interface to start mining, I’d add WebAssembly for faster hashing and Web Workers to enable multi-threading, which would essentially multiply the output.

Simulated outcome

Honestly, I learned a lot.  Before starting the project I hardly knew what bitcoin was and had only been to Stack Overflow a couple of times.  Besides creating a program that takes inputs and outputs some calculations, I gained an understanding on cryptocurrency, HTML formatting, and how hosting a server works!