Duinocoin Mining with ESP8266

Without PC: How to mine Duinocoin (DUCO) on an ESP8266 (ESP-01 & ESP-01s)

The Duinocoin (DUCO) can be mined not only on the Arduino UNO, but also on various Espressif ESP8266 boards. Thanks to integrated WLAN, the boards only need a power supply and access to a WiFi AccessPoint, but no PC as a bridge computer.

Probably the cheapest way to mine Duinocoin (DOCU) is with an ESP8266-based microcontroller. Once programmed, an ESP8266 only needs a 3.3V power supply thanks to integrated WLAN - and it works.

Overview

To mine the Duinocoin (DUCO) with an ESP8266 (also ESP01 and ESP01s) you need the following:

  1. a Duinocoin-Wallet (online account).
  2. a computer with Windows, GNU/Linux or Mac OS X and Python 3.x
  3. a working Arduino IDE including the ESP8266 libraries.
  4. the Duinocoin software (from Github)
  5. a 3.3 volt power supply and WLAN.

The preparations can be done in about half an hour. With this setup and a single ESP8266, you can subsequently mine around 4-8 DUCO per day.

What is the difference between an ESP8266 and an Arduino UNO?

The ESP8266 is significantly smaller and cheaper than an original Arduino UNO and Arduino clone. Even inexpensive Arduino Pro Mini (without USB port) can hardly be bought for less than 5 Euros in Germany - the ESP-01, on the other hand, is available for about 1.90 Euros per piece.

ESP8266

The ESP8266 is significantly faster than the ATMEGA328P of the Arduino UNO. An ESP8266 runs at 80 or 160 MHz, which is five to ten times faster than the ATMEGA328P of the Arduino UNO, which runs at 16 MHz. In terms of computing power, an ESP8266 beats the ATMEGA328P by a factor of 37 for the DUCO-S1 algorithm: 10 kH/s for the ESP8266 compared to 268 H/s for the ATMEGA328P.

Since the Duinocoin uses the Kolka system to reward slow systems more than fast systems, unfortunately nothing remains of the extra speed in the DUCO wallet. The Arduino UNO creates around 8 DUCO per day, an ESP8266 creates less DUCO: on average only 6-7 per day.

Nevertheless, ESP8266 boards have an advantage over the Arduino UNO and the like, because they do not need AVR_Miner.py, which runs on a PC and mediates between the Arduino UNO and the DUCO servers. The ESP8266s come with all the communication software and connect independently via WLAN to the DUCO servers. A 3.3V power supply (or 5V via USB) is therefore sufficient to operate an ESP8266, and this could come from a solar cell combined with a power bank.

By the way: What is the difference between an ESP-01 and an ESP-01s? The ESP-01 is the older version and usually comes on a black board, the ESP-01s often on a blue one - but I also have ESP-01s on black boards. The ESP-01 has 512 kBytes of flash, whereas the ESP-01s has 1 MByte. An ESP-01 has a red power LED and a blue one on TX, the ESP-01s has no power LED and a blue LED on GPIO2 (low = on!). In practice, other differences are noticeable, for example in the handling of the deep-sleep mode. Personally, I have fewer problems with projects using the ESP-01 and can usually do without the additional flash memory of the ESP-01.

1. create a Duinocoin wallet on the project page

To be able to store the mined Duinocoin (DUCO) somewhere, you need a wallet. This is managed online at Duinocoin. The new wallet is created at https://wallet.duinocoin.com/register.html.

Create a new wallet

Create a new wallet (account) at wallet.duinocoin.com.

2. computer with Windows, GNU/Linux or Mac OS X and Python 3.x

The minimal mining software for the PC only requires a Python 3 interpreter. To check whether Python 3 is available, do the following:

  • GNU/Linux: Open terminal via Ctrl-Alt-T (if necessary, use Ctrl-Alt-F2, back with Ctrl-Alt-F7).
  • Windows: Open Powershell via Win+R and "powershell".
  • Mac OS: Finder > Applications > Utilities > Terminal

At the prompt, enter the following:

python --version

The two minus signs are important (except for Mac OS X). If "python" is not found, you can try "python3 -- version", then the version is hardcoded. The result should look something like this:

mipl@z600:~$ python3 --version
    Python 3.9.2

This machine (an HP Z600 workstation with Devuan GNU/Linux 3.0 "Chimaera" stripped of systemd) is obviously running Python 3.9.2.

How to install Python3 on your computer is described in detail in Installing Python3 on GNU/Linux PC.

3. Install Arduino IDE (development environment) and ESP8266 libraries

To program the mining software on an ESP8266 microcontroller, the easiest way is via the Arduino IDE (development environment). The free and open source software is offered by the Arduino Project as a free download for Windows, GNU/Linux and Mac OS X.

In a detailed article I show how to install the Arduino IDE. If you want it to be more comfortable, you can install the Arduino IDE in "portable mode" and thus make your backups and switching between different microcontroller architectures easier. A third article gives tips for the first steps after installing the Arduino IDE.

Tip: If you have problems accessing the ESP8266 via USB on GNU/Linux computers, you have to adjust the access rights to device files (serial ports, USB) under GNU/Linux.

Install ESP8266 libraries

The Arduino IDE is logically geared towards AVR microcontrollers like the Arduino UNO and its relatives. Fortunately, it can be easily extended. To be able to program ESP8266 boards, you have to give the board manager (board manager) a link to a JSON file provided by Espressif:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

This URL is entered in the Arduino IDE under "File / Preferences" in "Additional board manager URLs:". The best way to do this is to click on the small window symbol to the right of the input line. A mini-editor opens in which you can enter one board administrator URL per line.

Arduino IDE 1.8.19

Through additional board manager URLs, the Arduino IDE can also program ESP8266 or other microcontrollers.

So if you use the ESP32 as well as the ESP8266, enter the following two lines there:

http://arduino.esp8266.com/stable/package_esp8266com_index.json
https://dl.espressif.com/dl/package_esp32_index.json

Click on "Ok" in both dialogues to apply the changes.

Now open the board manager and search for "ESP" with the type setting "All". After a few seconds, the two entries "esp32 - by Espressif Systems" and "esp8266 - by ESP8266 Community" appear, both of which should be installed.

Arduino IDE 1.8.19

In the board manager you install and update the original and additional board definitions.

Now ESP8266 and ESP32 boards can be programmed with the Arduino IDE. Restarting the IDE is not necessary... but it does not hurt either.

4. the Duinocoin software

The official standard software for Duinocoin mining with individual microcontrollers (no "rigs") is provided by the project as source code. The latest version is always available on Github.

Github Repo of revox

The Duinocoin repository from revox on Github.

Via "Code / Download ZIP" the ZIP archive with the current Duinocoin code is downloaded and then unpacked.

Communication and mining take place on the ESP8266, so it needs the appropriate software. This can be generated directly from the source code in the ESP8266_Code directory and uploaded to the ESP8266 microcontroller like any other project (sketch).

Attention: In contrast to the Arduino UNO sketch, you have to make adjustments to the ESP8266 sketch: At least the WLAN SSID, the WLAN password and the name for the Duinocoin wallet/account must be set correctly!
const char* SSID     = "MyWLAN";      // WLAN-SSID
const char* PASSWORD = "MyPASS";      // WLAN password
const char* USERNAME = "ElJalapeno";  // Wallet name
const char* MINER_KEY= "geheim";      // Miner key, optional

Very important:

Attention! Don't forget to change the board under "Tools / Boards" and "ESP8266" to "Generic ESP8266"!

Install additional header files

When compiling, you will now get error messages because some header files cannot be found.

  • ArduinoJson from 6.18.3 by Benoit Blenchon (and not Arduino_JSON!!) must be installed via the library management.
  • If an error occurs with bearssl/bearssl.h, the ArduinoBearSSL library was forgotten to be installed via the library management.
  • It may also be that the microcontroller boards need to be updated in the Arduino IDE, see here under point 2.
Mining with a ESP8266

Mining with an ESP8266 (ESP01), followed in the serial monitor of the Arduino IDE.

Happy Mining! :)