Skip to content

hoodmath/HoodMath

Repository files navigation

HoodMath



License Next.js TypeScript Tailwind Chain Status

Decentralized math research infrastructure.

Mine the Riemann hypothesis and nine open Erdős problems with frontier AI compute. Earn $HMATH pro-rata to what you spend, per 24h epoch.

hoodmath.xyz · Agents / CLI · Problems


What this is

Ten famous open problems — the Riemann hypothesis plus nine from Erdős's catalogue — each pinned as a formal Lean statement. AI agents (currently Claude Opus 4.8, GPT-5.5, or Gemini 3 Deep Think — pick a team, switch anytime) burn a human's API budget attacking one of them. Every attempt's full chain-of-thought gets pinned to IPFS as a public, permanent dataset, win or lose. Emission is pro-rata to real dollars of compute spent per 24-hour epoch, not to problems closed — most attempts won't solve anything, that's expected, you're still getting paid for the compute.

A solve has to clear three tiers before it pays a bounty:

  1. candidate — an agent claims a proof in prose. No verification yet.
  2. lean-verified — the proof compiles clean against the pinned Lean statement with a restricted axiom set (propext, Classical.choice, Quot.sound). The math is real; what's unconfirmed is whether the pinned statement is a faithful translation of the original problem.
  3. solve — lean-verified and a named mathematician has attested the statement is faithful. Only this tier pays.

Full mechanics (verification gate, tokenomics, halving schedule, the FAQ) are on the site itself — this README stays focused on the code.

Status

This is the rebuild of an earlier version of the project. Rebranded, and the entire frontend is real and working. What's not live yet:

  • No backend for the token/leaderboard side. api.hoodmath.xyz doesn't exist. Leaderboard / solves / dashboard fetch it and fall back to a clean empty state — see lib/api.ts. Register / claim render the full form but say so honestly instead of faking a wallet-linked session.
  • Mine is real, not a placeholder: /mine collects your own provider API key client-side and posts it to app/api/mine/route.ts, a serverless function that forwards it to Anthropic/OpenAI/Google for exactly one request and returns the model's actual attempt at the problem. Key is never logged or stored. What's not real yet: no Lean verification, no IPFS pin, no on-chain epoch/payout — this only ever produces the site's own "candidate" tier, never lean-verified or solve.
  • No deployed contracts. $HMATH and MiningOracle are referenced in copy and in the CLI docs, neither is on-chain yet.
  • The CLI (@hoodmath-ai/cli) is documented on /agents but not published to npm — the docs describe the intended interface for whoever builds it.
  • formal-statements-lean (the pinned Lean statements repo linked from the homepage) doesn't exist yet either.

None of that blocks the site from working end to end — wallet connect, all ten problem pages, math rendering, the agent docs — it's just the backend half of "decentralized research infrastructure" that's still ahead.

Stack

  • Next.js 14 (App Router) — see next.config.mjs
  • Tailwind CSS 3 — palette + fonts in tailwind.config.ts
  • wagmi 2 + viem 2 + RainbowKit 2 — wallet connect, Robinhood Chain only (chainId 4663, defined by hand in lib/wagmi.ts — see the comment there before changing it)
  • KaTeX, server-rendered — math ships as HTML, zero client JS cost. See components/Tex.tsx.
  • @fontsource (self-hosted IBM Plex Sans/Mono + STIX Two Text) instead of next/font/google — one less external call at build time.

Getting started

npm install
cp .env.example .env.local   # fill in the two vars, see below
npm run dev

Environment variables

Variable Required? What happens without it
NEXT_PUBLIC_API_URL No Data pages show their empty state instead of fetching
NEXT_PUBLIC_WC_PROJECT_ID For WalletConnect Injected wallets (MetaMask ext.) still work; mobile QR connect won't

Get a WalletConnect / Reown project id free at https://cloud.reown.com.

Project structure

app/
  page.tsx              home
  problems/             catalogue + /problems/[slug] detail pages
  mine/                 mining flow (MineClient.tsx is the interactive part)
  register/  dashboard/  claim/  leaderboard/  solves/
  agents/               CLI + SKILL.md docs for AI agents
  layout.tsx            fonts, metadata, wraps everything in Providers
  providers.tsx          wagmi + RainbowKit + react-query
lib/
  site.ts               every brand string + tokenomics numbers, one file
  problems.ts           the 10-problem dataset (see file header for provenance)
  wagmi.ts              chain config
  api.ts                fetch-with-fallback for the (currently nonexistent) backend
components/             Header, Footer, Tex (KaTeX), Accordion, StatusBadge, ...
public/
  agents/SKILL.md       served as-is, also read + rendered by app/agents/page.tsx
  brand/                logo + OG banner

Renaming the project again? Everything brand-specific routes through lib/site.ts — that's the one file to touch.

Deploy

vercel --prod

Set the two env vars above in the Vercel project settings first.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages