matteocrippa / matteocrippa/leafminer

Add IPv6 support to connect to IPv6 supported pools

Open
#41 2 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
C
Stars
158
Forks
26
PR merge metrics
No merged PRs in 30d

Description

Can you add IPv6 TCP/IP stack support to Leafminer along with IPv4 in order that miners can connect to pools preferably via IPv6 rather than IPv4. This avoids having passing via a connection with NAT or even ISP CGNAT and can favor a bit more privacy in certain scenarios.
Although still a lot of people forget, IPv6 is responsible for over 50% of the Internet traffic on some networks given the biggest content generators worldwide fully support IPv6. IPv6 is the actual Internet Protocol and IPv4 is legacy already.
There are already several VPS and hosting offerings IPv6 as well.

Normally most modern operating systems with dual-stack (IPv4 and IPv6) support try to automatically connect preferably via IPv6 if both are available at source and destination. The important thing is that an IPv6 address can be received or autoconfigured by the board and when connecting to pool it will resolve the destination FQDN to IPv6 and use it to connect.
The simplest way the board can get an IPv6 address from the router is via RA/SLAAC (Stateless) which is default for almost any router with IPv6 support.

Both ESP32 and ESP9266 have support for a while in the LWIP since RTOS SDK v1.3.0
For reference Tasmota firmware has IPv6 support for both boards (https://tasmota.github.io/docs/IPv6/). For ESP32 is default, for ESP8266 requires a specific build probably due to the image size which may not be a problem for Leafminer which seems to have a smaller footprint and binary size, but anyway it says it should use an extra 20-30kB extra flash size.
In their documentation it mentions "SetOption149 1"in order to query AAAA before A.

For the most know Solo pools the following have full IPv6 support:
- public-pool.io
- pool.vkbit.com
- solo.ckpool.org
- btc.solomining.io

References:
https://tasmota.github.io/docs/IPv6/
https://github.com/esphome/esphome/pull/5449
https://esphome.io/changelog/2024.3.0.html#ipv6

Contributor guide

Open the contributing guide

Research direction

No repository files, tests, or entry points are named in the issue. Start by locating the pool connection, DNS resolution, and ESP network initialization paths, then compare their IPv4 handling with the referenced Tasmota and ESPHome IPv6 behavior. Done means ESP32 and ESP8266 can obtain IPv6 via RA/SLAAC, prefer AAAA resolution, and connect to IPv6-capable pools.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.