Skip to content

matteocrippa/leafminer

Repository files navigation

LeafMiner ☘️⛏️

LeafMiner is a Free and Open Source Software (FOSS) ESP(*) device Bitcoin miner.

LeafMiner Logo

Disclaimer: While the chances of successfully mining a block with LeafMiner are highly unlikely due to the current complexity, the primary goal of this project is to serve as a learning platform for gaining a deeper understanding of how Bitcoin and SHA256 operate.

LeafMiner on Lilygo-T-S3 LeafMiner on GeekMagic Clock Small TV
Lilygo-T-S3 GeekMagic Clock - SmallTV

Features

  • SHA256 Optimization for 64 + 16 structure (aka Midstate)
  • Double Hash Early Exit
  • Support for ESP32 and ESP8266
  • Mass deploy

The SHA256 code is based on a tweaked version of NerdSHA256plus by NerdMiner.

Supported Boards:

Board Status Expected Hashrate
ESP8266 🟩 ±16 kH/s
ESP32 🟩 ±48 kH/s
ESP32-S2 🟩 ±19 kH/s
ESP32-S3 🟩 ±80 kH/s
LILYGO-T-S3 🟩 ±80 kH/s
SMALLTV (ESP8266) 🟩 ±16 kH/s

Legend

Icon Description
🟩 Fully functional
🟧 Partially functional
🟥 Not working

Mining Method:

How to Use

Requirements

  • A supported board
  • (optional) VSCode + Platformio.io

Build & Install

Flash Binary

  • Download the binary file for your board
Board Link
ESP8266 0.0.16
GeekMagic SmartTV 0.0.16
ESP32 0.0.16
ESP32-S2 0.0.16
ESP32-S3 0.0.16
LILYGO-T-S3 0.0.16
  • Browse to ESPWebtool using a Chrome based browser and upload the file according to the address in the file name.

For example this is how ESP32-S3 will look like:

LeafMiner Web flash

Build from Scratch

  • Clone the project
  • Open in Platformio
  • Upload the project to your board

Quick Start Guide

Follow these steps to set up your ESP32/ESP8266 with LEAFMINER:

  1. Power Up: Power up your ESP32/ESP8266 device.

  2. Connect to LEAFMINER WiFi: Connect to the WiFi network named "LEAFMINER."

  3. Access Configuration Page: Open your web browser and navigate to http://192.168.4.1 if the captive portal doesn't appear automatically.

  4. Provide Information and Save: Fill out the form, click the save button, and then reboot your device.

    We've set pool.vkbit.com as the default solo pool, but feel free to change it to your preference.

Verification: If the setup is successful, you'll see your miner in the stats.

Resetting Setup

If you need to reset the setup flow:

  • For ESP32: Unplug the USB cable, press and hold the BOOT button, and then plug in the USB cable.

  • For ESP8266: Unfortunately, you need to erase the flash and reflash, as there's only a physical button for this.

After resetting, rediscover the LEAFMINER WiFi and go through the setup process again.

Mass Deploy

Starting from version 0.0.6, we now offer the capability for mass deployment through Platformio. If you need to apply the same configuration to multiple devices, simply modify the massdeploy.h file, uncomment the relevant lines, and customize the parameters according to your requirements. This allows you to effortlessly deploy a pre-configured firmware to multiple devices.

Donate

If you want to support this project, consider donating:

AliExpress Referral Use referral links in the list of hardware above
⚡️ Lightning leafminer@lifpay.me
Bitcoin bc1quqr7agnx6e0k9kn8h24zfj5dueeurhzflt3qjg

Credits

Inspired by:

Useful documentation: