Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bitaxe-repool

A Claude Code skill that finds every Bitaxe-family miner on your network and repoints them all at the 256 Foundation pool under a venue's Nostr npub — with a consistent, dashboard-friendly worker-naming convention — then hands you a clean overview.

It works across stock Bitaxe (ESP-Miner / AxeOS) and the NerdQAxe firmware fork, and its helper scripts are plain, dependency-free Python you can also run by hand.

Made for the kind of setup where a bunch of solo-lottery Bitaxes live at a bar, meetup, or lab and you want them all mining to the house npub in one move.


What it does

Say something like "I'm at PubKey — scan the network and switch all the bitaxes over to the 256 pool under PubKey's npub." The skill runs the whole flow:

  1. Scans the current subnet (and any extra ranges you name) for miners — identified by the AxeOS API, not just an open port 80.
  2. Asks where you are and resolves that venue's Nostr npub from an authoritative source — the venue's own self-hosted NIP-05 identity — and verifies it before trusting it.
  3. Repoints every miner to pool.256foundation.org:3333 with username <npub>.<venue>-bitaxeNNN, restarts them, and confirms each reconnects and hashes.
  4. Prints an overview and flags anything odd (a miner with no fallback, one hashing under spec, etc.).

The conventions it locks in

Setting Value
Pool pool.256foundation.org:3333 (primary stratum on every miner)
Username <npub>.<venue>-bitaxeNNN — zero-padded index assigned in IP order
Hostnames left untouched — the stratum username identifies the miner to the pool, not the device name
Fallback pools left untouched — the safety net stays put

Example (venue = PubKey, npub npub1key55…):

npub1key55ax33gkl50uqemvl4khrtqrhzm7wzpc7fhseutt5ddkcwcrqgxlt3h.pubkey-bitaxe001
npub1key55ax33gkl50uqemvl4khrtqrhzm7wzpc7fhseutt5ddkcwcrqgxlt3h.pubkey-bitaxe002
npub1key55ax33gkl50uqemvl4khrtqrhzm7wzpc7fhseutt5ddkcwcrqgxlt3h.pubkey-bitaxe003

Install

Skills live in ~/.claude/skills/. Clone this repo into that directory:

git clone https://github.com/Schnitzel/skill-bitaxe-repool.git ~/.claude/skills/bitaxe-repool

Claude Code picks it up automatically. Verify with /skills (or just ask Claude to "scan for bitaxes").

Requirements: Python 3 (standard library only — no pip install), and network reachability to the miners' HTTP API.


Usage

Once installed, natural-language prompts trigger it:

  • "scan the network for bitaxes"
  • "I'm at PubKey, switch all the miners over to the 256 pool under their npub"
  • "look up the npub for <venue> and repoint the axes"
  • "what pool are my bitaxes on right now?"

Claude reads SKILL.md, runs the scripts, and confirms the npub with you before changing anything.

Running the scripts directly

The three helpers are self-contained and useful on their own.

Scan for miners (auto-detects the current /24, or takes explicit CIDRs):

python3 scripts/scan.py                       # current subnet
python3 scripts/scan.py 10.0.5.0/24 192.168.50.0/24

Resolve a venue's npub from its self-hosted NIP-05, or convert a hex key:

python3 scripts/npub.py from-domain pubkey.bar     # every name -> hex -> npub
python3 scripts/npub.py hex2npub <64-char-hex>     # NIP-19 bech32 encode

Repoint the miners (preview with --dry-run, then run for real):

python3 scripts/apply.py --npub <npub> --venue pubkey \
  --ips 10.0.5.11,10.0.5.12,10.0.5.13 --dry-run

apply.py sets only the primary stratum (URL/port/user), restarts each miner, and polls until it's back on the new pool and hashing. Hostnames and fallback pools are never touched.


How the npub lookup stays trustworthy

The worker username routes pool attribution to a Nostr identity — so getting the npub right matters, and the skill never guesses one. It prefers the venue's self-hosted NIP-05 file (https://<domain>/.well-known/nostr.json), because a key served from the venue's own domain can't be spoofed by a third party. It then verifies the resulting npub resolves to the expected profile (via njump.me) before anything is applied. npub.py does the bech32 (NIP-19) encoding locally with no external dependencies.


AxeOS API notes

Both stock Bitaxe (ESP-Miner) and the NerdQAxe fork expose the same shape:

Call Purpose
GET /api/system/info Full status + config (the Bitaxe fingerprint)
PATCH /api/system Update stratumURL / stratumPort / stratumUser / stratumPassword
POST /api/system/restart Apply a stratum change (miner reconnects on boot)

A PATCH frequently drops the TCP socket right after applying — an empty/000 response is normal, so the scripts confirm with a read-back rather than trusting the HTTP code. The "connected to primary vs fallback" check differs by firmware (NerdQAxe uses stratum.pools[].connected; stock AxeOS uses wifiStatus + isUsingFallbackStratum); apply.py handles both.


Safety

  • Read-only by default. scan.py and npub.py never write anything. apply.py only mutates when run without --dry-run.
  • npub is verified, never guessed — the one costly, silent mistake this domain has, and the skill is built to avoid it.
  • Reversible. To revert, repoint each miner's stratumURL / stratumUser and restart.

Credits & links

License

MIT © Michael Schmid

About

Claude Code skill: scan a network for Bitaxe/NerdQAxe/AxeOS miners and repoint them at the 256 Foundation pool under a venue's Nostr npub (worker convention <npub>.<venue>-bitaxeNNN).

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages