2022-11-17 17:49:35 -05:00
2022-11-17 17:37:27 -05:00
2022-11-17 17:49:35 -05:00

ESP-Miner

ESP-Miner is bitcoin miner software designed to run on the ESP32. It mines on ASICs such as the Bitmain BM1397. The BitaxeMax is a handy board for this!

esp-miner block diagram

Architecture

  • Uses the ESP-IDF Framework, which is based on FreeRTOS (no Linux involved)
  • Uses the ESP32 WiFi to connect to the network
  • The ESP32 is provisioned to the local WiFi over BLE using ESP SmartConfig

Firmware

  • ESP-Miner connects to and verifies the attached mining ASIC.

    • Setting the baud rate, hashing frequency, and filling in some other mystery registers
    • This startup-sequence for the BM1387 and BM1397 can be found in cgminer the Kano edition in driver-gekko.c
  • ESP-Miner connects to your pool or stratum server and subscribes to get the latest work.

  • ESP-Miner the latest work and formats it to be sent to the mining ASIC.

    • There isn't much change here except for computing the midstates, and shifting some bytes around
      • Beware of endianess!
      • How do we do this? Examples in cgminer Kano edition.
  • ESP-Miner sends this work to the mining ASIC over serial.

  • The Mining ASIC will report back any when it finds a hash over the difficulty (which)?

    • The catch here is that if it doesn't find a hash over the difficulty, it will not report back at all. So you need to keep track of the hashing frequency and the time so that you can send a new block header to be hashed.
  • ESP-Miner will report back to the pool over Stratum the results of mining.

  • All of the administrative stuff of running a miner like;

    • Set the BM1397 core voltage and current.
    • check the fan speed
    • check the BM1397 temperature
    • optimize the hashing frequency and core voltage for max efficiency
Description
A bitcoin ASIC miner for the ESP32
Readme GPL-3.0 11 MiB
Languages
C 51.7%
SCSS 30%
TypeScript 11.7%
HTML 4%
Python 1%
Other 1.6%