Mining Bitcoin On The ESP32 For Fun, Definitely Not Profit

Bitcoin’s great, if you sold at the end of 2017. If you’re still holding, your opinion might be a little more sour. The cost to compete in the great hashing race continues to rise while cryptocurrency values remain underwhelming. While getting involved at the top end is prohibitively expensive, you can still have some fun with the basic concepts – as [Jake] did, by calculating Bitcoin hashes on the ESP32.

It’s a project that is very much done for fun, rather than profit. [Jake] notes that even maxing out both cores, it would take 31 billion years to mine one block at current difficulty levels. Regardless, the underlying maths is nothing too crazy. Double-hashing the right data with the SHA256 algorithm is all that’s required, a task that is well within the ESP32’s capabilities. There’s hardware acceleration available, too – though this is weirdly slower than doing it in software.

Overall, you’re not going to get rich hashing Bitcoin on a cheap microcontroller platform. You might just learn something useful, though. If this isn’t weird enough though, you could always try the same thing on a 1970s Xerox Alto. 

 

7 thoughts on “Mining Bitcoin On The ESP32 For Fun, Definitely Not Profit

  1. So, if you had 31 billion ESP32s running this it would only take on average 1 year to mine one bitcoin unit.

    I wonder how much power 31 billion ESP32s running this code for a year would use.

    1. It may not be profitable to run it on your own ESP32s, but who knows how many internet-of-things there are on the internet. It at least puts a measurable price on IoT security.

    1. When you look at the current hash rate of the bitcoin network of about 50 EH/s (50,000 PH/s or 50,000,000 TH/sec or 50,000,000,000 MH/sec) witch each hash being 64-bits long. So at best with back of the envelop maths 100MBit/s speeds with the AES256 HW could do would be ~1.5MH/sec. So it is extremely slow by comparison.

      1. Sorry I forgot about the Double-hashing so it would be 781KH/second vs 50,000,000,000,000 KH/sec of the overall network. So the odds of wining each new race would be the inverse of that – 0.000000000015625 or for every 64000000000 races to find the correct block (~10 minute apart) you should win one, as long as the difficulty (which is mostly increasing) remained the same.

  2. This is going to be used a lot in the future, i believe.

    When drones or swarms are released to accomplish a task, using a blockchain communication between drones to build a shared “memory” and to operate in a concerted manner.

    I believe the edge computing concept will eventually include blockchain storage modules.

    I whole heartedly invite others to read about the non- money uses of this tech.

    1. Dr. Who already did it! He started a “almost impossible, in time” calculation in his previous sonic screwdrivers from the begining, so when he really needed the result data it was already avaliable! :-)

Leave a Reply to Truth Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.