Amid all the crypto madness, Bitcoin mining has become nearly impossible for independent users, with only ASIC-equipped farms standing a chance against its daunting difficulty. Yet that doesn't cancel Bitcoin's educational potential, which brings us to YouTuber stacksmashing, who decided to modify a Game Boy to try to mine some coins…
Bitcoin, Bitcoin, Bitcoin
At the time of writing, each coin is worth $59,500, and its market capitalization exceeds $1 trillion. Of course, I'm talking about Bitcoin, the cryptocurrency par excellence. With few exceptions, other coins behave like corks floating in Bitcoin's water: they rise with it and fall with it. Still, nobody can stop talking about them, and with certain personalities expressing support via Twitter (!), there's plenty to discuss.
That includes Bitcoin's technical and educational side. In the past, we've seen the inside of the world's largest Bitcoin mines, and we've also learned to mine Bitcoin with a pencil and a sheet of paper. What's next on the list? Game Boy! YouTuber stacksmashing took the classic Nintendo handheld, connected it to a computer using a Raspberry Pi Pico as a bridge, and developed a small app compatible with the Game Boy's architecture to mine Bitcoins… or at least attempt it.
How to Mine Bitcoin with a Game Boy
The video does an excellent job explaining the essential theory of Bitcoin mining: each data block is processed twice with SHA256, and the resulting hash is a 256-bit number. That number is compared to the network's generated target value, and if it's less than or equal, mining of the block is declared successful, rewarding 12.5 bitcoins. The current block is only 76 bytes, to which we must add four bytes of nonce value, and the nonce increases each time the resulting number isn't below the target.
In relaxed terms, miners try to guess an extraordinarily complex number, and if they succeed, they get bitcoins in return. stacksmashing's Game Boy has the titanic task of receiving that block, processing it, and if it gets the right number, sending it to the network. The problem is that the console only has a Game Link port, but the incompatibility is solved with a Raspberry Pi Pico, a modified Game Link cable, and a level shifter that corrects voltage differences (3.3V for the Pico, 5V on the Game Link).
In Summary: A Beautiful Madness
The hardest part of the project is creating suitable software for the console. With an open-source development kit and a SHA256 implementation derived from the Trezor hardware wallet, the Game Boy software works flawlessly. Meanwhile, the Raspberry Pi Pico starts SPI and USB serial to send and receive data, letting the console and computer talk to each other. The final step is to create a Bitcoin node (with a download of several hundred gigabytes) and use compatible mining software. The only one that worked with this project was ntgbtminer, based on Python.
The good news? The Bitcoin mining system on the Game Boy works perfectly, and all relevant code is available for anyone who wants to replicate the project. The bad news is that the console's performance is 0.8 hashes per second, or 125 billion times slower than a modern ASIC miner. Patience.