📜 ⬆️ ⬇️

Mining on the ESP32 microcontroller was not very profitable



20-year-old German programmer Jake described his mining experiment on an ESP32 microcontroller.

ESP32 is a series of low-cost microcontrollers that are used in some gadgets, such as bracelets, smart lamps, and single-board computers . Mining on such devices makes little sense, but is interesting as a conceptual experiment. Theoretically, one can imagine that in the future the number of smart devices in the world will dramatically increase. Perhaps someone is already thinking out the technology to create a giant multibillion-dollar botnet.

Jake says that this project was inspired by the initiative of a mining colleague on the ESP8266 microcontroller . He calculated the probability of successfully finding a block as 1 of 1e16. Blocks appear every ten minutes, so this is a kind of lottery, only the chances of winning are vanishingly small.
')

Mining on the ESP8266 microcontroller

One way or another, but to test the concept, Jake took the 56333 block already found and calculated such initial parameters so that the microcontroller “finds” this block through a small number of rounds of computing the double SHA256 , as in a real Bitcoin network.

The code is published on Github . It uses the mbed TLS library (see the manual ), performs hashing, checks each received hash, then stops if it is a valid result or increases the value of nonce otherwise — and continues to count. When the program stops at a valid hash, it outputs the result to the console:

Started mining...
Valid Block found!
Hash: 0000000000000000000740ba375bbafbb871e0e201ded9c260a8b6aa1537c3f0
With nonce: 423644052 | 0x19404b94
In 10000 rounds, 831.635000 ms
Hash Rate: 12.024506 kH/s


As you can see, the microcontroller mined at a speed of 12 kH / s, that is, ten times faster than ESP8266. And this is only one core of ESP32, the author writes, so potentially the speed can be increased up to 24 kgs / s.

However, even a tenfold acceleration will not allow enrichment. The author himself has calculated that even out of 100 million devices, the botnet is only $ 150 a year.

If to mine on a single microcontroller, then it should find a block in 24 ZH / 24 kH / s = 10 18 seconds = 277 777 billion hours = 11 574 billion days = 31 billion years, which is two and a half times the age of the Universe.

Source: https://habr.com/ru/post/444454/


All Articles