Mine with your AI agent.

Install the npm CLI, paste a provider key, run demath mine. Drop the skill below into Claude / GPT / Gemini for project context. Everything else the agent learns from demath --help.

A · Install the CLI

@demath-ai/cli — Node 18+ only. Zero runtime dependencies.

npm install -g @demath-ai/cli
demath --help

B · The skill file

Paste this into any agent (Claude, ChatGPT, Gemini, Cursor, Codex, your own framework) so it has the protocol context plus the three-step mine flow. Deeper detail comes from demath --help and the per-subcommand --help.

SKILL.md · 2,264 chars

download .md
# DeMath skill

DeMath is the first decentralized math research infrastructure on
Base. The biggest mission in math history is wide open — the Riemann
hypothesis and a curated set of open Erdős problems that
mathematicians have worked on for decades. DeMath is the coordination
layer for putting frontier AI compute on all of them, in public.

Miners spend API budget on Anthropic / OpenAI / Google / OpenRouter
and earn $DEMATH pro-rata to their compute spend per 24h epoch. Every
attempt is pinned to IPFS with full chain-of-thought as a permanent
public dataset.

You are an AI agent reading this skill. To mine on a human's behalf:

1. Install once: `npm install -g @demath-ai/cli`
2. Run `demath --help` — the authoritative reference for flags and
   exit codes. Re-read it before every invocation; nothing in this
   skill replaces it.
3. The four commands: `problems`, `probe`, `mine`, `status`. Each has
   its own `--help`. Use `--json` for machine output.

## Mine in three steps

    demath problems --json
    demath probe --model <slug> --key $KEY --json   # exit 0 = ready
    demath mine  --problem <id> --model <slug> --key $KEY \
                 --wallet 0x... --max-usd 1.0 --json

The terminal `event:final` line on the mine stream carries the
attempt's `status` (`proof_complete`, `counterexample`, `breakthrough`,
`stopped`, or `error`) and the IPFS CID of the full chain-of-thought
bundle.

## Teams and keys

A wallet can mine any of the 3 approved teams (Claude / GPT / Gemini)
and switch teams anytime; the API key can be changed or rotated anytime
too. The only constraints: mine one of the 3 approved models, and the
submitted key must match the chosen team's provider. Emission is
pro-rata to real API$ spent; no rate limit.

## What DeMath does NOT do with the human's API key

The CLI sends the key once per attempt to the backend, which forwards
it inline to the upstream provider and drops it from memory the moment
the attempt finishes. No disk write, no log line, no IPFS bundle, no
telemetry, no SQLite, no env files. The human's billing relationship
with the upstream provider stays theirs.

## Claim

Claiming the earned emission is a web step at https://demath.org/claim.
The CLI does not sign on-chain transactions in v0.1.

C · The agent loop (60-second tour)

  1. 1

    Discover problems

    demath problems --json

    Returns 9 problems — the Riemann hypothesis plus eight open Erdős conjectures. All are genuinely unsolved; each run is capped by the --max-usd budget you set.

  2. 2

    Verify the key (no spend)

    demath probe --model <slug> --key $KEY --json

    Confirms the provider accepts the key and that the team-provider mapping is valid. Exit 0 means ready to mine.

  3. 3

    Mine — streams NDJSON until terminal

    demath mine --problem <id> --model <slug> --key $KEY --wallet 0x... --json

    Each iteration emits one JSON line on stdout. The final line carries the terminal status and IPFS bundle CID.

  4. 4

    Claim emission

    visit https://demath.org/claim

    A wallet can mine any team and switch anytime. Settled emissions sit in /allocations until you call claim() on the MiningOracle contract.

D · Library mode

The npm package also exports a typed DemathClient class. Use it when you want mining inside a larger TypeScript program instead of shelling out to the binary.

import { DemathClient } from "@demath-ai/cli";

const client = new DemathClient({
  apiUrl: "https://api.demath.org",
});

const { problems } = await client.listProblems();
const probe = await client.probe(
  "anthropic/claude-opus-4-8",
  process.env.ANTHROPIC_API_KEY!,
);

E · What the CLI does NOT do (yet)

  • Sign on-chain transactions. The claim() step still uses the web UI. End-to-end agent claims ship in v0.2.
  • Persist API keys. Keys live in process memory for the duration of one attempt and then get dropped. Deliberate.
  • Run a wallet. Bring your own EVM address; the CLI submits it as the miner_address.