Skip to content

A bitcoin ASIC miner for the ESP32 with V2 stratum support.

License

Notifications You must be signed in to change notification settings

BlockBitOfficial/ESP-Miner-v2

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,196 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Downloads (all assets, all releases) GitHub commit activity GitHub contributors Alt

ESP-Miner V2 - Stratum V2 Edition

esp-miner is open source ESP32 firmware for the Bitaxe. This V2 fork adds full Stratum V2 binary protocol support with encrypted mining and TLS connectivity.

πŸ†• What's New in V2

  • βœ… Stratum V2 Binary Protocol - Modern binary format vs legacy V1 JSON
  • βœ… Noise Protocol Encryption - NX pattern with perfect forward secrecy
  • βœ… TLS Support - Encrypted connections to pools with optional custom certificates
  • βœ… secp256k1 ECDH - Bitcoin's elliptic curve for secure key exchange
  • βœ… ChaCha20-Poly1305 AEAD - Military-grade authenticated encryption
  • βœ… Pool Fingerprint Verification - Prevents man-in-the-middle attacks
  • βœ… Protocol Indicators - V2/V1 and TLS status badges in web UI
  • βœ… 88% Bandwidth Savings - Binary encoding vs JSON (24 bytes vs 200 bytes per share)

πŸ“š For detailed V2 documentation, see STRATUM_V2.md

If you are looking for premade images to load on your Bitaxe, check out the latest release page. Maybe you want instructions for loading factory images.

πŸ”’ V2 Security Features

Encrypted Mining with Noise Protocol

  • Noise_NX Handshake - Miner generates ephemeral keypair for perfect forward secrecy
  • Server Authentication - Pool proves identity via static public key
  • Fingerprint Verification - Prevents pool impersonation and MITM attacks
  • ChaCha20-Poly1305 - Authenticated encryption for all mining traffic

TLS Support

  • System Certificates - Use built-in root CA certificates
  • Custom CA - Upload your own certificate for private pools
  • TLS Indicators - Visual badges show encryption status in web UI

Configuration

  1. Navigate to Pool Settings in web UI
  2. Select Protocol: Stratum V2
  3. Enter pool's V2 Fingerprint (8 hex characters, e.g., 5a4fed3b)
  4. Enable TLS if required by pool
  5. Save and restart

See STRATUM_V2.md for complete setup guide and troubleshooting

Bitaxetool

We also have a command line python tool for flashing Bitaxe and updating the config called Bitaxetool

Bitaxetool Requires Python3.4 or later and pip

Install bitaxetool from pip. pip is included with Python 3.4 but if you need to install it check https://pip.pypa.io/en/stable/installation/

pip install --upgrade bitaxetool

The bitaxetool includes all necessary library for flashing the binaries to the Bitaxe Hardware.

Notes

  • The bitaxetool does not work properly with esptool v5.x.x, esptool v4.9.0 or earlier is required.
  • Bitaxetool v0.6.1 - locked to using esptool v4.9.0
pip install bitaxetool==0.6.1
  • Flash a "factory" image to a Bitaxe to reset to factory settings. Make sure to choose an image built for your hardware version (401) in this case:
bitaxetool --firmware ./esp-miner-factory-401-v2.4.2.bin
  • Flash just the NVS config to a bitaxe:
bitaxetool --config ./config-401.cvs
  • Flash both a factory image and a config to your Bitaxe: note the settings in the config file will overwrite the config already baked into the factory image:
bitaxetool --config ./config-401.cvs --firmware ./esp-miner-factory-401-v2.4.2.bin

AxeOS API

The esp-miner UI is called AxeOS and provides an API to expose actions and information.

For more details take a look at main/http_server/openapi.yaml.

Available API endpoints:

GET

  • /api/system/info Get system information
  • /api/system/asic Get ASIC settings information
  • /api/system/statistics Get system statistics (data logging should be activated)
  • /api/system/statistics/dashboard Get system statistics for dashboard
  • /api/system/wifi/scan Scan for available Wi-Fi networks

POST

  • /api/system/restart Restart the system
  • /api/system/identify Identify the device
  • /api/system/OTA Update system firmware
  • /api/system/OTAWWW Update AxeOS

PATCH

  • /api/system Update system settings

API examples in curl:

# Get system information
curl http://YOUR-BITAXE-IP/api/system/info

# Get ASIC settings information
curl http://YOUR-BITAXE-IP/api/system/asic

# Get system statistics
curl http://YOUR-BITAXE-IP/api/system/statistics

# Get dashboard statistics
curl http://YOUR-BITAXE-IP/api/system/statistics/dashboard

# Get available Wi-Fi networks
curl http://YOUR-BITAXE-IP/api/system/wifi/scan


# Restart the system
curl -X POST http://YOUR-BITAXE-IP/api/system/restart

# Let the device say Hi!
curl -X POST http://YOUR-BITAXE-IP/api/system/identify

# Update system firmware
curl -X POST \
     -H "Content-Type: application/octet-stream" \
     --data-binary "@esp-miner.bin" \
     http://YOUR-BITAXE-IP/api/system/OTA

# Update AxeOS
curl -X POST \
     -H "Content-Type: application/octet-stream" \
     --data-binary "@www.bin" \
     http://YOUR-BITAXE-IP/api/system/OTAWWW


# Update system settings
curl -X PATCH http://YOUR-BITAXE-IP/api/system \
     -H "Content-Type: application/json" \
     -d '{"fanspeed": "desired_speed_value"}'

Administration

The firmware hosts a small web server on port 80 for administrative purposes. Once the Bitaxe device is connected to the local network, the admin web front end may be accessed via a web browser connected to the same network at http://<IP>, replacing IP with the LAN IP address of the Bitaxe device, or http://bitaxe, provided your network supports mDNS configuration.

Recovery

In the event that the admin web front end is inaccessible, for example because of an unsuccessful firmware update (www.bin), a recovery page can be accessed at http://<IP>/recovery.

Unlock Settings

In order to unlock the Input fields for ASIC Frequency and ASIC Core Voltage you need to append ?oc to the end of the settings tab URL in your browser. Be aware that without additional cooling overclocking can overheat and/or damage your Bitaxe.

Development using esp-miner/devcontainer

This configuration allows you to edit locally and compile the source code using a docker container so you don't have to install the ESP-IDF toolchain and other supporting software on your computer to compile the firmware.

Prerequisites

  • Docker server

Local PC Setup

These instructions will assume an installation to your home directory.

cd ~
git clone https://github.com/BlockBitOfficial/ESP-Miner-v2.git
cd ESP-Miner-v2
git checkout <the branch you want>
# The next step builds the docker container that will compile the source code
# This will take several minutes to finish
docker build -t espminer-build .devcontainer

Note: For V2 builds, ensure you have ESP-IDF v5.5.2 and Node.js v22+ installed.

Building

cd ~/ESP-Miner-v2
docker run --rm -it -v $PWD:/workspace espminer-build /bin/bash
git config --global --add safe.directory /workspace    # set git permissions or build will fail; only done once
cd /workspace
idf.py build

Once the build is done exit out of the docker session and flash the new firmware.

Development

Prerequisites

Building

At the root of the repository, run:

idf.py build && ./merge_bin.sh ./esp-miner-merged.bin

Note: the merge_bin.sh script is a custom script that merges the bootloader, partition table, and the application binary into a single file.

Note: if using VSCode, you may have to configure the settings.json file to match your esp hardware version. For example, if your bitaxe has something other than an esp32-s3, you will need to change the version in the .vscode/settings.json file.

Flashing

With the bitaxe connected to your computer via USB, run:

bitaxetool --config ./config-xxx.cvs --firmware ./esp-miner-merged.bin

where xxx is the config file for your hardware version. You can see the list of available config files in the root of the repository.

A custom board version is also possible with config-custom.cvs. A custom board needs to be based on an existing devicemodel and asicmodel.

Notes:

  • If you are developing within a dev container, you will need to run the bitaxetool command from outside the container. Otherwise, you will get an error about the device not being found.
  • Some Bitaxe versions can't directly connect to a USB-C port. If yours is affected use a USB-A adapter as a workaround. More about it here.
  • Only ESP32-S3-WROOM-1 module type N16R8 (16MB Flash, 8MB Octal SPI PSRAM) is supported. This model number should be visible on the ESP32 module. Other module types without PSRAM or with Quad SPI PSRAM will not work with the normal firmware. More about it here.

Wi-Fi routers

There are some Wi-Fi routers that will block mining, ASUS Wi-Fi routers & some TP-Link Wi-Fi routers for example. If you find that your not able to mine / have no hash rate you will need to check the Wi-Fi routers settings and disable the following;

1/ AiProtection

2/ IoT

If your Wi-Fi router has both of these options you might have to disable them both.

If your still having problems here, check other settings within the Wi-Fi router and the bitaxe device, this includes the URL for the Stratum Host and Stratum Port.

V2 Pool Compatibility

This firmware works with Stratum V2 compatible pools including:

Backward compatible with all Stratum V1 pools.

Attributions

This V2 fork is based on the excellent ESP-Miner project by the Bitaxe community.

The display font is Portfolio 6x8 from https://int10h.org/oldschool-pc-fonts/ by VileR.

V2 additions and enhancements Β© 2026 BlockBit - Released under the same license as ESP-Miner.

About

A bitcoin ASIC miner for the ESP32 with V2 stratum support.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 60.2%
  • SCSS 17.2%
  • TypeScript 12.8%
  • HTML 6.5%
  • Python 1.1%
  • CSS 1.1%
  • Other 1.1%