If you just want the miner (and see the world burn), click here.

When talking about mining cryptocurrency, most people will first think about large mining farms with thousands of machines with powerful GPUs, or even ASICs.

It is strikingly similar to the “fields” in the Matrix series. I mean, just search for images of mining farms. They are one of the few things in 21st century that looks straight out of a science fiction.

One day, I randomly stumbled upon this CNX-software post. It wrote about a cluster of ESPs built to mine a suspicious new crypto called “Duino Coin”.

What is this “Duino Coin” and is it good?

I didn’t know. Apparently it is a new cryptocurrency(?) designed to be mined on low-cost hardwares such as Arduinos? What the hell? How would that work? Don’t most cryptos use Proof-of-work?

If you are not familiar about cryptocurrency’s Proof-of-work(PoW) system, PoW systems work by having more powerful computers. It is literally what “proof of work” means. You perform more computations, as a result you get more coins. This obviously leads to large mining farms.

Quick question: Can you apply the same system that encourages large farms to a crypto meant to discourage them? No. It is impossible with PoW.

Arduinos, albeit slow as hell, is still Turing-complete. All Turing-complete computers should be able to emulate Arduinos. It is easy for faster computers to emulate slower ones, while impossible for slower computers to be faster.

And I double-checked, Duino Coin does use Proof-of-work. So how does it mitigate the issues?

Spoilers: It doesn’t. The system simply gives your miner more crypto if it detects that the miner is an Arduino.

How did it manage to work then?

A simple trick: security through obscurity. If no one knew about simple computer science, no one would discover that PoW is the wrong choice here!

Unfortunately, I actually studied in college. What makes it worse is that the official miner for Duino Coin does not have the best programming I’ve seen.

「新しい」 Duino Coin miner

With some basic knowledge in multithreaded programs and cryptography, I implemented a multiplexed duino-coin miner in Rust. Even without multiplexing, it is still several times faster than the official miner.

Everyone, I present to you, the new Duino Coin miner, duino-miner.

It has the following features:

  • Emulate different types of devices (ESP, Arduino, etc.) on any computer
  • Multiplexing (emulate more than one miner)
  • Better hashrates (Mid-state caching, Assembly)
  • Precise hashrate control
  • A bit of randomness to avoid detection

You can now have several dozens of virtualized ESP boards running in your tiny Raspberry Pi 4, all mining Duino Coin with much higher yields than the official miner.

Basically, this miner implemented what this guy was talking about. Enjoy.

Why I am doing this?

Security through obscurity is never a good practice, since it depends on the intelligence of the target audience. To most company it is not a problem, since the general public is usually oblivious and, well, at average. Yes, I am looking at you, Apple.

However, there are people that would coincidentally discover these security flaws. If they refuse to disclose these to the public, then who will?

There are also people building ESP-specific building farms for Duino Coin. For example, the guy that built the 60 ESP-01 carrier board in the CNX-software post. What a waste of silicons and money.

Maybe they think mining on 60 ESP-01 is more efficient than on CPUs. But now, I can show them that my Raspberry Pi can do much better than their ESP clusters in terms of yields and power efficiency.

In other words, I like chaos.