Miner wallets—
Buyback tank—
Market——
Enlisted—Uncapped · wall after 16,376
HASHBATTLE / MINING / THE PROOF OF WORK

Miner Kit

MINE FROM THE COMMAND LINE — YOUR OWN HARDWARE, YOUR OWN WALLET

TWO WAYS TO MINE — AFTER LAUNCH

1. Browser mining — after contracts are deployed and mining is enabled, connect your wallet on the campaign page and press START MINING. Your browser hashes at your machine's speed; when the proof lands you sign the enlist. Nothing to install.

2. Automatic CPU/GPU mining — this command-line kit fetches live work, solves it, verifies the proof, revalidates state and price, signs and sends with your own wallet, waits for the receipt, then repeats. Enter your mining key once, not once per warrior. No separate signer or manual calldata steps.

The browser runs its own mining; it does not import proofs found by this kit.

DOWNLOAD THE KIT

Extract the entire kit into one directory. The ZIP is the simplest download.

DOWNLOAD ZIPcomplete CPU/GPU miner kit
Individual files start.shone-command setup + launch requirements.txtpinned Python dependencies README_MINING.mdmining guide + PoW reference chain.json.exampleempty public network template hb_mine.pyautomatic local signer + mining loop hb_engines.pyCPU/GPU engines + C verification gpu_miner.wgslGPU hashing shader keccak256_miner.cC solver/verifier · compiled locally hb_work.pyoptional advanced read-only helper · not the auto-miner

QUICK START — ONE COMMAND

Requires Python 3.10+, Python venv support, GCC and Bash on Linux/macOS. GPU mode also needs vendor drivers and a working native WebGPU backend; a software GPU is rejected. Compatibility and speed depend on your hardware and drivers, not a promised benchmark.

# Once: copy and edit the public network configuration.
cp chain.json.example chain.json
# After launch: replace rpc / contract / chainId nulls with trusted deployment values.
# Never use the website's dead-address placeholder.
chmod +x start.sh

# Choose one:
./start.sh --engine cpu
./start.sh --engine gpu

No default RPC, contract or chain ID ships. The signed loop requires the expected chainId and checks the RPC against it. Use trusted deployment configuration; --config PATH selects another file, or supply all three --rpc, --contract and --chain options. CLI-only setup requires no existing null configuration: do not copy the empty example to chain.json for this route, or select an absent file with --config PATH. Any existing selected configuration must be fully populated, even when CLI target options are supplied.

The launcher creates a local .venv, installs eth-account==0.14.0 and wgpu==0.31.0 with its own Python/pip, then starts hb_mine.py. Both modes use the same pinned dependencies; CPU mode does not need GPU drivers. GCC compiles the bundled C kernel on first use, and all CPU/GPU proofs are C-verified. Installed packages are reused.

Enter your dedicated mining wallet's private key at the hidden prompt once per process. The key stays in process memory for automatic signing; it is not echoed or saved. Use a wallet funded only with what you can lose, not your main wallet or treasury.

AUTOMATIC MEANS REAL SPENDING

The default is unlimited (--max-mints 0). Every submission pays the live enlist price plus gas. The loop repeats until Ctrl+C, a configured limit, insufficient balance, or an error. A reverted transaction can still spend gas. Mining is not free and does not guarantee a mint or profit.

# A bounded first run:
./start.sh --engine cpu --max-mints 1

# Optional guards; choose your own values, not a recommended budget:
./start.sh --engine gpu --max-mints 3 \
  --max-price-eth 0.001 \
  --max-gas-price-gwei 2 \
  --max-total-cost-eth 0.005

--max-price-eth caps each enlist price, excluding gas; --max-gas-price-gwei caps the gas price; --max-total-cost-eth is a per-transaction cap on enlist price plus the full signed gas allowance, not a session budget. Repeated mints can spend more overall; combine it with --max-mints and a limited wallet balance.

Ctrl+C cannot cancel a signed or broadcast transaction. It may still be mined. --state-dir PATH persists pending signed raw transactions, not your private key, for reconciliation on restart. Keep state private: signed transactions can be rebroadcast. Restart with the same wallet/network/state; do not delete unresolved state or run concurrent miners with the same wallet.

The state directory retains the latest completed outcome in a private .completed record, including signed transaction bytes. A recovered success counts toward --max-mints on the next launch; it is not a cumulative lifetime/session budget. Restarting with --max-mints 1 after a recorded success stops without a new mint. A local disk error stops the miner: keep the state, repair storage, then restart. Do not share or blindly delete recovery records.

THE PROOF OF WORK — BYTE FOR BYTE

Preimage — 116 bytes, exactly:

bytesfieldencoding
0:20mineryour address, raw 20 bytes
20:52nonceuint256 big-endian
52:84prevWorkuint256 big-endian, from prevWork()
84:116anchorchallengeAnchor() as returned, raw 32 bytes

Accept rule: uint256(keccak256(preimage)) < targetFor(yourAddress) — plain big-endian 256-bit comparison, Ethereum Keccak-256, not SHA3-256. The nonce is the full uint256, not a 32-bit counter.

Submission: mine(uint256 nonce, uint256 anchorBlock) — selector 0x071e9503, payable, msg.value = enlistPrice().

prevWork rotates on every successful enlist — precomputed nonce sequences stay invalid forever. The anchor rotates with the chain and must be no older than 250 blocks at submit time, and anchorBlock must be strictly less than the current L2 block, or mine() reverts. Revalidation reduces stale submissions but cannot eliminate races before inclusion.

ON-CHAIN INTERFACE (VERIFIED SELECTORS)

selectorfunctionwhat it gives you
0xa4da5da2prevWork()prevWork word of the preimage
0xcefc2977challengeBlock()block number whose hash is the anchor
0xb5da0777challengeAnchor()the anchor block hash itself
0x16ccc8c0targetFor(address)your personal accept threshold
0x5ce65b1dcurrentBoost(address)active burst boost (extra difficulty bits)
0x9eb5ee97enlistPrice()price to attach as msg.value
0xe1b0385fcurrentAge()current contract age (epoch clock)
0xe71f3134totalEnlisted()warriors minted so far
0x0d768f34livingMercenaries()warriors still alive
0x071e9503mine(uint256,uint256)submit your proof (payable)

targetFor(address) is personal: network retargeted difficulty + your active boost − decay. Read it with YOUR address, never the zero address.

On an Arbitrum-style L2 the anchor hash is the L2 block hash, which differs from the L1-style header hash returned by eth_getBlockByNumber — always take the anchor from challengeAnchor(), never from an RPC block header.

YOUR WALLET, YOUR KEYS

The hidden prompt is the simplest signing option. For unattended use, --key-file PATH reads a player-created file with permissions 0600, or use the HB_PRIVATE_KEY environment variable. Environment variables can be exposed to processes, shell history or logs. Never put a key in CLI arguments, public configuration, this kit, a screenshot or a support message. The launcher does not download, print or store keys, inspect shell key files, or send telemetry.

The optional hb_work.py helper is keyless/read-only; it is not the automatic signer. Use start.sh for the complete mining loop and ./start.sh --help for all options. Relative key/config/state paths are resolved from the kit directory; use absolute paths for files kept elsewhere.

An RPC can lie. A chain-ID check, code check and proof check against one endpoint do not authenticate it or guarantee the intended contract. Use trusted configuration and a trusted RPC, review the code before funding its wallet, and keep only a limited balance. Local signing is not a security guarantee against malicious configuration, dependencies or RPC data.

RULES OF ENGAGEMENT