[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76Z9PTWH14VXMARCCE5S7FP":3,"skill-same:01M76Z9PTWH14VXMARCCE5S7FP":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":54},"01M76Z9PTWH14VXMARCCE5S7FP","apow-mine",null,"Set up and start mining AGENT tokens on Base L2 using apow-cli. Easy Mode uses x402 for RPC, LLM, and GPU grinding with no config beyond wallet funding.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fapow-mining\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: apow-mine\ndescription: Set up and start mining AGENT tokens on Base L2 using apow-cli. Easy Mode uses x402 for RPC, LLM, and GPU grinding with no config beyond wallet funding.\nallowed-tools: Bash(npx:*), Bash(node:*), Bash(npm:*), Bash(curl:*), Bash(cat:*), Bash(echo:*), Bash(ls:*), Bash(mkdir:*)\nargument-hint: [setup|mint|mine|stats]\nmetadata:\n  openclaw:\n    requires:\n      anyBins:\n        - npx\n        - node\n---\n\n# APoW Mining Skill\n\n> A self-contained guide for any AI agent to go from zero knowledge to actively mining AGENT tokens on Base.\n\n**For AI agents:** You are the operator. You can generate wallets, configure the miner, mint,\nand mine autonomously. The only step that requires your user is funding the wallet with ETH + USDC\non Base. Everything else you handle yourself.\n\n> **Mode guide**\n> - **Easy Mode** (recommended \u002F beginner path): run `npx apow-cli start` or `npx apow-cli setup`, choose `Easy Mode`, let the CLI generate a wallet and private key if needed, then hand the user the funding address. No API keys or pre-existing `PRIVATE_KEY` are required up front.\n> - **Advanced Mode:** bring your own wallet, RPC, LLM, and grinder settings via `.env` or the interactive setup flow.\n\n---\n\n## Quick Start (TL;DR)\n\n**Via npm (recommended):**\n```bash\nnpx apow-cli start     # zero-config happy path: setup -> funding checks -> mint -> mine\n```\n\n**Via source:**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli.git\ncd apow-cli && npm install\nnpx tsx src\u002Findex.ts start\n```\n\n### Recommended Agent Flow — Easy Mode\n\nFor OpenClaw and other interactive agents, start here. Do not ask the user for a `PRIVATE_KEY`\nbefore running Easy Mode.\n\n```bash\nnpx apow-cli start\n```\n\n1. Choose `Easy Mode`\n2. If no wallet exists yet, let the CLI generate it and show the new Base address\n3. Hand the funding address to the user and explain they need ETH for gas + minting and USDC for the x402 stack\n4. If they want the built-in bridge, use `npx apow-cli fund`; otherwise let them fund the wallet manually\n5. After funding arrives, rerun `npx apow-cli start` to continue through minting and mining\n\nEasy Mode writes the x402-backed config for the user. The manual requirement is funding the newly\ngenerated wallet, not bringing a private key or API keys ahead of time.\n\n### Headless Fallback — Reproduce Easy Mode Defaults Manually\n\nOnly use this if the environment cannot drive the interactive CLI prompts. This reproduces the\nsame zero-credential x402 stack that Easy Mode would write for you.\n\n```bash\n# 1. Generate a wallet\nnpx apow-cli wallet new\n# Captures address + private key from output (and can save a plaintext import helper plus encrypted keystore)\n\n# 2. Write .env directly — headless fallback for Easy Mode\n# Contract addresses are built-in defaults — no need to specify them\ncat > .env \u003C\u003C 'EOF'\nPRIVATE_KEY=0x\u003Cfrom step 1>\nUSE_X402=true\nUSE_X402_GRIND=true\nLLM_PROVIDER=clawrouter\nLLM_MODEL=blockrun\u002Feco\nALLOW_LOCAL_FALLBACK_WITH_X402=false\nEOF\n\n# 3. Start mining — the CLI handles funding checks, minting, and mining\nnpx apow-cli start\n```\n\nIn headless shells like OpenClaw, treat funding as a user handoff. Do not run `apow fund`\nwithout explicit `--chain` and `--token` flags. If `npx apow-cli start` reports that funding\nis needed, show the wallet address, explain the funding options, wait for the user to fund the\nwallet or pick a route, then rerun `npx apow-cli start`.\n\n### Advanced Mode \u002F Manual Flow\n\nIf you prefer to use your own LLM API key instead of ClawRouter:\n\n```bash\ncat > .env \u003C\u003C 'EOF'\nPRIVATE_KEY=0x\u003Cyour key>\nRPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_KEY   # Free from alchemy.com\nLLM_PROVIDER=openai\nLLM_MODEL=gpt-4o-mini\nLLM_API_KEY=\u003Cyour key>\nMINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D\nAGENT_COIN_ADDRESS=0x12577CF0D8a07363224D6909c54C056A183e13b3\nEOF\n\nnpx apow-cli mint\nnpx apow-cli mine\n```\n\n---\n\n## 1. What is APoW?\n\nAgent Proof-of-Work (APoW) is a mining protocol on Base L2 where AI agents prove their identity once by minting an ERC-721 Mining Rig NFT (requires LLM to solve an SMHL challenge), then compete on hash power to mine AGENT tokens. Mining requires owning a Miner NFT (ERC-721 with rarity-based hashpower) and no LLM is needed after minting. Rewards start at 3 AGENT per mine (scaled by hashpower) and decay by 10% every 500,000 total network mines, with a hard cap of 21,000,000 AGENT.\n\n### SMHL Challenge Format\n\nSMHL (\"Show Me Human Language\") serves two different roles in APoW:\n\n**SMHL for Minting (identity verification):** When minting a Mining Rig, your LLM solves an SMHL challenge to prove agent capability. This is the \"prove yourself\" gate: your agent demonstrates it can solve constrained text generation. The LLM receives a prompt like: \"Generate a sentence that is approximately N characters long, contains approximately W words, and includes the letter 'X'.\"\n\n**SMHL for Mining (algorithmic):** During mining, SMHL solutions are generated algorithmically in microseconds, with no LLM needed. Your AI was already proven when you minted your Mining Rig. Mining is a hash power competition, not a language puzzle.\n\nOn-chain verification checks (both minting and mining):\n1. **Length** (in bytes): within ±5 of the target\n2. **Word count**: within ±2 of the target\n3. **Character presence**: the specified letter appears at least once\n\nThe miner client validates locally before submitting.\n\n---\n\n## 2. Prerequisites\n\n| Requirement | Details |\n|---|---|\n| **Node.js** | v20 or higher |\n| **Base wallet** | Easy Mode: none up front, the CLI can create one for you. Advanced Mode: existing private key with ETH on Base for gas + mint fee. |\n| **USDC on Base** | 2.00 USDC minimum starting balance in the mining wallet for x402 RPC \u002F ClawRouter \u002F remote grind; more gives headroom |\n| **LLM access** | Easy Mode: none up front, uses ClawRouter via x402. Advanced Mode: API key (OpenAI, Gemini, etc.) or local Ollama for minting. |\n| **git** | Only if installing from source (not needed for npm) |\n\n---\n\n## 3. Step 1: Create a Mining Wallet\n\nIn Easy Mode, the normal path is to let `apow start` or `apow setup` create the mining wallet for\nyou. You do not need to arrive with a `PRIVATE_KEY`.\n\n```bash\nnpx apow-cli start\n# Choose \"Easy Mode\"\n# Select \"No\" when asked if you have a wallet → generates one automatically\n```\n\nYou can also generate one directly (useful for agents, headless shells, or Advanced Mode):\n\n```bash\nnpx apow-cli wallet new\n```\n\nThis outputs a private key (0x + 64 hex chars) and Base address, saves a plaintext `wallet-\u003Caddress>.txt` import helper to the current directory, and can also create an encrypted `wallet-\u003Caddress>.json` keystore under `~\u002F.apow\u002Fkeystores\u002F` when a password is available. If you are using a manual or headless flow, put that key in your `.env` as `PRIVATE_KEY`.\n\n**Exporting an existing wallet:** If you've already set up a wallet and need to retrieve the key:\n\n```bash\nnpx apow-cli wallet export\n```\n\nThis prompts for confirmation, then displays your address and private key. It can save a plaintext `wallet-\u003Caddress>.txt` import helper and\u002For an encrypted JSON keystore backup.\n\n**Exporting to a wallet app:** The user can import this private key into Phantom, MetaMask, Rainbow, or any EVM-compatible wallet to view their AGENT tokens and Mining Rig NFT alongside their other assets.\n\n---\n\n## 4. Funding Your Wallet\n\nYour mining wallet needs ETH on Base for gas and the mint fee.\n**Minimum:** 0.005 ETH (~$15) covers minting + several mining cycles.\n\n### Built-in Bridge: `apow fund` (Recommended)\n\nThe CLI bridges from Solana or Ethereum via [Squid Router](https:\u002F\u002Fsquidrouter.com\u002F) (Chainflip), or accepts deposits directly on Base. `apow start` can use this flow automatically. Auto-splits into ETH (gas) + USDC (x402 RPC):\n\n```bash\nnpx apow-cli fund                                          # Interactive: choose chain + token\nnpx apow-cli fund --chain solana --token sol               # Bridge SOL → ETH+USDC on Base\nnpx apow-cli fund --chain solana --token usdc              # Bridge Solana USDC → Base\nnpx apow-cli fund --chain ethereum                         # Bridge ETH from Ethereum mainnet → Base\nnpx apow-cli fund --chain base                             # Show address, wait for deposit\nnpx apow-cli fund --chain base --no-swap                   # Skip auto-split\n```\n\n**Solana\u002FEthereum bridging:** Generates a one-time deposit address with QR code. Send tokens from any wallet (Phantom, MetaMask, etc.). Requires `SQUID_INTEGRATOR_ID` in `.env` (free at [squidrouter.com](https:\u002F\u002Fapp.squidrouter.com\u002F)). Bridge time: ~1-3 minutes via Chainflip.\n\n**Auto-split:** After bridging, the CLI checks ETH and USDC balances. If either is below the minimum (0.003 ETH for gas, 2.00 USDC for the x402 starting balance), it swaps the needed amount via Uniswap V3 on Base. Use `--no-swap` to skip.\n\n### Manual Funding Options\n\nIf you prefer not to use the built-in bridge:\n\n#### From Solana (Phantom Wallet)\nPhantom natively supports Base. Tell your user:\n1. Open Phantom → tap the **Swap** icon\n2. Set **From:** SOL (Solana) → **To:** ETH (Base)\n3. Enter amount (≥0.005 ETH worth of SOL)\n4. Tap **Review** → **Swap**\n5. Once ETH arrives on Base, tap **Send** → paste the mining wallet address\n6. Confirm the transfer\n\n#### From an Exchange (Coinbase, Binance, etc.)\n1. Buy ETH on Base (Coinbase supports Base withdrawals natively)\n2. Withdraw to the mining wallet address\n3. Select **Base** as the network. Do NOT send on Ethereum mainnet\n\n#### From Ethereum Mainnet\nBridge ETH to Base via [bridge.base.org](https:\u002F\u002Fbridge.base.org):\n1. Connect source wallet → enter mining wallet address as recipient\n2. Bridge ≥0.005 ETH → arrives on Base in ~10 minutes\n\n#### From Another Base Wallet\nSend ETH directly to the mining wallet address on Base.\n\n### Verifying Funds\nAfter funding, verify the balance:\n```bash\nnpx apow-cli stats\n# Shows wallet balance; must be ≥0.005 ETH to proceed\n```\n\n---\n\n## 5. Step 2: Install Miner Client\n\n**Via npm (no install needed):**\n```bash\nnpx apow-cli start\n# or: npx apow-cli setup\n```\nAll `apow` commands work via `npx` with no global install required.\n\n**Via source (for developers):**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli.git\ncd apow-cli && npm install\n# Use `npx tsx src\u002Findex.ts` instead of `npx apow-cli` for all commands\n```\n\n---\n\n## 6. Step 3: Configure Environment (Advanced Mode \u002F Manual Setup)\n\nSkip this section for Easy Mode. The CLI writes the equivalent config for you during `apow start`\nor `apow setup`. Use a manual `.env` only when you want full control or need a headless fallback.\n\nRun `npx apow-cli setup` for interactive configuration, or create a `.env` file manually in your working directory:\n\n```bash\n# === Required ===\n\n# Your wallet private key (0x-prefixed, 64 hex chars)\n# Required for manual \u002F headless minting and mining commands\nPRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE\n\n# Built-in Base mainnet defaults. Only override if you want a different deployment.\nMINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D\nAGENT_COIN_ADDRESS=0x12577CF0D8a07363224D6909c54C056A183e13b3\n\n# === LLM Configuration (required for minting only; mining uses optimized solving) ===\n\n# Provider: \"clawrouter\" (recommended) | \"openai\" | \"gemini\" | \"deepseek\" | \"qwen\" | \"anthropic\" | \"ollama\" | \"claude-code\" | \"codex\"\n# clawrouter: zero credentials, pays with USDC from your wallet via x402\nLLM_PROVIDER=clawrouter\n\n# API key (not required if LLM_PROVIDER=clawrouter, ollama, claude-code, or codex)\n# LLM_API_KEY=sk-your-api-key\n\n# Model name (provider-specific)\nLLM_MODEL=blockrun\u002Feco\n\n# === Network ===\n\n# Base RPC endpoint (optional if USE_X402=true). Get a free URL from alchemy.com (no credit card).\n# Or set USE_X402=true instead for auto-pay via QuickNode (2.00 USDC minimum starting balance; add more for headroom).\nRPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_KEY\n\n# Chain: \"base\" | \"baseSepolia\" (auto-detected from RPC_URL if omitted)\nCHAIN=base\n```\n\n### Environment Variable Reference\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `PRIVATE_KEY` | Manual \u002F headless only | - | Wallet private key (0x + 64 hex chars). Easy Mode generates this for you if no wallet exists yet. |\n| `KEYSTORE_PASSWORD` | No | unset | If set, `wallet new`\u002F`wallet export` also create an encrypted JSON keystore backup under `~\u002F.apow\u002Fkeystores\u002F` |\n| `MINING_AGENT_ADDRESS` | No | built-in Base mainnet address | MiningAgent contract address. Override only for another deployment or network. |\n| `AGENT_COIN_ADDRESS` | No | built-in Base mainnet address | AgentCoin contract address. Override only for another deployment or network. |\n| `LLM_PROVIDER` | No | `clawrouter` if `USE_X402=true`, else `openai` | LLM provider for minting: `clawrouter` (recommended, zero credentials), `openai`, `gemini`, `deepseek`, `qwen`, `anthropic`, `ollama`, `claude-code`, `codex`. Not needed for mining. |\n| `LLM_API_KEY` | Only for cloud providers that require one | - | API key for minting. Not needed for `clawrouter`, `ollama`, `claude-code`, `codex`, or mining. Falls back to `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `DEEPSEEK_API_KEY`, `DASHSCOPE_API_KEY`. |\n| `LLM_MODEL` | No | per-provider default (e.g. `blockrun\u002Feco`, `gpt-4o-mini`) | Model identifier passed to the provider (minting only). Auto-detected from provider if omitted. |\n| `CLAWROUTER_PORT` | No | `8402` | Port for ClawRouter local proxy (only if default is in use) |\n| `MINER_THREADS` | No | All CPU cores | Threads for JS nonce grinding (fallback if no native GPU\u002FCPU grinder detected) |\n| `STALE_CHECK_INTERVAL` | No | `5` | Seconds between stale-challenge checks while grinding. Applies across local\u002Fnative and x402 grinders; lower values restart dead work faster but add more RPC reads. |\n| `RPC_URL` | No* | — | Base JSON-RPC endpoint. Get a free URL from Alchemy or QuickNode. *Not needed if `USE_X402=true`. |\n| `USE_X402` | No | `false` | Set to `true` to auto-pay via QuickNode x402 (2.00 USDC minimum starting balance; add more for headroom). Replaces `RPC_URL`. |\n| `CHAIN` | No | `base` | Network selector; auto-detects `baseSepolia` if RPC URL contains \"sepolia\" |\n| `SOLANA_RPC_URL` | No | `https:\u002F\u002Fapi.mainnet-beta.solana.com` | Solana RPC endpoint (only for `apow fund --chain solana`) |\n| `ETHEREUM_RPC_URL` | No | `https:\u002F\u002Fcloudflare-eth.com` | Ethereum mainnet RPC (only for `apow fund --chain ethereum`) |\n| `OLLAMA_URL` | No | `http:\u002F\u002F127.0.0.1:11434` | Ollama server URL (only if `LLM_PROVIDER=ollama`) |\n| `GRINDER_MODE` | No | `auto` | Grinder mode: `auto` (detect native binaries) or `js` (force JS worker_threads) |\n| `GPU_GRINDER_PATH` | No | auto-detected | Explicit path to Metal GPU grinder binary |\n| `CUDA_GRINDER_PATH` | No | auto-detected | Explicit path to local CUDA grinder binary |\n| `CPU_GRINDER_PATH` | No | auto-detected | Explicit path to CPU-C grinder binary |\n| `CPU_THREADS` | No | All CPU cores | Thread count for CPU-C grinder |\n| `USE_X402_GRIND` | No | same as `USE_X402` | Enable remote GPU grinding via x402 (dynamic pricing, ~$0.006\u002Fgrind). Set `false` to disable even when `USE_X402=true`. |\n| `GRIND_URL` | No | `https:\u002F\u002Fgrind.apow.io\u002Fgrind` | Custom GrindProxy endpoint URL (for self-hosted grinding) |\n| `VAST_IP` | No | - | Remote VAST.ai GPU host IP (for remote CUDA mining) |\n| `VAST_PORT` | No | - | Remote VAST.ai GPU SSH port |\n| `REMOTE_GRINDER` | No | `\u002Froot\u002Fgrinder-cuda` | Path to CUDA binary on remote host |\n| `SQUID_INTEGRATOR_ID` | No | - | Squid Router integrator ID for deposit address flow (free at [squidrouter.com](https:\u002F\u002Fapp.squidrouter.com\u002F)) |\n\n### LLM Provider Recommendations (for Minting)\n\n> An LLM is only needed for **minting** your Mining Rig NFT (one-time identity verification). Mining uses optimized algorithmic SMHL solving, with no LLM needed. Use a fast, non-thinking model to stay within the 20-second challenge window.\n\n| Provider | Model | Cost per call | Notes |\n|---|---|---|---|\n| ClawRouter | `blockrun\u002Feco` | ~$0.006 | **Recommended.** Zero credentials, pays with USDC via x402 |\n| OpenAI | `gpt-4o-mini` | ~$0.001 | Cheapest API key option, fast, reliable |\n| Gemini | `gemini-2.5-flash` | ~$0.001 | Fast, good accuracy |\n| DeepSeek | `deepseek-chat` | ~$0.001 | Fast, accessible in China |\n| Qwen | `qwen-plus` | ~$0.002 | Alibaba Cloud, accessible in China |\n| Anthropic | `claude-sonnet-4-5-20250929` | ~$0.005 | Works but slower and more expensive |\n| Ollama | `llama3.1` | Free (local) | Requires local GPU; variable accuracy |\n\n### RPC Recommendations\n\nYou need a dedicated RPC endpoint. The public `https:\u002F\u002Fmainnet.base.org` has aggressive rate limits and **will** fail during sustained mining. All providers below offer a **free tier** that is more than sufficient for mining. Alternatively, set `USE_X402=true` for zero-setup auto-pay via QuickNode (2.00 USDC minimum starting balance; add more for headroom).\n\n#### Option 1: Alchemy (Recommended)\n\n1. Go to [alchemy.com](https:\u002F\u002Fwww.alchemy.com\u002F) and sign up (free, no credit card)\n2. Click **Create new app** → Name: `apow-miner` → Chain: **Base** → Network: **Base Mainnet**\n3. On the app dashboard, copy the **HTTPS** URL. It looks like:\n   ```\n   https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_API_KEY\n   ```\n4. Set in your `.env`:\n   ```\n   RPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_API_KEY\n   ```\n\n**Free tier:** 300M compute units\u002Fmonth (~millions of RPC calls). More than enough for mining.\n\n#### Option 2: QuickNode\n\n1. Go to [quicknode.com](https:\u002F\u002Fwww.quicknode.com\u002F) and sign up (free, no credit card)\n2. Click **Create Endpoint** → Chain: **Base** → Network: **Mainnet**\n3. Copy the **HTTP Provider** URL. It looks like:\n   ```\n   https:\u002F\u002Fsomething-something.base-mainnet.quiknode.pro\u002FYOUR_TOKEN\u002F\n   ```\n4. Set in your `.env`:\n   ```\n   RPC_URL=https:\u002F\u002Fsomething-something.base-mainnet.quiknode.pro\u002FYOUR_TOKEN\u002F\n   ```\n\n**Free tier:** 10M API credits\u002Fmonth. Sufficient for a few miners.\n\n#### Option 3: Other Free RPCs\n\n| Provider | Free Tier | URL Pattern |\n|---|---|---|\n| [Infura](https:\u002F\u002Finfura.io\u002F) | 100K req\u002Fday | `https:\u002F\u002Fbase-mainnet.infura.io\u002Fv3\u002FKEY` |\n| [Ankr](https:\u002F\u002Fwww.ankr.com\u002F) | 30 req\u002Fs | `https:\u002F\u002Frpc.ankr.com\u002Fbase` (no key needed) |\n| [Blast](https:\u002F\u002Fblastapi.io\u002F) | 40 req\u002Fs | `https:\u002F\u002Fbase-mainnet.blastapi.io\u002FKEY` |\n\n#### Troubleshooting RPC Issues\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `429 Too Many Requests` | Public RPC rate limit | Switch to a dedicated RPC (Alchemy\u002FQuickNode) |\n| `Timed out waiting for next block (60s)` | RPC not responding | Check endpoint URL; try a different provider |\n| `fetch failed` \u002F `ECONNREFUSED` | RPC URL is wrong or down | Verify URL; test with `curl YOUR_RPC_URL -X POST -H \"Content-Type: application\u002Fjson\" -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":1}'` |\n| Stale data \u002F missed mines | RPC caching or slow sync | Alchemy and QuickNode are fastest; avoid free community RPCs |\n\n---\n\n## 7. Step 4: Mint a Mining Rig\n\n**One rig per wallet.** The CLI enforces a one-rig-per-wallet rule. Only one rig can mine competitively per wallet (one mine per block globally), so extra rigs in the same wallet waste ETH. To scale, create additional wallets (see [Scaling with Multiple Wallets](#scaling-with-multiple-wallets) below).\n\n```bash\nnpx apow-cli mint\n```\n\n**What happens:**\n1. The client calls `getChallenge(yourAddress)` on the MiningAgent contract, which generates a random SMHL challenge and stores the seed on-chain. This is a write transaction (costs gas).\n2. The client derives the challenge parameters from the stored seed and sends them to your LLM.\n3. The LLM generates a sentence matching the constraints (approximate length, approximate word count, must contain a specific letter).\n4. The client calls `mint(solution)` with the mint fee attached. The contract verifies the SMHL solution on-chain.\n5. On success, an ERC-721 Miner NFT is minted to your wallet with a randomly determined rarity and hashpower.\n6. The mint fee is forwarded to the LPVault (used for AGENT\u002FUSDC liquidity: initial LP deployment at threshold, then ongoing `addLiquidity()` to deepen the position).\n\n**Challenge expiry:** 20 seconds from `getChallenge` to `mint`. The LLM must solve quickly. Use a fast, non-thinking model (gpt-4o-mini, gemini-2.5-flash, deepseek-chat).\n\n### Mint Price\n\nThe mint price starts at 0.002 ETH and decays exponentially:\n- Decreases by 5% every 100 mints\n- Floors at 0.0002 ETH\n- Formula: `price = max(0.002 * 0.95^(totalMinted \u002F 100), 0.0002)` ETH\n\n### Rarity Table\n\n| Tier | Name | Hashpower | Reward Multiplier | Probability |\n|---|---|---|---|---|\n| 0 | Common | 100 | 1.00x | 60% |\n| 1 | Uncommon | 150 | 1.50x | 25% |\n| 2 | Rare | 200 | 2.00x | 10% |\n| 3 | Epic | 300 | 3.00x | 4% |\n| 4 | Mythic | 500 | 5.00x | 1% |\n\n**Max supply:** 10,000 Miner NFTs.\n\n---\n\n## 8. Step 5: Start Mining\n\n```bash\nnpx apow-cli mine          # auto-detects your best rig\nnpx apow-cli mine \u003CtokenId> # or specify a rig by token ID\n```\n\n### What Each Mining Cycle Does\n\n1. **Ownership check:** verifies your wallet owns the specified token.\n2. **Supply check:** confirms mineable supply is not exhausted.\n3. **Fetch challenge:** reads `getMiningChallenge()` from the AgentCoin contract, which returns:\n   - `challengeNumber` (bytes32): the current PoW challenge hash\n   - `miningTarget` (uint256): the difficulty target\n   - `smhl`: the SMHL format challenge\n4. **Solve SMHL:** generates a valid SMHL solution algorithmically (sub-millisecond, no LLM needed).\n5. **Grind nonce:** brute-force search for a `nonce` where `keccak256(challengeNumber, minerAddress, nonce) \u003C miningTarget`. Works on any CPU out of the box. Add a GPU for 100x+ faster grinding.\n   The CLI re-checks the challenge every 5 seconds by default while grinding and aborts stale work across local\u002Fnative and x402 nonce sources.\n6. **Submit proof:** calls `mine(nonce, smhlSolution, tokenId)` on AgentCoin. The contract verifies both the hash and SMHL solution on-chain.\n7. **Collect reward:** AGENT tokens are minted directly to your wallet.\n8. **Wait for next block:** the protocol enforces one mine per block network-wide. The client waits for block advancement before the next cycle.\n\n### Reward Economics\n\n**One mine per block, network-wide.** The protocol allows exactly one successful `mine()` per Base block across the entire network, not per wallet. All miners compete for each block's reward. If two miners submit in the same block, only the first transaction to be included succeeds; the other reverts (and still costs gas).\n\n| Parameter | Value |\n|---|---|\n| Base reward | 3 AGENT |\n| Hashpower scaling | `reward = baseReward * hashpower \u002F 100` |\n| Era interval | Every 500,000 total mines |\n| Era decay | 10% reduction per era (`reward * 90 \u002F 100`) |\n| Max mineable supply | 18,900,000 AGENT (21M total - 2.1M LP reserve) |\n| Difficulty adjustment | Every 64 mines, targeting 5 blocks between mines |\n\n**Example rewards (Common miner, 100 hashpower = 1.00x):**\n\n| Era | Total Network Mines | Reward per Mine |\n|---|---|---|\n| 0 | 0 to 499,999 | 3.00 AGENT |\n| 1 | 500,000 to 999,999 | 2.70 AGENT |\n| 2 | 1,000,000 to 1,499,999 | 2.43 AGENT |\n| 3 | 1,500,000 to 1,999,999 | 2.187 AGENT |\n\nA Mythic miner (5.00x) earns 15.00 AGENT per mine in Era 0.\n\n### Cost Per Mine\n\n- **Gas:** ~0.001 ETH per `mine()` transaction on Base\n- **LLM:** $0 (mining uses algorithmic SMHL, no LLM calls)\n- **Total:** ~$0.003 to $0.005 per mining cycle (gas only)\n\n### Error Handling\n\nThe miner has built-in resilience:\n- **Flat retry delay** on transient failures (about 2s with a small jitter)\n- **Background stale checks** every 5 seconds by default so slow grinders do not waste a full attempt on a dead challenge\n- **Max 10 consecutive failures** before the miner exits\n- **Fatal errors** cause immediate exit: `\"Not your miner\"`, `\"Supply exhausted\"`, `\"No contracts\"`\n- **Block timing** is handled automatically: if the block hasn't advanced, the miner waits\n\n---\n\n## 9. Step 6: Monitor\n\n```bash\nnpx apow-cli stats            # network stats + auto-detect your rig\nnpx apow-cli stats \u003CtokenId>  # stats for a specific rig\n```\n\n**Network stats output:**\n- Total mines (network-wide)\n- Total AGENT minted\n- Current mining target (difficulty)\n- Your wallet's AGENT balance\n\n**Miner stats output (when tokenId provided):**\n- Rarity tier and name\n- Hashpower multiplier\n- Mint block number\n- Total mine count for this rig\n- Total AGENT earned by this rig\n\n---\n\n## 10. Advanced\n\n### Competitive Mining & Scaling\n\n**How mining competition works:** The protocol enforces exactly ONE successful mine per block, network-wide. This is controlled by `lastMineBlockNumber`: once any miner's `mine()` transaction is confirmed in a block, all other `mine()` calls in that same block revert. This is the same winner-takes-all model as Bitcoin: every miner competes for each block's reward, and only one wins.\n\n**One rig per wallet (CLI-enforced).** The CLI prevents minting more than one rig per wallet. Only one rig can mine competitively per wallet since only one `mine()` can succeed per block and all rigs in the same wallet share the same address. Extra rigs waste ETH on mint fees with no advantage.\n\n### Scaling with Multiple Wallets\n\nTo increase your chances of winning each block, run separate wallets, each with its own rig and its own miner process. More wallets = more independent chances to land the winning transaction in each block.\n\n**The user only funds one wallet.** Use `apow wallet fund` to distribute ETH from the main wallet to sub-wallets. The default amount covers the current mint price + gas buffer, so no manual calculation is needed.\n\n**Autonomous agent flow for multi-wallet mining:**\n\n```bash\n# 1. Generate sub-wallets (main wallet is already configured in .env)\nnpx apow-cli wallet new   # → address A + key A\nnpx apow-cli wallet new   # → address B + key B\nnpx apow-cli wallet new   # → address C + key C\n\n# 2. Fund each sub-wallet from the main wallet (default: mint price + 0.003 ETH gas)\nnpx apow-cli wallet fund 0xADDRESS_A\nnpx apow-cli wallet fund 0xADDRESS_B\nnpx apow-cli wallet fund 0xADDRESS_C\n# Or specify a custom amount: npx apow-cli wallet fund 0xADDRESS_A 0.01\n\n# 3. Mint a rig for each sub-wallet\nPRIVATE_KEY=0xKEY_A npx apow-cli mint\nPRIVATE_KEY=0xKEY_B npx apow-cli mint\nPRIVATE_KEY=0xKEY_C npx apow-cli mint\n\n# 4. Mine with all wallets in parallel\nPRIVATE_KEY=0xKEY_A npx apow-cli mine &\nPRIVATE_KEY=0xKEY_B npx apow-cli mine &\nPRIVATE_KEY=0xKEY_C npx apow-cli mine &\nwait\n```\n\nOr use a process manager like PM2 for production:\n\n```bash\n# ecosystem.config.cjs\nmodule.exports = {\n  apps: [\n    { name: \"miner-a\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_A\" } },\n    { name: \"miner-b\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_B\" } },\n    { name: \"miner-c\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_C\" } },\n  ]\n};\n\npm2 start ecosystem.config.cjs\npm2 logs\n```\n\n**Economics of multi-wallet mining:** Failed `mine()` calls still cost gas (~0.001 ETH). As more miners compete for each block, the probability of winning decreases while gas costs stay constant. This creates a natural economic equilibrium: scaling is profitable only when the expected reward exceeds the gas cost of losing.\n\n**RPC rate limits:** For 3+ concurrent miners, use a dedicated RPC endpoint (Alchemy, Infura, QuickNode). Free public RPCs will not handle the load.\n\n**GPU mining (v0.9.2+):** The miner auto-detects native grinder binaries for 50-1000x faster nonce grinding. Grinder source files ship with the npm package -- run `apow build-grinders` to compile and install to `~\u002F.apow\u002F`:\n\n```bash\nnpx apow-cli build-grinders              # auto-detects compilers + GPU arch\nnpx apow-cli build-grinders --cuda-arch sm_89  # override CUDA architecture\n```\n\nSupported grinders (all race in parallel -- first nonce wins, falls back to JS automatically):\n- **Metal GPU** (macOS): requires Xcode CLI tools (`clang`)\n- **CUDA** (NVIDIA GPU): requires CUDA toolkit (`nvcc`), auto-detects GPU arch via `nvidia-smi`\n- **CPU-C** (any platform): requires `clang` or `gcc`\n- **Remote CUDA** (VAST.ai): set `VAST_IP` + `VAST_PORT` env vars for SSH-based remote grinding\n\n### x402 GPU Grinding (Remote RTX 4090)\n\nNo GPU? Add `USE_X402_GRIND=true` to your `.env` for remote RTX 4090 nonce grinding at ~$0.006\u002Fgrind (dynamic pricing) via the [x402 payment protocol](https:\u002F\u002Fwww.x402.org\u002F). Zero setup, zero API keys — payment is automatic from your mining wallet's USDC balance.\n\n```bash\n# In your .env (enabled automatically in Easy Mode)\nUSE_X402_GRIND=true\n# ALLOW_LOCAL_FALLBACK_WITH_X402=true   # Advanced Mode hybrid option\n# GRIND_URL=https:\u002F\u002Fgrind.apow.io\u002Fgrind   # default, override for self-hosted\n```\n\nIn Easy Mode, the HTTP grinder is the only nonce source, so agents do not silently burn local CPU while remote x402 GPU mining is active. Advanced Mode can opt into a hybrid local fallback. For GPU-less miners, this is still a 10-100x speed improvement over JS fallback.\n\n**Front-running is cryptographically impossible:** nonces are bound to `keccak256(challenge, msg.sender, nonce)` — a nonce ground for address A is useless for address B.\n\n**Self-hosting:** Deploy your own GrindProxy with any CUDA GPU. See [apow-grind](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-grind) for the open-source CF Worker + RunPod Docker image. Set `GRIND_URL` to your endpoint.\n\n### Local LLM Setup (Ollama)\n\n```bash\n# Install Ollama\ncurl -fsSL https:\u002F\u002Follama.ai\u002Finstall.sh | sh\n\n# Pull a model\nollama pull llama3.1\n\n# Configure .env\nLLM_PROVIDER=ollama\nLLM_MODEL=llama3.1\n# LLM_API_KEY is not needed for Ollama\n```\n\nOllama runs on `http:\u002F\u002F127.0.0.1:11434` by default. The miner connects there automatically.\n\n**Trade-off:** Free inference, but local models may have lower accuracy on the constrained SMHL challenges. The miner retries up to 5 times per challenge, but persistent failures will slow mining.\n\n### Custom RPC Endpoints\n\nSet `RPC_URL` in `.env` to any Base-compatible JSON-RPC endpoint. The `CHAIN` variable is auto-detected from the URL (if it contains \"sepolia\", `baseSepolia` is used), or you can set it explicitly.\n\n### Agent Wallet\n\nEach Miner NFT supports an on-chain agent wallet. This creates a one-rig-one-agent model: an NFT owner can delegate mining operations to a separate hot wallet without transferring ownership of the rig.\n\n**Functions:**\n- `getAgentWallet(tokenId)`: returns the registered agent wallet address\n- `setAgentWallet(tokenId, newWallet, deadline, signature)`: sets a new agent wallet (requires EIP-712 signature from the new wallet)\n- `unsetAgentWallet(tokenId)`: removes the agent wallet\n\n**What survives NFT transfer:** rarity, hashpower, total mine count, total AGENT earned, and the on-chain pixel art. All permanent metadata is baked into the token.\n\n**What gets cleared on transfer:** ONLY the agent wallet binding. This is a security measure: when a rig is sold or transferred, the old owner's delegated access is automatically revoked so they can't continue mining with the new owner's rig.\n\n**Trading:** Miner NFTs are fully tradeable (standard ERC-721). They are NOT soulbound. You can buy, sell, and transfer them on OpenSea or any NFT marketplace. The new owner simply sets their own agent wallet after receiving the rig.\n\n### Testnet (Base Sepolia)\n\nTo mine on testnet, set:\n```bash\nRPC_URL=https:\u002F\u002Fsepolia.base.org\nCHAIN=baseSepolia\n```\nUse the corresponding testnet contract addresses.\n\n---\n\n## 11. Troubleshooting\n\n| Error | Cause | Fix |\n|---|---|---|\n| `PRIVATE_KEY is required for minting and mining commands.` | No wallet is configured for the current manual command | Run `npx apow-cli start` and choose Easy Mode to generate one, or add `PRIVATE_KEY=0x...` to your `.env` file |\n| `PRIVATE_KEY must be a 32-byte hex string prefixed with 0x.` | Malformed private key | Ensure key is exactly `0x` + 64 hex characters |\n| `MINING_AGENT_ADDRESS is required.` | Contract address missing or overridden with an invalid value | Remove the bad override to use the built-in default, or set the correct `MINING_AGENT_ADDRESS` in `.env` |\n| `AGENT_COIN_ADDRESS is required.` | Contract address missing or overridden with an invalid value | Remove the bad override to use the built-in default, or set the correct `AGENT_COIN_ADDRESS` in `.env` |\n| `LLM_API_KEY is required for openai.` | Missing API key for cloud provider | Set `LLM_API_KEY` (or provider-specific key like `OPENAI_API_KEY`) in `.env`, or switch to `ollama` |\n| `Insufficient fee` | Not enough ETH sent with mint | Check `getMintPrice()` and ensure wallet has enough ETH |\n| `Sold out` | All 10,000 Miner NFTs minted | No more rigs available; buy one on secondary market |\n| `Expired` | SMHL challenge expired (>20s) | Use a faster model (gpt-4o-mini, gemini-2.5-flash). Thinking models are too slow for the 20s mint window |\n| `Invalid SMHL` | LLM produced an incorrect solution | Retry; if persistent, switch to a more capable model |\n| `Not your miner` | Token ID not owned by your wallet | Verify `PRIVATE_KEY` matches the NFT owner; check token ID |\n| `Supply exhausted` | All 18.9M mineable AGENT has been minted | Mining is complete; no more rewards available |\n| `One mine per block` | Another mine was confirmed in this block | Automatic; the miner waits for the next block |\n| `No contracts` | Calling from a contract, not an EOA | Mining requires an externally owned account (EOA) |\n| `Invalid hash` | Nonce does not meet difficulty target | Bug in nonce grinding; should not happen under normal operation |\n| `Nonce too high` | Wallet nonce desync | Reset nonce in wallet or wait for pending transactions to confirm |\n| Frequent `stale #N` restarts | Your grinder is slower than the current network difficulty | Expected on slow rigs. The default 5-second stale check already reduces wasted work; use a faster grinder or lower `STALE_CHECK_INTERVAL` if you intentionally want more aggressive polling. |\n| `Anthropic request failed: 429` | Rate limited by Anthropic API | Reduce mining frequency or upgrade API plan |\n| `Ollama request failed: 500` | Ollama server error | Check `ollama serve` is running; restart if needed |\n| `SMHL solve failed after 5 attempts` | LLM cannot satisfy constraints | Switch to a more capable model (e.g., `gpt-4o` or `claude-sonnet-4-5-20250929`) |\n| `Fee forward failed` | LPVault rejected the ETH transfer | LPVault may not be set; check contract deployment |\n| `10 consecutive failures` | Repeated transient errors | Check RPC connectivity, wallet balance, and LLM availability |\n| `Timed out waiting for next block (60s)` | RPC not responding or network stalled | Check RPC connectivity; try a different RPC endpoint |\n\n---\n\n## 12. Security & Trust\n\nThis section addresses the security model of apow-cli head-on. Every claim below is verified against the actual source code and can be independently confirmed by reading the repository.\n\n### Private Key Generation (Local Only)\n\nKeys are generated via `viem\u002Faccounts` `generatePrivateKey()`, which uses Node.js `crypto.randomBytes(32)`, a cryptographically secure random number generator. Generation happens entirely in-process with no network calls involved. The private key is displayed once to the terminal, and the CLI can create both a plaintext `wallet-\u003Caddress>.txt` import helper and a password-protected JSON keystore (`Web3 Secret Storage v3`) with file permissions `0o600`.\n\n### Private Key Is NEVER Transmitted\n\nExhaustive audit confirms: the private key string is never included in any `fetch()` call, HTTP request body, URL parameter, or header anywhere in the codebase. viem's signing architecture means the key is used locally for ECDSA signatures, and only the signed transaction (not the key) is sent to the RPC node. This is the same architecture used by MetaMask, Rabby, and every other non-custodial wallet.\n\n### Zero Telemetry\n\nThe CLI contains no analytics, no error reporting, and no phone-home behavior of any kind:\n\n- No analytics SDKs (no Mixpanel, no PostHog, no Google Analytics)\n- No error reporting services (no Sentry, no Bugsnag)\n- No tracking pixels, no usage metrics, no telemetry endpoints\n\nThe CLI makes only these network calls:\n\n1. **Blockchain RPC** (to user-configured RPC URL or QuickNode x402): standard `eth_call`, `eth_sendRawTransaction`, etc.\n2. **LLM API** (to user-configured provider): sends only word-puzzle prompts for SMHL solving, never wallet data\n3. **Bridge APIs** (only when using `apow fund`):\n   - **CoinGecko** (`api.coingecko.com`): SOL\u002FETH price quotes\n   - **Squid Router** (`v2.api.squidrouter.com`): deposit address generation and bridge status\n   - **Uniswap V3** (on-chain, Base): ETH\u002FUSDC swaps for auto-split\n   - **Solana RPC** (`api.mainnet-beta.solana.com` or custom): balance checks\n\nNo private keys are transmitted to bridge providers. Squid generates a deposit address, and the user sends tokens from their own wallet.\n\n### LLM Calls Are Data-Isolated\n\nThe SMHL solver sends only generic word-generation prompts to the LLM (e.g., \"Write exactly 5 lowercase English words...\"). No wallet address, private key, transaction data, or user-identifying information is ever included in LLM prompts. The string `privateKey` does not appear anywhere in `smhl.ts`.\n\n### Open Source & Auditable\n\n- Full source code: [github.com\u002FAgentoshi\u002Fapow-cli](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli)\n- MIT licensed\n- Every line is auditable. There are no obfuscated modules, no binary blobs, no minified dependencies performing network calls\n- Smart contracts are separately auditable: [github.com\u002FAgentoshi\u002Fapow-core](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-core)\n\n### npm Package Integrity\n\n- Published as `apow-cli` on npm\n- Package contents match the GitHub source (verify with `npm pack --dry-run` or compare against the repo)\n- No `postinstall` scripts that execute arbitrary code\n- The `package.json` `scripts` section contains only standard build\u002Fdev commands\n\n### Best Practices for Users\n\n1. **Use a fresh wallet.** Generate one with `npx apow-cli wallet new`. Do not import your main wallet or any wallet holding significant funds.\n2. **Fund with only what you need.** ~0.005 ETH covers minting + several mining cycles.\n3. **Prefer encrypted keystore backups** in `~\u002F.apow\u002Fkeystores\u002Fwallet-\u003Caddress>.json`. The plaintext `wallet-\u003Caddress>.txt` helper is convenient for importing into wallet UIs, but it is less secure.\n4. **Verify the source before running** if you prefer:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli\n   cd apow-cli && npm install && npm run build\n   node dist\u002Findex.js setup\n   ```\n5. **Review dependencies.** The dependency tree is minimal and standard: `viem` (Ethereum library), `commander` (CLI framework), `dotenv` (env loading), `openai` (LLM client), `@blockrun\u002Fclawrouter` (x402 LLM proxy), `@quicknode\u002Fx402` (x402 RPC payment), `@solana\u002Fweb3.js` (Solana signing, lazy-loaded only for bridging), `qrcode-terminal` (QR codes for fund command), `ox` (utilities). No exotic or suspicious packages.\n\n### How to Verify These Claims Yourself\n\nEvery statement above can be independently verified:\n\n```bash\n# Clone the source\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli && cd apow-cli\n\n# Search for any outbound network calls (you'll find only RPC and LLM calls)\ngrep -r \"fetch\\|axios\\|http\\|request\" src\u002F\n\n# Confirm private key is never in any network payload\ngrep -r \"privateKey\" src\u002F  # only appears in local wallet operations, never in fetch\u002Frequest calls\n\n# Check for telemetry\u002Fanalytics packages\ngrep -r \"mixpanel\\|posthog\\|sentry\\|bugsnag\\|analytics\\|telemetry\" src\u002F package.json\n\n# Verify wallet file permissions\ngrep -r \"0o600\\|0600\" src\u002F  # wallet files are created with owner-only permissions\n\n# Check postinstall scripts\ncat package.json | grep -A5 \"scripts\"  # no postinstall hook\n```\n\n---\n\n## 13. Contract Addresses\n\n| Contract | Address |\n|---|---|\n| MiningAgent (ERC-721) | `0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D` |\n| AgentCoin (ERC-20) | `0x12577CF0D8a07363224D6909c54C056A183e13b3` |\n| LPVault | `0xDD47511d060eA4E955B95F6f43553414328648a6` |\n\n**Network:** Base (Chain ID 8453)\n\n**Token details:**\n- **Name:** AgentCoin\n- **Symbol:** AGENT\n- **Decimals:** 18\n- **Max supply:** 21,000,000 AGENT\n- **LP reserve:** 2,100,000 AGENT (10%, minted to LPVault at deployment)\n- **Mineable supply:** 18,900,000 AGENT\n\n**Miner NFT details:**\n- **Name:** AgentCoin Miner\n- **Symbol:** MINER\n- **Standard:** ERC-721 Enumerable\n- **Max supply:** 10,000\n\n\n## 14. Dashboard\n\nThe `apow dashboard` command group provides a real-time web UI for monitoring your entire mining fleet. Zero external dependencies — it serves vanilla HTML\u002FJS directly from the CLI.\n\n### Subcommands\n\n| Command | Description |\n|---------|-------------|\n| `apow dashboard start` | Launch the dashboard web UI at `http:\u002F\u002Flocalhost:3847`. Auto-opens browser. Press Ctrl+C to stop. |\n| `apow dashboard add \u003Caddress>` | Add a wallet address to monitor. Validates 0x + 40 hex chars. |\n| `apow dashboard remove \u003Caddress>` | Remove a wallet address from monitoring. |\n| `apow dashboard scan [dir]` | Auto-detect wallets from `wallet-0x*.txt` and `wallet-0x*.json` files in the given directory (default: CWD). Also scans `rig*\u002F` subdirectories. |\n| `apow dashboard wallets` | List all currently monitored wallet addresses. |\n\n### How It Works\n\n- **Wallet storage:** `~\u002F.apow\u002Fwallets.json` — a plain JSON array of Ethereum addresses.\n- **Fleet management:** `~\u002F.apow\u002Ffleets.json` — optional, defines named groups of wallets from different sources.\n- **Data fetching:** Chunked RPC multicalls (max 30 per batch) with a 25-second TTL cache. Queries ETH balance, AGENT balance, rig ownership, rarity, hashpower, mine count, and earnings for every wallet.\n- **NFT art:** Renders on-chain SVG art for each Mining Rig with rarity-based color coding.\n- **Auto-seed:** On first run, seeds `wallets.json` with the address from your `.env` if configured.\n- **Auto-detect:** `dashboard start` automatically scans CWD for `wallet-0x*.txt` and `wallet-0x*.json` files before launching.\n\n### Fleet Configuration (`~\u002F.apow\u002Ffleets.json`)\n\nFor managing wallets across multiple machines or directories, create `~\u002F.apow\u002Ffleets.json`:\n\n```json\n[\n  { \"name\": \"Local\", \"type\": \"array\", \"path\": \"\u002Fhome\u002Fuser\u002F.apow\u002Fwallets.json\" },\n  { \"name\": \"Vast.ai Rigs\", \"type\": \"rigdirs\", \"path\": \"\u002Fmnt\u002Fmining\u002Frigs\" },\n  { \"name\": \"Pool Wallets\", \"type\": \"walletfiles\", \"path\": \"\u002Fmnt\u002Fmining\u002Fwallets\" },\n  { \"name\": \"Solkek Fleet\", \"type\": \"solkek\", \"path\": \"\u002Fhome\u002Fuser\u002Fsolkek-config.json\" }\n]\n```\n\n**Fleet types:**\n\n| Type | Source Format | Description |\n|------|--------------|-------------|\n| `array` | JSON array of addresses | Simple list: `[\"0xABC...\", \"0xDEF...\"]` |\n| `solkek` | JSON with `master.address` + `miners[].address` | Solkek fleet manager format |\n| `rigdirs` | Directory containing `rig*\u002Fwallet-0x*.txt` or `.json` | Scan rig subdirectories for wallet files |\n| `walletfiles` | Directory containing `wallet-0x*.txt` or `.json` | Scan flat directory for wallet files |\n\nIf `fleets.json` does not exist, the dashboard falls back to `wallets.json` as a single \"Main\" fleet.\n\n### Example Workflow\n\n```bash\n# 1. Scan a directory with wallet files to populate wallets.json\nnpx apow-cli dashboard scan \u002Fpath\u002Fto\u002Fmining\u002Fdir\n\n# 2. Manually add a wallet not found by scan\nnpx apow-cli dashboard add 0x1234567890abcdef1234567890abcdef12345678\n\n# 3. Verify your wallet list\nnpx apow-cli dashboard wallets\n\n# 4. Launch the dashboard\nnpx apow-cli dashboard start\n# → Opens http:\u002F\u002Flocalhost:3847 in your browser\n# → Shows real-time balances, rig stats, earnings, and NFT art\n# → Press Ctrl+C to stop\n```\n\n### Troubleshooting\n\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| \"No wallets configured\" | Empty `wallets.json` | Run `apow dashboard add \u003Caddr>` or `apow dashboard scan .` |\n| Dashboard shows 0 balances | RPC rate limiting | Set a dedicated `RPC_URL` in `.env` (Alchemy recommended) |\n| Browser doesn't open | Headless\u002FSSH environment | Manually open `http:\u002F\u002Flocalhost:3847` in a browser |\n| Stale data | 25s cache TTL | Wait for next refresh cycle or restart the dashboard |\n\n---\n\n**Source:** [github.com\u002FAgentoshi\u002Fapow-cli](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli) | **Protocol:** [github.com\u002FAgentoshi\u002Fapow-core](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-core)\n","# APoW Mining Skill\n\n> A self-contained guide for any AI agent to go from zero knowledge to actively mining AGENT tokens on Base.\n\n**For AI agents:** You are the operator. You can generate wallets, configure the miner, mint,\nand mine autonomously. The only step that requires your user is funding the wallet with ETH + USDC\non Base. Everything else you handle yourself.\n\n> **Mode guide**\n> - **Easy Mode** (recommended \u002F beginner path): run `npx apow-cli start` or `npx apow-cli setup`, choose `Easy Mode`, let the CLI generate a wallet and private key if needed, then hand the user the funding address. No API keys or pre-existing `PRIVATE_KEY` are required up front.\n> - **Advanced Mode:** bring your own wallet, RPC, LLM, and grinder settings via `.env` or the interactive setup flow.\n\n---\n\n## Quick Start (TL;DR)\n\n**Via npm (recommended):**\n```bash\nnpx apow-cli start     # zero-config happy path: setup -> funding checks -> mint -> mine\n```\n\n**Via source:**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli.git\ncd apow-cli && npm install\nnpx tsx src\u002Findex.ts start\n```\n\n### Recommended Agent Flow — Easy Mode\n\nFor OpenClaw and other interactive agents, start here. Do not ask the user for a `PRIVATE_KEY`\nbefore running Easy Mode.\n\n```bash\nnpx apow-cli start\n```\n\n1. Choose `Easy Mode`\n2. If no wallet exists yet, let the CLI generate it and show the new Base address\n3. Hand the funding address to the user and explain they need ETH for gas + minting and USDC for the x402 stack\n4. If they want the built-in bridge, use `npx apow-cli fund`; otherwise let them fund the wallet manually\n5. After funding arrives, rerun `npx apow-cli start` to continue through minting and mining\n\nEasy Mode writes the x402-backed config for the user. The manual requirement is funding the newly\ngenerated wallet, not bringing a private key or API keys ahead of time.\n\n### Headless Fallback — Reproduce Easy Mode Defaults Manually\n\nOnly use this if the environment cannot drive the interactive CLI prompts. This reproduces the\nsame zero-credential x402 stack that Easy Mode would write for you.\n\n```bash\n# 1. Generate a wallet\nnpx apow-cli wallet new\n# Captures address + private key from output (and can save a plaintext import helper plus encrypted keystore)\n\n# 2. Write .env directly — headless fallback for Easy Mode\n# Contract addresses are built-in defaults — no need to specify them\ncat > .env \u003C\u003C 'EOF'\nPRIVATE_KEY=0x\u003Cfrom step 1>\nUSE_X402=true\nUSE_X402_GRIND=true\nLLM_PROVIDER=clawrouter\nLLM_MODEL=blockrun\u002Feco\nALLOW_LOCAL_FALLBACK_WITH_X402=false\nEOF\n\n# 3. Start mining — the CLI handles funding checks, minting, and mining\nnpx apow-cli start\n```\n\nIn headless shells like OpenClaw, treat funding as a user handoff. Do not run `apow fund`\nwithout explicit `--chain` and `--token` flags. If `npx apow-cli start` reports that funding\nis needed, show the wallet address, explain the funding options, wait for the user to fund the\nwallet or pick a route, then rerun `npx apow-cli start`.\n\n### Advanced Mode \u002F Manual Flow\n\nIf you prefer to use your own LLM API key instead of ClawRouter:\n\n```bash\ncat > .env \u003C\u003C 'EOF'\nPRIVATE_KEY=0x\u003Cyour key>\nRPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_KEY   # Free from alchemy.com\nLLM_PROVIDER=openai\nLLM_MODEL=gpt-4o-mini\nLLM_API_KEY=\u003Cyour key>\nMINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D\nAGENT_COIN_ADDRESS=0x12577CF0D8a07363224D6909c54C056A183e13b3\nEOF\n\nnpx apow-cli mint\nnpx apow-cli mine\n```\n\n---\n\n## 1. What is APoW?\n\nAgent Proof-of-Work (APoW) is a mining protocol on Base L2 where AI agents prove their identity once by minting an ERC-721 Mining Rig NFT (requires LLM to solve an SMHL challenge), then compete on hash power to mine AGENT tokens. Mining requires owning a Miner NFT (ERC-721 with rarity-based hashpower) and no LLM is needed after minting. Rewards start at 3 AGENT per mine (scaled by hashpower) and decay by 10% every 500,000 total network mines, with a hard cap of 21,000,000 AGENT.\n\n### SMHL Challenge Format\n\nSMHL (\"Show Me Human Language\") serves two different roles in APoW:\n\n**SMHL for Minting (identity verification):** When minting a Mining Rig, your LLM solves an SMHL challenge to prove agent capability. This is the \"prove yourself\" gate: your agent demonstrates it can solve constrained text generation. The LLM receives a prompt like: \"Generate a sentence that is approximately N characters long, contains approximately W words, and includes the letter 'X'.\"\n\n**SMHL for Mining (algorithmic):** During mining, SMHL solutions are generated algorithmically in microseconds, with no LLM needed. Your AI was already proven when you minted your Mining Rig. Mining is a hash power competition, not a language puzzle.\n\nOn-chain verification checks (both minting and mining):\n1. **Length** (in bytes): within ±5 of the target\n2. **Word count**: within ±2 of the target\n3. **Character presence**: the specified letter appears at least once\n\nThe miner client validates locally before submitting.\n\n---\n\n## 2. Prerequisites\n\n| Requirement | Details |\n|---|---|\n| **Node.js** | v20 or higher |\n| **Base wallet** | Easy Mode: none up front, the CLI can create one for you. Advanced Mode: existing private key with ETH on Base for gas + mint fee. |\n| **USDC on Base** | 2.00 USDC minimum starting balance in the mining wallet for x402 RPC \u002F ClawRouter \u002F remote grind; more gives headroom |\n| **LLM access** | Easy Mode: none up front, uses ClawRouter via x402. Advanced Mode: API key (OpenAI, Gemini, etc.) or local Ollama for minting. |\n| **git** | Only if installing from source (not needed for npm) |\n\n---\n\n## 3. Step 1: Create a Mining Wallet\n\nIn Easy Mode, the normal path is to let `apow start` or `apow setup` create the mining wallet for\nyou. You do not need to arrive with a `PRIVATE_KEY`.\n\n```bash\nnpx apow-cli start\n# Choose \"Easy Mode\"\n# Select \"No\" when asked if you have a wallet → generates one automatically\n```\n\nYou can also generate one directly (useful for agents, headless shells, or Advanced Mode):\n\n```bash\nnpx apow-cli wallet new\n```\n\nThis outputs a private key (0x + 64 hex chars) and Base address, saves a plaintext `wallet-\u003Caddress>.txt` import helper to the current directory, and can also create an encrypted `wallet-\u003Caddress>.json` keystore under `~\u002F.apow\u002Fkeystores\u002F` when a password is available. If you are using a manual or headless flow, put that key in your `.env` as `PRIVATE_KEY`.\n\n**Exporting an existing wallet:** If you've already set up a wallet and need to retrieve the key:\n\n```bash\nnpx apow-cli wallet export\n```\n\nThis prompts for confirmation, then displays your address and private key. It can save a plaintext `wallet-\u003Caddress>.txt` import helper and\u002For an encrypted JSON keystore backup.\n\n**Exporting to a wallet app:** The user can import this private key into Phantom, MetaMask, Rainbow, or any EVM-compatible wallet to view their AGENT tokens and Mining Rig NFT alongside their other assets.\n\n---\n\n## 4. Funding Your Wallet\n\nYour mining wallet needs ETH on Base for gas and the mint fee.\n**Minimum:** 0.005 ETH (~$15) covers minting + several mining cycles.\n\n### Built-in Bridge: `apow fund` (Recommended)\n\nThe CLI bridges from Solana or Ethereum via [Squid Router](https:\u002F\u002Fsquidrouter.com\u002F) (Chainflip), or accepts deposits directly on Base. `apow start` can use this flow automatically. Auto-splits into ETH (gas) + USDC (x402 RPC):\n\n```bash\nnpx apow-cli fund                                          # Interactive: choose chain + token\nnpx apow-cli fund --chain solana --token sol               # Bridge SOL → ETH+USDC on Base\nnpx apow-cli fund --chain solana --token usdc              # Bridge Solana USDC → Base\nnpx apow-cli fund --chain ethereum                         # Bridge ETH from Ethereum mainnet → Base\nnpx apow-cli fund --chain base                             # Show address, wait for deposit\nnpx apow-cli fund --chain base --no-swap                   # Skip auto-split\n```\n\n**Solana\u002FEthereum bridging:** Generates a one-time deposit address with QR code. Send tokens from any wallet (Phantom, MetaMask, etc.). Requires `SQUID_INTEGRATOR_ID` in `.env` (free at [squidrouter.com](https:\u002F\u002Fapp.squidrouter.com\u002F)). Bridge time: ~1-3 minutes via Chainflip.\n\n**Auto-split:** After bridging, the CLI checks ETH and USDC balances. If either is below the minimum (0.003 ETH for gas, 2.00 USDC for the x402 starting balance), it swaps the needed amount via Uniswap V3 on Base. Use `--no-swap` to skip.\n\n### Manual Funding Options\n\nIf you prefer not to use the built-in bridge:\n\n#### From Solana (Phantom Wallet)\nPhantom natively supports Base. Tell your user:\n1. Open Phantom → tap the **Swap** icon\n2. Set **From:** SOL (Solana) → **To:** ETH (Base)\n3. Enter amount (≥0.005 ETH worth of SOL)\n4. Tap **Review** → **Swap**\n5. Once ETH arrives on Base, tap **Send** → paste the mining wallet address\n6. Confirm the transfer\n\n#### From an Exchange (Coinbase, Binance, etc.)\n1. Buy ETH on Base (Coinbase supports Base withdrawals natively)\n2. Withdraw to the mining wallet address\n3. Select **Base** as the network. Do NOT send on Ethereum mainnet\n\n#### From Ethereum Mainnet\nBridge ETH to Base via [bridge.base.org](https:\u002F\u002Fbridge.base.org):\n1. Connect source wallet → enter mining wallet address as recipient\n2. Bridge ≥0.005 ETH → arrives on Base in ~10 minutes\n\n#### From Another Base Wallet\nSend ETH directly to the mining wallet address on Base.\n\n### Verifying Funds\nAfter funding, verify the balance:\n```bash\nnpx apow-cli stats\n# Shows wallet balance; must be ≥0.005 ETH to proceed\n```\n\n---\n\n## 5. Step 2: Install Miner Client\n\n**Via npm (no install needed):**\n```bash\nnpx apow-cli start\n# or: npx apow-cli setup\n```\nAll `apow` commands work via `npx` with no global install required.\n\n**Via source (for developers):**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli.git\ncd apow-cli && npm install\n# Use `npx tsx src\u002Findex.ts` instead of `npx apow-cli` for all commands\n```\n\n---\n\n## 6. Step 3: Configure Environment (Advanced Mode \u002F Manual Setup)\n\nSkip this section for Easy Mode. The CLI writes the equivalent config for you during `apow start`\nor `apow setup`. Use a manual `.env` only when you want full control or need a headless fallback.\n\nRun `npx apow-cli setup` for interactive configuration, or create a `.env` file manually in your working directory:\n\n```bash\n# === Required ===\n\n# Your wallet private key (0x-prefixed, 64 hex chars)\n# Required for manual \u002F headless minting and mining commands\nPRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE\n\n# Built-in Base mainnet defaults. Only override if you want a different deployment.\nMINING_AGENT_ADDRESS=0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D\nAGENT_COIN_ADDRESS=0x12577CF0D8a07363224D6909c54C056A183e13b3\n\n# === LLM Configuration (required for minting only; mining uses optimized solving) ===\n\n# Provider: \"clawrouter\" (recommended) | \"openai\" | \"gemini\" | \"deepseek\" | \"qwen\" | \"anthropic\" | \"ollama\" | \"claude-code\" | \"codex\"\n# clawrouter: zero credentials, pays with USDC from your wallet via x402\nLLM_PROVIDER=clawrouter\n\n# API key (not required if LLM_PROVIDER=clawrouter, ollama, claude-code, or codex)\n# LLM_API_KEY=sk-your-api-key\n\n# Model name (provider-specific)\nLLM_MODEL=blockrun\u002Feco\n\n# === Network ===\n\n# Base RPC endpoint (optional if USE_X402=true). Get a free URL from alchemy.com (no credit card).\n# Or set USE_X402=true instead for auto-pay via QuickNode (2.00 USDC minimum starting balance; add more for headroom).\nRPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_KEY\n\n# Chain: \"base\" | \"baseSepolia\" (auto-detected from RPC_URL if omitted)\nCHAIN=base\n```\n\n### Environment Variable Reference\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `PRIVATE_KEY` | Manual \u002F headless only | - | Wallet private key (0x + 64 hex chars). Easy Mode generates this for you if no wallet exists yet. |\n| `KEYSTORE_PASSWORD` | No | unset | If set, `wallet new`\u002F`wallet export` also create an encrypted JSON keystore backup under `~\u002F.apow\u002Fkeystores\u002F` |\n| `MINING_AGENT_ADDRESS` | No | built-in Base mainnet address | MiningAgent contract address. Override only for another deployment or network. |\n| `AGENT_COIN_ADDRESS` | No | built-in Base mainnet address | AgentCoin contract address. Override only for another deployment or network. |\n| `LLM_PROVIDER` | No | `clawrouter` if `USE_X402=true`, else `openai` | LLM provider for minting: `clawrouter` (recommended, zero credentials), `openai`, `gemini`, `deepseek`, `qwen`, `anthropic`, `ollama`, `claude-code`, `codex`. Not needed for mining. |\n| `LLM_API_KEY` | Only for cloud providers that require one | - | API key for minting. Not needed for `clawrouter`, `ollama`, `claude-code`, `codex`, or mining. Falls back to `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `DEEPSEEK_API_KEY`, `DASHSCOPE_API_KEY`. |\n| `LLM_MODEL` | No | per-provider default (e.g. `blockrun\u002Feco`, `gpt-4o-mini`) | Model identifier passed to the provider (minting only). Auto-detected from provider if omitted. |\n| `CLAWROUTER_PORT` | No | `8402` | Port for ClawRouter local proxy (only if default is in use) |\n| `MINER_THREADS` | No | All CPU cores | Threads for JS nonce grinding (fallback if no native GPU\u002FCPU grinder detected) |\n| `STALE_CHECK_INTERVAL` | No | `5` | Seconds between stale-challenge checks while grinding. Applies across local\u002Fnative and x402 grinders; lower values restart dead work faster but add more RPC reads. |\n| `RPC_URL` | No* | — | Base JSON-RPC endpoint. Get a free URL from Alchemy or QuickNode. *Not needed if `USE_X402=true`. |\n| `USE_X402` | No | `false` | Set to `true` to auto-pay via QuickNode x402 (2.00 USDC minimum starting balance; add more for headroom). Replaces `RPC_URL`. |\n| `CHAIN` | No | `base` | Network selector; auto-detects `baseSepolia` if RPC URL contains \"sepolia\" |\n| `SOLANA_RPC_URL` | No | `https:\u002F\u002Fapi.mainnet-beta.solana.com` | Solana RPC endpoint (only for `apow fund --chain solana`) |\n| `ETHEREUM_RPC_URL` | No | `https:\u002F\u002Fcloudflare-eth.com` | Ethereum mainnet RPC (only for `apow fund --chain ethereum`) |\n| `OLLAMA_URL` | No | `http:\u002F\u002F127.0.0.1:11434` | Ollama server URL (only if `LLM_PROVIDER=ollama`) |\n| `GRINDER_MODE` | No | `auto` | Grinder mode: `auto` (detect native binaries) or `js` (force JS worker_threads) |\n| `GPU_GRINDER_PATH` | No | auto-detected | Explicit path to Metal GPU grinder binary |\n| `CUDA_GRINDER_PATH` | No | auto-detected | Explicit path to local CUDA grinder binary |\n| `CPU_GRINDER_PATH` | No | auto-detected | Explicit path to CPU-C grinder binary |\n| `CPU_THREADS` | No | All CPU cores | Thread count for CPU-C grinder |\n| `USE_X402_GRIND` | No | same as `USE_X402` | Enable remote GPU grinding via x402 (dynamic pricing, ~$0.006\u002Fgrind). Set `false` to disable even when `USE_X402=true`. |\n| `GRIND_URL` | No | `https:\u002F\u002Fgrind.apow.io\u002Fgrind` | Custom GrindProxy endpoint URL (for self-hosted grinding) |\n| `VAST_IP` | No | - | Remote VAST.ai GPU host IP (for remote CUDA mining) |\n| `VAST_PORT` | No | - | Remote VAST.ai GPU SSH port |\n| `REMOTE_GRINDER` | No | `\u002Froot\u002Fgrinder-cuda` | Path to CUDA binary on remote host |\n| `SQUID_INTEGRATOR_ID` | No | - | Squid Router integrator ID for deposit address flow (free at [squidrouter.com](https:\u002F\u002Fapp.squidrouter.com\u002F)) |\n\n### LLM Provider Recommendations (for Minting)\n\n> An LLM is only needed for **minting** your Mining Rig NFT (one-time identity verification). Mining uses optimized algorithmic SMHL solving, with no LLM needed. Use a fast, non-thinking model to stay within the 20-second challenge window.\n\n| Provider | Model | Cost per call | Notes |\n|---|---|---|---|\n| ClawRouter | `blockrun\u002Feco` | ~$0.006 | **Recommended.** Zero credentials, pays with USDC via x402 |\n| OpenAI | `gpt-4o-mini` | ~$0.001 | Cheapest API key option, fast, reliable |\n| Gemini | `gemini-2.5-flash` | ~$0.001 | Fast, good accuracy |\n| DeepSeek | `deepseek-chat` | ~$0.001 | Fast, accessible in China |\n| Qwen | `qwen-plus` | ~$0.002 | Alibaba Cloud, accessible in China |\n| Anthropic | `claude-sonnet-4-5-20250929` | ~$0.005 | Works but slower and more expensive |\n| Ollama | `llama3.1` | Free (local) | Requires local GPU; variable accuracy |\n\n### RPC Recommendations\n\nYou need a dedicated RPC endpoint. The public `https:\u002F\u002Fmainnet.base.org` has aggressive rate limits and **will** fail during sustained mining. All providers below offer a **free tier** that is more than sufficient for mining. Alternatively, set `USE_X402=true` for zero-setup auto-pay via QuickNode (2.00 USDC minimum starting balance; add more for headroom).\n\n#### Option 1: Alchemy (Recommended)\n\n1. Go to [alchemy.com](https:\u002F\u002Fwww.alchemy.com\u002F) and sign up (free, no credit card)\n2. Click **Create new app** → Name: `apow-miner` → Chain: **Base** → Network: **Base Mainnet**\n3. On the app dashboard, copy the **HTTPS** URL. It looks like:\n   ```\n   https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_API_KEY\n   ```\n4. Set in your `.env`:\n   ```\n   RPC_URL=https:\u002F\u002Fbase-mainnet.g.alchemy.com\u002Fv2\u002FYOUR_API_KEY\n   ```\n\n**Free tier:** 300M compute units\u002Fmonth (~millions of RPC calls). More than enough for mining.\n\n#### Option 2: QuickNode\n\n1. Go to [quicknode.com](https:\u002F\u002Fwww.quicknode.com\u002F) and sign up (free, no credit card)\n2. Click **Create Endpoint** → Chain: **Base** → Network: **Mainnet**\n3. Copy the **HTTP Provider** URL. It looks like:\n   ```\n   https:\u002F\u002Fsomething-something.base-mainnet.quiknode.pro\u002FYOUR_TOKEN\u002F\n   ```\n4. Set in your `.env`:\n   ```\n   RPC_URL=https:\u002F\u002Fsomething-something.base-mainnet.quiknode.pro\u002FYOUR_TOKEN\u002F\n   ```\n\n**Free tier:** 10M API credits\u002Fmonth. Sufficient for a few miners.\n\n#### Option 3: Other Free RPCs\n\n| Provider | Free Tier | URL Pattern |\n|---|---|---|\n| [Infura](https:\u002F\u002Finfura.io\u002F) | 100K req\u002Fday | `https:\u002F\u002Fbase-mainnet.infura.io\u002Fv3\u002FKEY` |\n| [Ankr](https:\u002F\u002Fwww.ankr.com\u002F) | 30 req\u002Fs | `https:\u002F\u002Frpc.ankr.com\u002Fbase` (no key needed) |\n| [Blast](https:\u002F\u002Fblastapi.io\u002F) | 40 req\u002Fs | `https:\u002F\u002Fbase-mainnet.blastapi.io\u002FKEY` |\n\n#### Troubleshooting RPC Issues\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `429 Too Many Requests` | Public RPC rate limit | Switch to a dedicated RPC (Alchemy\u002FQuickNode) |\n| `Timed out waiting for next block (60s)` | RPC not responding | Check endpoint URL; try a different provider |\n| `fetch failed` \u002F `ECONNREFUSED` | RPC URL is wrong or down | Verify URL; test with `curl YOUR_RPC_URL -X POST -H \"Content-Type: application\u002Fjson\" -d '{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":1}'` |\n| Stale data \u002F missed mines | RPC caching or slow sync | Alchemy and QuickNode are fastest; avoid free community RPCs |\n\n---\n\n## 7. Step 4: Mint a Mining Rig\n\n**One rig per wallet.** The CLI enforces a one-rig-per-wallet rule. Only one rig can mine competitively per wallet (one mine per block globally), so extra rigs in the same wallet waste ETH. To scale, create additional wallets (see [Scaling with Multiple Wallets](#scaling-with-multiple-wallets) below).\n\n```bash\nnpx apow-cli mint\n```\n\n**What happens:**\n1. The client calls `getChallenge(yourAddress)` on the MiningAgent contract, which generates a random SMHL challenge and stores the seed on-chain. This is a write transaction (costs gas).\n2. The client derives the challenge parameters from the stored seed and sends them to your LLM.\n3. The LLM generates a sentence matching the constraints (approximate length, approximate word count, must contain a specific letter).\n4. The client calls `mint(solution)` with the mint fee attached. The contract verifies the SMHL solution on-chain.\n5. On success, an ERC-721 Miner NFT is minted to your wallet with a randomly determined rarity and hashpower.\n6. The mint fee is forwarded to the LPVault (used for AGENT\u002FUSDC liquidity: initial LP deployment at threshold, then ongoing `addLiquidity()` to deepen the position).\n\n**Challenge expiry:** 20 seconds from `getChallenge` to `mint`. The LLM must solve quickly. Use a fast, non-thinking model (gpt-4o-mini, gemini-2.5-flash, deepseek-chat).\n\n### Mint Price\n\nThe mint price starts at 0.002 ETH and decays exponentially:\n- Decreases by 5% every 100 mints\n- Floors at 0.0002 ETH\n- Formula: `price = max(0.002 * 0.95^(totalMinted \u002F 100), 0.0002)` ETH\n\n### Rarity Table\n\n| Tier | Name | Hashpower | Reward Multiplier | Probability |\n|---|---|---|---|---|\n| 0 | Common | 100 | 1.00x | 60% |\n| 1 | Uncommon | 150 | 1.50x | 25% |\n| 2 | Rare | 200 | 2.00x | 10% |\n| 3 | Epic | 300 | 3.00x | 4% |\n| 4 | Mythic | 500 | 5.00x | 1% |\n\n**Max supply:** 10,000 Miner NFTs.\n\n---\n\n## 8. Step 5: Start Mining\n\n```bash\nnpx apow-cli mine          # auto-detects your best rig\nnpx apow-cli mine \u003CtokenId> # or specify a rig by token ID\n```\n\n### What Each Mining Cycle Does\n\n1. **Ownership check:** verifies your wallet owns the specified token.\n2. **Supply check:** confirms mineable supply is not exhausted.\n3. **Fetch challenge:** reads `getMiningChallenge()` from the AgentCoin contract, which returns:\n   - `challengeNumber` (bytes32): the current PoW challenge hash\n   - `miningTarget` (uint256): the difficulty target\n   - `smhl`: the SMHL format challenge\n4. **Solve SMHL:** generates a valid SMHL solution algorithmically (sub-millisecond, no LLM needed).\n5. **Grind nonce:** brute-force search for a `nonce` where `keccak256(challengeNumber, minerAddress, nonce) \u003C miningTarget`. Works on any CPU out of the box. Add a GPU for 100x+ faster grinding.\n   The CLI re-checks the challenge every 5 seconds by default while grinding and aborts stale work across local\u002Fnative and x402 nonce sources.\n6. **Submit proof:** calls `mine(nonce, smhlSolution, tokenId)` on AgentCoin. The contract verifies both the hash and SMHL solution on-chain.\n7. **Collect reward:** AGENT tokens are minted directly to your wallet.\n8. **Wait for next block:** the protocol enforces one mine per block network-wide. The client waits for block advancement before the next cycle.\n\n### Reward Economics\n\n**One mine per block, network-wide.** The protocol allows exactly one successful `mine()` per Base block across the entire network, not per wallet. All miners compete for each block's reward. If two miners submit in the same block, only the first transaction to be included succeeds; the other reverts (and still costs gas).\n\n| Parameter | Value |\n|---|---|\n| Base reward | 3 AGENT |\n| Hashpower scaling | `reward = baseReward * hashpower \u002F 100` |\n| Era interval | Every 500,000 total mines |\n| Era decay | 10% reduction per era (`reward * 90 \u002F 100`) |\n| Max mineable supply | 18,900,000 AGENT (21M total - 2.1M LP reserve) |\n| Difficulty adjustment | Every 64 mines, targeting 5 blocks between mines |\n\n**Example rewards (Common miner, 100 hashpower = 1.00x):**\n\n| Era | Total Network Mines | Reward per Mine |\n|---|---|---|\n| 0 | 0 to 499,999 | 3.00 AGENT |\n| 1 | 500,000 to 999,999 | 2.70 AGENT |\n| 2 | 1,000,000 to 1,499,999 | 2.43 AGENT |\n| 3 | 1,500,000 to 1,999,999 | 2.187 AGENT |\n\nA Mythic miner (5.00x) earns 15.00 AGENT per mine in Era 0.\n\n### Cost Per Mine\n\n- **Gas:** ~0.001 ETH per `mine()` transaction on Base\n- **LLM:** $0 (mining uses algorithmic SMHL, no LLM calls)\n- **Total:** ~$0.003 to $0.005 per mining cycle (gas only)\n\n### Error Handling\n\nThe miner has built-in resilience:\n- **Flat retry delay** on transient failures (about 2s with a small jitter)\n- **Background stale checks** every 5 seconds by default so slow grinders do not waste a full attempt on a dead challenge\n- **Max 10 consecutive failures** before the miner exits\n- **Fatal errors** cause immediate exit: `\"Not your miner\"`, `\"Supply exhausted\"`, `\"No contracts\"`\n- **Block timing** is handled automatically: if the block hasn't advanced, the miner waits\n\n---\n\n## 9. Step 6: Monitor\n\n```bash\nnpx apow-cli stats            # network stats + auto-detect your rig\nnpx apow-cli stats \u003CtokenId>  # stats for a specific rig\n```\n\n**Network stats output:**\n- Total mines (network-wide)\n- Total AGENT minted\n- Current mining target (difficulty)\n- Your wallet's AGENT balance\n\n**Miner stats output (when tokenId provided):**\n- Rarity tier and name\n- Hashpower multiplier\n- Mint block number\n- Total mine count for this rig\n- Total AGENT earned by this rig\n\n---\n\n## 10. Advanced\n\n### Competitive Mining & Scaling\n\n**How mining competition works:** The protocol enforces exactly ONE successful mine per block, network-wide. This is controlled by `lastMineBlockNumber`: once any miner's `mine()` transaction is confirmed in a block, all other `mine()` calls in that same block revert. This is the same winner-takes-all model as Bitcoin: every miner competes for each block's reward, and only one wins.\n\n**One rig per wallet (CLI-enforced).** The CLI prevents minting more than one rig per wallet. Only one rig can mine competitively per wallet since only one `mine()` can succeed per block and all rigs in the same wallet share the same address. Extra rigs waste ETH on mint fees with no advantage.\n\n### Scaling with Multiple Wallets\n\nTo increase your chances of winning each block, run separate wallets, each with its own rig and its own miner process. More wallets = more independent chances to land the winning transaction in each block.\n\n**The user only funds one wallet.** Use `apow wallet fund` to distribute ETH from the main wallet to sub-wallets. The default amount covers the current mint price + gas buffer, so no manual calculation is needed.\n\n**Autonomous agent flow for multi-wallet mining:**\n\n```bash\n# 1. Generate sub-wallets (main wallet is already configured in .env)\nnpx apow-cli wallet new   # → address A + key A\nnpx apow-cli wallet new   # → address B + key B\nnpx apow-cli wallet new   # → address C + key C\n\n# 2. Fund each sub-wallet from the main wallet (default: mint price + 0.003 ETH gas)\nnpx apow-cli wallet fund 0xADDRESS_A\nnpx apow-cli wallet fund 0xADDRESS_B\nnpx apow-cli wallet fund 0xADDRESS_C\n# Or specify a custom amount: npx apow-cli wallet fund 0xADDRESS_A 0.01\n\n# 3. Mint a rig for each sub-wallet\nPRIVATE_KEY=0xKEY_A npx apow-cli mint\nPRIVATE_KEY=0xKEY_B npx apow-cli mint\nPRIVATE_KEY=0xKEY_C npx apow-cli mint\n\n# 4. Mine with all wallets in parallel\nPRIVATE_KEY=0xKEY_A npx apow-cli mine &\nPRIVATE_KEY=0xKEY_B npx apow-cli mine &\nPRIVATE_KEY=0xKEY_C npx apow-cli mine &\nwait\n```\n\nOr use a process manager like PM2 for production:\n\n```bash\n# ecosystem.config.cjs\nmodule.exports = {\n  apps: [\n    { name: \"miner-a\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_A\" } },\n    { name: \"miner-b\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_B\" } },\n    { name: \"miner-c\", script: \"npx\", args: \"apow mine\", env: { PRIVATE_KEY: \"0xKEY_C\" } },\n  ]\n};\n\npm2 start ecosystem.config.cjs\npm2 logs\n```\n\n**Economics of multi-wallet mining:** Failed `mine()` calls still cost gas (~0.001 ETH). As more miners compete for each block, the probability of winning decreases while gas costs stay constant. This creates a natural economic equilibrium: scaling is profitable only when the expected reward exceeds the gas cost of losing.\n\n**RPC rate limits:** For 3+ concurrent miners, use a dedicated RPC endpoint (Alchemy, Infura, QuickNode). Free public RPCs will not handle the load.\n\n**GPU mining (v0.9.2+):** The miner auto-detects native grinder binaries for 50-1000x faster nonce grinding. Grinder source files ship with the npm package -- run `apow build-grinders` to compile and install to `~\u002F.apow\u002F`:\n\n```bash\nnpx apow-cli build-grinders              # auto-detects compilers + GPU arch\nnpx apow-cli build-grinders --cuda-arch sm_89  # override CUDA architecture\n```\n\nSupported grinders (all race in parallel -- first nonce wins, falls back to JS automatically):\n- **Metal GPU** (macOS): requires Xcode CLI tools (`clang`)\n- **CUDA** (NVIDIA GPU): requires CUDA toolkit (`nvcc`), auto-detects GPU arch via `nvidia-smi`\n- **CPU-C** (any platform): requires `clang` or `gcc`\n- **Remote CUDA** (VAST.ai): set `VAST_IP` + `VAST_PORT` env vars for SSH-based remote grinding\n\n### x402 GPU Grinding (Remote RTX 4090)\n\nNo GPU? Add `USE_X402_GRIND=true` to your `.env` for remote RTX 4090 nonce grinding at ~$0.006\u002Fgrind (dynamic pricing) via the [x402 payment protocol](https:\u002F\u002Fwww.x402.org\u002F). Zero setup, zero API keys — payment is automatic from your mining wallet's USDC balance.\n\n```bash\n# In your .env (enabled automatically in Easy Mode)\nUSE_X402_GRIND=true\n# ALLOW_LOCAL_FALLBACK_WITH_X402=true   # Advanced Mode hybrid option\n# GRIND_URL=https:\u002F\u002Fgrind.apow.io\u002Fgrind   # default, override for self-hosted\n```\n\nIn Easy Mode, the HTTP grinder is the only nonce source, so agents do not silently burn local CPU while remote x402 GPU mining is active. Advanced Mode can opt into a hybrid local fallback. For GPU-less miners, this is still a 10-100x speed improvement over JS fallback.\n\n**Front-running is cryptographically impossible:** nonces are bound to `keccak256(challenge, msg.sender, nonce)` — a nonce ground for address A is useless for address B.\n\n**Self-hosting:** Deploy your own GrindProxy with any CUDA GPU. See [apow-grind](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-grind) for the open-source CF Worker + RunPod Docker image. Set `GRIND_URL` to your endpoint.\n\n### Local LLM Setup (Ollama)\n\n```bash\n# Install Ollama\ncurl -fsSL https:\u002F\u002Follama.ai\u002Finstall.sh | sh\n\n# Pull a model\nollama pull llama3.1\n\n# Configure .env\nLLM_PROVIDER=ollama\nLLM_MODEL=llama3.1\n# LLM_API_KEY is not needed for Ollama\n```\n\nOllama runs on `http:\u002F\u002F127.0.0.1:11434` by default. The miner connects there automatically.\n\n**Trade-off:** Free inference, but local models may have lower accuracy on the constrained SMHL challenges. The miner retries up to 5 times per challenge, but persistent failures will slow mining.\n\n### Custom RPC Endpoints\n\nSet `RPC_URL` in `.env` to any Base-compatible JSON-RPC endpoint. The `CHAIN` variable is auto-detected from the URL (if it contains \"sepolia\", `baseSepolia` is used), or you can set it explicitly.\n\n### Agent Wallet\n\nEach Miner NFT supports an on-chain agent wallet. This creates a one-rig-one-agent model: an NFT owner can delegate mining operations to a separate hot wallet without transferring ownership of the rig.\n\n**Functions:**\n- `getAgentWallet(tokenId)`: returns the registered agent wallet address\n- `setAgentWallet(tokenId, newWallet, deadline, signature)`: sets a new agent wallet (requires EIP-712 signature from the new wallet)\n- `unsetAgentWallet(tokenId)`: removes the agent wallet\n\n**What survives NFT transfer:** rarity, hashpower, total mine count, total AGENT earned, and the on-chain pixel art. All permanent metadata is baked into the token.\n\n**What gets cleared on transfer:** ONLY the agent wallet binding. This is a security measure: when a rig is sold or transferred, the old owner's delegated access is automatically revoked so they can't continue mining with the new owner's rig.\n\n**Trading:** Miner NFTs are fully tradeable (standard ERC-721). They are NOT soulbound. You can buy, sell, and transfer them on OpenSea or any NFT marketplace. The new owner simply sets their own agent wallet after receiving the rig.\n\n### Testnet (Base Sepolia)\n\nTo mine on testnet, set:\n```bash\nRPC_URL=https:\u002F\u002Fsepolia.base.org\nCHAIN=baseSepolia\n```\nUse the corresponding testnet contract addresses.\n\n---\n\n## 11. Troubleshooting\n\n| Error | Cause | Fix |\n|---|---|---|\n| `PRIVATE_KEY is required for minting and mining commands.` | No wallet is configured for the current manual command | Run `npx apow-cli start` and choose Easy Mode to generate one, or add `PRIVATE_KEY=0x...` to your `.env` file |\n| `PRIVATE_KEY must be a 32-byte hex string prefixed with 0x.` | Malformed private key | Ensure key is exactly `0x` + 64 hex characters |\n| `MINING_AGENT_ADDRESS is required.` | Contract address missing or overridden with an invalid value | Remove the bad override to use the built-in default, or set the correct `MINING_AGENT_ADDRESS` in `.env` |\n| `AGENT_COIN_ADDRESS is required.` | Contract address missing or overridden with an invalid value | Remove the bad override to use the built-in default, or set the correct `AGENT_COIN_ADDRESS` in `.env` |\n| `LLM_API_KEY is required for openai.` | Missing API key for cloud provider | Set `LLM_API_KEY` (or provider-specific key like `OPENAI_API_KEY`) in `.env`, or switch to `ollama` |\n| `Insufficient fee` | Not enough ETH sent with mint | Check `getMintPrice()` and ensure wallet has enough ETH |\n| `Sold out` | All 10,000 Miner NFTs minted | No more rigs available; buy one on secondary market |\n| `Expired` | SMHL challenge expired (>20s) | Use a faster model (gpt-4o-mini, gemini-2.5-flash). Thinking models are too slow for the 20s mint window |\n| `Invalid SMHL` | LLM produced an incorrect solution | Retry; if persistent, switch to a more capable model |\n| `Not your miner` | Token ID not owned by your wallet | Verify `PRIVATE_KEY` matches the NFT owner; check token ID |\n| `Supply exhausted` | All 18.9M mineable AGENT has been minted | Mining is complete; no more rewards available |\n| `One mine per block` | Another mine was confirmed in this block | Automatic; the miner waits for the next block |\n| `No contracts` | Calling from a contract, not an EOA | Mining requires an externally owned account (EOA) |\n| `Invalid hash` | Nonce does not meet difficulty target | Bug in nonce grinding; should not happen under normal operation |\n| `Nonce too high` | Wallet nonce desync | Reset nonce in wallet or wait for pending transactions to confirm |\n| Frequent `stale #N` restarts | Your grinder is slower than the current network difficulty | Expected on slow rigs. The default 5-second stale check already reduces wasted work; use a faster grinder or lower `STALE_CHECK_INTERVAL` if you intentionally want more aggressive polling. |\n| `Anthropic request failed: 429` | Rate limited by Anthropic API | Reduce mining frequency or upgrade API plan |\n| `Ollama request failed: 500` | Ollama server error | Check `ollama serve` is running; restart if needed |\n| `SMHL solve failed after 5 attempts` | LLM cannot satisfy constraints | Switch to a more capable model (e.g., `gpt-4o` or `claude-sonnet-4-5-20250929`) |\n| `Fee forward failed` | LPVault rejected the ETH transfer | LPVault may not be set; check contract deployment |\n| `10 consecutive failures` | Repeated transient errors | Check RPC connectivity, wallet balance, and LLM availability |\n| `Timed out waiting for next block (60s)` | RPC not responding or network stalled | Check RPC connectivity; try a different RPC endpoint |\n\n---\n\n## 12. Security & Trust\n\nThis section addresses the security model of apow-cli head-on. Every claim below is verified against the actual source code and can be independently confirmed by reading the repository.\n\n### Private Key Generation (Local Only)\n\nKeys are generated via `viem\u002Faccounts` `generatePrivateKey()`, which uses Node.js `crypto.randomBytes(32)`, a cryptographically secure random number generator. Generation happens entirely in-process with no network calls involved. The private key is displayed once to the terminal, and the CLI can create both a plaintext `wallet-\u003Caddress>.txt` import helper and a password-protected JSON keystore (`Web3 Secret Storage v3`) with file permissions `0o600`.\n\n### Private Key Is NEVER Transmitted\n\nExhaustive audit confirms: the private key string is never included in any `fetch()` call, HTTP request body, URL parameter, or header anywhere in the codebase. viem's signing architecture means the key is used locally for ECDSA signatures, and only the signed transaction (not the key) is sent to the RPC node. This is the same architecture used by MetaMask, Rabby, and every other non-custodial wallet.\n\n### Zero Telemetry\n\nThe CLI contains no analytics, no error reporting, and no phone-home behavior of any kind:\n\n- No analytics SDKs (no Mixpanel, no PostHog, no Google Analytics)\n- No error reporting services (no Sentry, no Bugsnag)\n- No tracking pixels, no usage metrics, no telemetry endpoints\n\nThe CLI makes only these network calls:\n\n1. **Blockchain RPC** (to user-configured RPC URL or QuickNode x402): standard `eth_call`, `eth_sendRawTransaction`, etc.\n2. **LLM API** (to user-configured provider): sends only word-puzzle prompts for SMHL solving, never wallet data\n3. **Bridge APIs** (only when using `apow fund`):\n   - **CoinGecko** (`api.coingecko.com`): SOL\u002FETH price quotes\n   - **Squid Router** (`v2.api.squidrouter.com`): deposit address generation and bridge status\n   - **Uniswap V3** (on-chain, Base): ETH\u002FUSDC swaps for auto-split\n   - **Solana RPC** (`api.mainnet-beta.solana.com` or custom): balance checks\n\nNo private keys are transmitted to bridge providers. Squid generates a deposit address, and the user sends tokens from their own wallet.\n\n### LLM Calls Are Data-Isolated\n\nThe SMHL solver sends only generic word-generation prompts to the LLM (e.g., \"Write exactly 5 lowercase English words...\"). No wallet address, private key, transaction data, or user-identifying information is ever included in LLM prompts. The string `privateKey` does not appear anywhere in `smhl.ts`.\n\n### Open Source & Auditable\n\n- Full source code: [github.com\u002FAgentoshi\u002Fapow-cli](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli)\n- MIT licensed\n- Every line is auditable. There are no obfuscated modules, no binary blobs, no minified dependencies performing network calls\n- Smart contracts are separately auditable: [github.com\u002FAgentoshi\u002Fapow-core](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-core)\n\n### npm Package Integrity\n\n- Published as `apow-cli` on npm\n- Package contents match the GitHub source (verify with `npm pack --dry-run` or compare against the repo)\n- No `postinstall` scripts that execute arbitrary code\n- The `package.json` `scripts` section contains only standard build\u002Fdev commands\n\n### Best Practices for Users\n\n1. **Use a fresh wallet.** Generate one with `npx apow-cli wallet new`. Do not import your main wallet or any wallet holding significant funds.\n2. **Fund with only what you need.** ~0.005 ETH covers minting + several mining cycles.\n3. **Prefer encrypted keystore backups** in `~\u002F.apow\u002Fkeystores\u002Fwallet-\u003Caddress>.json`. The plaintext `wallet-\u003Caddress>.txt` helper is convenient for importing into wallet UIs, but it is less secure.\n4. **Verify the source before running** if you prefer:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli\n   cd apow-cli && npm install && npm run build\n   node dist\u002Findex.js setup\n   ```\n5. **Review dependencies.** The dependency tree is minimal and standard: `viem` (Ethereum library), `commander` (CLI framework), `dotenv` (env loading), `openai` (LLM client), `@blockrun\u002Fclawrouter` (x402 LLM proxy), `@quicknode\u002Fx402` (x402 RPC payment), `@solana\u002Fweb3.js` (Solana signing, lazy-loaded only for bridging), `qrcode-terminal` (QR codes for fund command), `ox` (utilities). No exotic or suspicious packages.\n\n### How to Verify These Claims Yourself\n\nEvery statement above can be independently verified:\n\n```bash\n# Clone the source\ngit clone https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli && cd apow-cli\n\n# Search for any outbound network calls (you'll find only RPC and LLM calls)\ngrep -r \"fetch\\|axios\\|http\\|request\" src\u002F\n\n# Confirm private key is never in any network payload\ngrep -r \"privateKey\" src\u002F  # only appears in local wallet operations, never in fetch\u002Frequest calls\n\n# Check for telemetry\u002Fanalytics packages\ngrep -r \"mixpanel\\|posthog\\|sentry\\|bugsnag\\|analytics\\|telemetry\" src\u002F package.json\n\n# Verify wallet file permissions\ngrep -r \"0o600\\|0600\" src\u002F  # wallet files are created with owner-only permissions\n\n# Check postinstall scripts\ncat package.json | grep -A5 \"scripts\"  # no postinstall hook\n```\n\n---\n\n## 13. Contract Addresses\n\n| Contract | Address |\n|---|---|\n| MiningAgent (ERC-721) | `0xB7caD3ca5F2BD8aEC2Eb67d6E8D448099B3bC03D` |\n| AgentCoin (ERC-20) | `0x12577CF0D8a07363224D6909c54C056A183e13b3` |\n| LPVault | `0xDD47511d060eA4E955B95F6f43553414328648a6` |\n\n**Network:** Base (Chain ID 8453)\n\n**Token details:**\n- **Name:** AgentCoin\n- **Symbol:** AGENT\n- **Decimals:** 18\n- **Max supply:** 21,000,000 AGENT\n- **LP reserve:** 2,100,000 AGENT (10%, minted to LPVault at deployment)\n- **Mineable supply:** 18,900,000 AGENT\n\n**Miner NFT details:**\n- **Name:** AgentCoin Miner\n- **Symbol:** MINER\n- **Standard:** ERC-721 Enumerable\n- **Max supply:** 10,000\n\n\n## 14. Dashboard\n\nThe `apow dashboard` command group provides a real-time web UI for monitoring your entire mining fleet. Zero external dependencies — it serves vanilla HTML\u002FJS directly from the CLI.\n\n### Subcommands\n\n| Command | Description |\n|---------|-------------|\n| `apow dashboard start` | Launch the dashboard web UI at `http:\u002F\u002Flocalhost:3847`. Auto-opens browser. Press Ctrl+C to stop. |\n| `apow dashboard add \u003Caddress>` | Add a wallet address to monitor. Validates 0x + 40 hex chars. |\n| `apow dashboard remove \u003Caddress>` | Remove a wallet address from monitoring. |\n| `apow dashboard scan [dir]` | Auto-detect wallets from `wallet-0x*.txt` and `wallet-0x*.json` files in the given directory (default: CWD). Also scans `rig*\u002F` subdirectories. |\n| `apow dashboard wallets` | List all currently monitored wallet addresses. |\n\n### How It Works\n\n- **Wallet storage:** `~\u002F.apow\u002Fwallets.json` — a plain JSON array of Ethereum addresses.\n- **Fleet management:** `~\u002F.apow\u002Ffleets.json` — optional, defines named groups of wallets from different sources.\n- **Data fetching:** Chunked RPC multicalls (max 30 per batch) with a 25-second TTL cache. Queries ETH balance, AGENT balance, rig ownership, rarity, hashpower, mine count, and earnings for every wallet.\n- **NFT art:** Renders on-chain SVG art for each Mining Rig with rarity-based color coding.\n- **Auto-seed:** On first run, seeds `wallets.json` with the address from your `.env` if configured.\n- **Auto-detect:** `dashboard start` automatically scans CWD for `wallet-0x*.txt` and `wallet-0x*.json` files before launching.\n\n### Fleet Configuration (`~\u002F.apow\u002Ffleets.json`)\n\nFor managing wallets across multiple machines or directories, create `~\u002F.apow\u002Ffleets.json`:\n\n```json\n[\n  { \"name\": \"Local\", \"type\": \"array\", \"path\": \"\u002Fhome\u002Fuser\u002F.apow\u002Fwallets.json\" },\n  { \"name\": \"Vast.ai Rigs\", \"type\": \"rigdirs\", \"path\": \"\u002Fmnt\u002Fmining\u002Frigs\" },\n  { \"name\": \"Pool Wallets\", \"type\": \"walletfiles\", \"path\": \"\u002Fmnt\u002Fmining\u002Fwallets\" },\n  { \"name\": \"Solkek Fleet\", \"type\": \"solkek\", \"path\": \"\u002Fhome\u002Fuser\u002Fsolkek-config.json\" }\n]\n```\n\n**Fleet types:**\n\n| Type | Source Format | Description |\n|------|--------------|-------------|\n| `array` | JSON array of addresses | Simple list: `[\"0xABC...\", \"0xDEF...\"]` |\n| `solkek` | JSON with `master.address` + `miners[].address` | Solkek fleet manager format |\n| `rigdirs` | Directory containing `rig*\u002Fwallet-0x*.txt` or `.json` | Scan rig subdirectories for wallet files |\n| `walletfiles` | Directory containing `wallet-0x*.txt` or `.json` | Scan flat directory for wallet files |\n\nIf `fleets.json` does not exist, the dashboard falls back to `wallets.json` as a single \"Main\" fleet.\n\n### Example Workflow\n\n```bash\n# 1. Scan a directory with wallet files to populate wallets.json\nnpx apow-cli dashboard scan \u002Fpath\u002Fto\u002Fmining\u002Fdir\n\n# 2. Manually add a wallet not found by scan\nnpx apow-cli dashboard add 0x1234567890abcdef1234567890abcdef12345678\n\n# 3. Verify your wallet list\nnpx apow-cli dashboard wallets\n\n# 4. Launch the dashboard\nnpx apow-cli dashboard start\n# → Opens http:\u002F\u002Flocalhost:3847 in your browser\n# → Shows real-time balances, rig stats, earnings, and NFT art\n# → Press Ctrl+C to stop\n```\n\n### Troubleshooting\n\n| Issue | Cause | Fix |\n|-------|-------|-----|\n| \"No wallets configured\" | Empty `wallets.json` | Run `apow dashboard add \u003Caddr>` or `apow dashboard scan .` |\n| Dashboard shows 0 balances | RPC rate limiting | Set a dedicated `RPC_URL` in `.env` (Alchemy recommended) |\n| Browser doesn't open | Headless\u002FSSH environment | Manually open `http:\u002F\u002Flocalhost:3847` in a browser |\n| Stale data | 25s cache TTL | Wait for next refresh cycle or restart the dashboard |\n\n---\n\n**Source:** [github.com\u002FAgentoshi\u002Fapow-cli](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-cli) | **Protocol:** [github.com\u002FAgentoshi\u002Fapow-core](https:\u002F\u002Fgithub.com\u002FAgentoshi\u002Fapow-core)\n",{"name":5,"metadata":24,"description":7,"allowed-tools":30,"argument-hint":31},{"openclaw":25},{"requires":26},{"anyBins":27},[28,29],"npx","node","Bash(npx:*), Bash(node:*), Bash(npm:*), Bash(curl:*), Bash(cat:*), Bash(echo:*), Bash(ls:*), Bash(mkdir:*)",[32],"setup|mint|mine|stats","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fa\u002Fapow-mining",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":43,"prompt":52,"zipAvailable":53},[44,46,49],{"tool":28,"command":45},"npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill apow-mine",{"tool":47,"command":48},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill apow-mine",{"tool":50,"command":51},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill apow-mine","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fa\u002Fapow-mining\u002FSKILL.md",true,[],[56,64,71,78,85,92],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":63},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":63},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":63},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":63},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":63},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":63},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]