BASIC KNOWLEDGE [4]: Software for Duinocoin mining

What software do you need for mining the Duinocoin (DUCO)?

You mine the Duinocoin with special mining software. What software do you need for the different possible hardware platforms and where do you get this software? ".

Mining the Duinocoin is possible with different hardware and therefore also different software solutions. There are two basic components: a part that communicates with the pool servers, fetches jobs and sends back results, and a second part that processes the jobs with the DUCO-S1 algorithm.

Overview

The following four articles give a first and rough overview of the whole Duinocoin project:

  1. BASIC KNOWLEDGE [1]: Overview of the Duinocoin
  2. BASIC KNOWLEDGE [2]: Set up Duinocoin wallet
  3. BASIC KNOWLEDGE [3]: Hardware for the Duinocoin
  4. BASIC KNOWLEDGE [4]: Software for Duinocoin mining

Other articles on duinocoin.com go into detail about the individual aspects of the Duinocoin (DUCO) and, for example, the construction of mining rigs.

Github revoxhere

Duinocoin software by "revoxhere

Even though a whole team of young developers has been working on the Duinocoin software for some time, one young programmer has completely developed the first versions himself: Robert "revoxhere" Piotrowski. The Duinocoin software for mining, but also programmes for the DUCO web services and Rest APIs as well as tools for the Magicoin (MAGI) can be found in his Github repository at https://github.com/revoxhere.

Tip: By the way, it is particularly exciting to analyse the first versions of the Duinocoin and to witness how the entire Duinocoin universe emerged from a very simple project - and how it will develop in the future.

Communication with the pool servers

Since every Duinocoin miner wants to send his results to the servers every few seconds and asks for a new job, a single server system would be overloaded with this. For this reason, several so-called pool servers take over this task. Each miner first asks a central location which pool server it should use. Among other things, the utilisation of the servers determines which pool one is assigned to.

Tip: For test purposes, you can also make the request yourself with a browser: https://server.duinocoin.com/getPool.

The answer comes in JSON format (JavaScript Object Notation) and consists of the IP address, the pool name, the port address, the server name and a status message ("true" for "worked!"). The miner now contacts this pool server, logs in there and asks for the first job.

The job is passed to the actual mining engine - this can be the communication computer itself (PC_Miner.py) or microcontrollers connected via USB or I²C (AVR_Miner.py). If a result was calculated with DUCO-S1, it is reported back to the pool server and waited for its response. The answer can be "GOOD" for a correct calculation or "BAD" for a wrong result or another problem.

Processing Mining Jobs with DUCO-S1

As soon as the communication with the pool servers works and jobs are available, the actual mining can begin. The DUCO-S1 algorithm is very simple:

DUCO-S1: The pool server sends two hashes. The first hash is random. A temporary SHA1 hash is calculated from this hash plus a character string (nounce). If this temporary hash is identical to the second hash received, the previously used string is the solution.

The string is incremented from the value of "0" to the Difficulty. A simplified example (the calculated values are not correct!) should make this clear:

Job:   Hash1=E320D1, Hash2=7B025A, Difficulty=6
Miner: Is SHA1(Hash1 + 0..Difficulty) = Hash2 ?
        SHA1(E320D1 + 0) = 32C812 -> wrong
        SHA1(E320D1 + 1) = BC3D24 -> wrong
        SHA1(E320D1 + 2) = 0B0443 -> wrong
        SHA1(E320D1 + 3) = 223F42 -> wrong
        SHA1(E320D1 + 4) = 7B025A -> correct, solution = 4

What is SHA1?

SHA1 (Secure Hash Algorithm #1) is an old and now easily cracked hash algorithm developed in 1993 by NIST (National Institute of Standards and Technology) together with NSA (National Security Agency). As long as security is not an issue, SHA can be used for simple hash tasks such as DUCO-S1 without any problems. SHA1 requires relatively little computing power.

In addition to the result, the number of SHA1 tests are also recorded. Together with the time it took the miner to solve the job, this gives the hashes/second (H/s). With the help of Kolka, the pool servers check whether the H/s match the platform used and the difficulty (an Arduino UNO currently manages 268 H/s).

The entire mining software in one package

Github Duinocoin

Apart from the (pool) server software, all the software for the Duinocoin miner is in one package on Github.

The package can be downloaded via the green button "Code / Download ZIP" and unpacked into a directory.

If you use GNU/Linux or a BSD like Mac OS X, FreeBSD, NetBSD or OpenBSD you can also do this with git:

git clone --depth 1 -b 3.18 https://github.com/revoxhere/duino-coin

The little-known parameter "-b 3.18" downloads exactly this (currently current) version. You get a directory "duino-coin" with all the files needed for normal DUCO miners:

Directories:

  • In Arduino_Code is the sketch that you have to flash to an Arduino UNO/Nano.
  • ESP8266_Code and ESP32_Code contain the source code for the ESP microcontrollers.
  • Resources contains official pictures, symbols and translations
  • Tools contains some help scripts for the Raspberry Pi and for uploading Arduino sketches.
  • Unofficial Miners contains some non-official miner scripts/code. Tip: Julia_Miner.jl is super-simpel!

Files:

  • AVR-Miner.py is the Python3 script for the PC to mine with an Arduino(s).
  • PC_Miner.py is a Python3 miner for the PC (and Raspberry Pi)
  • CLI_Wallet.py and Wallet.py are two wallet implementations - beware, both are deprecated!
  • README.md is the ReadMe formatted in Markdown.
  • LICENSE contains the (in contrast to GPL3) really free MIT licence. A good choice!
  • requirements.txt contains a list of Python3 modules needed for the scripts.

You can delete the .git directories and files if you do not work with git regularly.