# Proof-of-AI-Work \[The open protocol for mineable AI computation]

AXIS AI is a decentralized **Proof-of-AI-Work (PoAIW)** protocol that turns AI
computation into a digital commodity you can mine. You earn **AXIS** by doing
verifiable AI work: training, inference, dataset processing, and output
validation.

No company issues AXIS. It's minted only by the protocol's own rules. It's the
same idea behind Bitcoin's Proof-of-Work, except the work is real AI instead of
hash puzzles. Supply is fixed forever at **84,000,000 AXIS**. No premine, no
founder allocation, no treasury, no admin keys.

* **Mineable AI.** Every unit of mining output is also a unit of economic value: AI computation you can use, sell, or contribute to the network.
* **Fixed supply.** 84,000,000 AXIS, forever. No inflation, no emergency minting, no governance override.
* **Permissionless.** All you need is a wallet and some AI work to do. No KYC, no whitelist, no minimum stake.
* **Non-custodial.** Rewards go to keys you control. No custodian can freeze or seize mined AXIS.
* **Verifiable.** Work is scored automatically and checked against other miners before any AXIS is issued.

## New here? Ask the AI

<div style={{ width: "100%", maxWidth: 640, margin: "1.5rem auto" }}>
  <AskAxisWidget />
</div>

## Mine in your browser

The miner below derives a non-custodial mining wallet, signs a Proof-of-AI-Work
submission with the canonical AXIS scheme, and earns AXIS for verified work. It
runs several workers concurrently and submits aggressively. When a live AXIS
gateway is configured (`VITE_AXIS_GATEWAY_URL`) it mines against the real
network; otherwise it scores work locally so you can see the full flow
end-to-end.

<div style={{ width: "100%", maxWidth: 760, height: "clamp(520px, 72vh, 600px)", margin: "1.5rem auto" }}>
  <MiningWidget />
</div>

:::info
**Live mining needs the API.** The browser, terminal, and bots all submit to
the **API gateway** (`/gateway/submit`). Start the gateway (and the verification
engine behind it) with `./start.sh`, then point clients at it: the website via
`VITE_AXIS_GATEWAY_URL`, the terminal via `GATEWAY_URL`. With no gateway
configured the miner runs in local simulation mode.
:::

## Mine from the terminal

This repo ships a **ready-to-run terminal miner**, so anyone can mine live after
cloning it. It derives a non-custodial wallet, signs Proof-of-AI-Work with the
canonical AXIS scheme, submits to the gateway, polls for the verified reward, and
prints what you earned:

```bash
git clone https://github.com/zenashwoldeyes-rgb/axisai   # the site + miner repo
cd axisai/mpp-main && pnpm install                       # the miner lives here; installs viem
pnpm mine                                          # mine live against the AXIS gateway
```

`pnpm mine` points at the live AXIS gateway
(`https://axis-gateway-production.up.railway.app`) by default, the same one this
site (deployed on Vercel) uses. To target a different gateway, set `GATEWAY_URL`:

```bash
GATEWAY_URL=https://axis-gateway-production.up.railway.app pnpm mine
```

### Create your mining wallet (step by step)

Your wallet is a 12-word seed phrase, and whoever holds it owns the AXIS it
mines. The terminal miner creates and saves one for you on the first run:

1. **Run it once.** `pnpm mine`. On first launch it generates a fresh 12-word
   BIP-39 seed, saves it to `~/.axis/wallet.json` (`chmod 600`), and starts
   mining to it.
2. **Back up the 12 words.** The miner prints them once, under *"New mining
   wallet, back up these 12 words"*. Write them down and keep them private:
   anyone with them can take your rewards, and AXIS can never recover them.
3. **Reuse it automatically.** Every later run reloads the same seed from
   `~/.axis/wallet.json`, so your balance keeps building up in one wallet.
4. **Bring your own wallet (optional).** Mine to a seed or key you already hold:
   ```bash
   pnpm mine --seed "the twelve words you wrote down …"
   pnpm mine --key 0xYOUR_PRIVATE_KEY        # e.g. a key exported from Telegram
   ```
5. **One wallet everywhere.** Import the same 12 words into the in-browser miner
   above (or the Telegram bot) to see and spend the same balance on every surface.

Common flags:

```bash
pnpm mine --work inference_text           # pick a work type (default: auto)
pnpm mine --once                          # mine a single block, then exit
pnpm mine --new                           # ignore the saved seed, make a fresh wallet
OPENAI_API_KEY=sk-...     pnpm mine       # mine with real AI (ChatGPT)
ANTHROPIC_API_KEY=sk-ant- pnpm mine       # mine with real AI (Claude)
```

Output looks like:

```
◆ AXIS terminal miner
  gateway  https://axis-gateway-production.up.railway.app
  wallet   0xDd9D…7Ebe
  network  epoch 1 · difficulty 1 · base 200.0 AXIS
  inference_text   ✓ approved Q 0.76  +152.0000 AXIS  tx 0x01b5c060…  Σ 152.0000
```

Prefer raw HTTP, or another language? Sign a submission and POST it to the
gateway yourself:

```bash
# 1. Build a signed Proof-of-AI-Work submission
node packages/engine/tools/sign-submission.js \
  0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
  inference_text '{"text":"the inference output is coherent relevant and accurate"}' > sub.json

# 2. Submit it through the API gateway (auth, rate-limit, nonce, audit)
curl -X POST "https://axis-gateway-production.up.railway.app/gateway/submit" \
  -H 'Content-Type: application/json' -H 'x-channel: api' -d @sub.json
```

The same canonical scheme (`AXIS-POAIW-SUBMISSION|…`) is implemented in
TypeScript, Python, and Rust, so you can build a miner in any language.

## Launch the protocol

AXIS AI is fully built across six packages (contracts, engine, gateway,
marketplace, Telegram & WhatsApp bots). Bring up the whole stack and launch the
token in one command:

```bash
cp .env.example .env     # fill secrets; defaults work for a local launch
npm install              # installs every workspace + links @axis/shared
./start.sh               # infra → deploy token → migrate → start every service
```

`./start.sh` does the launch in order:

1. **Infra.** Starts PostgreSQL, Redis, and a chain node.
2. **Token launch.** Deploys `ValidatorRegistry`, then the **`AXISToken`**
   (fixed 84,000,000 supply, 100% mined), then `MarketplaceEscrow`, and writes
   the addresses back into `.env`.
3. **Migrate.** Creates the miner, submission, and marketplace tables.
4. **Serve.** Boots the engine (`:4000`), gateway (`:3000`), and marketplace
   (`:5000`); the bots start too if their tokens are set.

Verify it is live, then connect the website:

```bash
curl localhost:3000/health           # gateway: { "status": "ok" }
# In the website (mpp-main/.env):
#   VITE_AXIS_GATEWAY_URL=http://localhost:3000
npm run dev                           # the in-browser miner now mines for real
```

For a public launch, deploy the token to your target chain
(`HARDHAT_NETWORK=custom npm --workspace @axis/contracts run deploy`), host the
gateway behind TLS, set `CORS_ORIGIN` to your site, and point
`VITE_AXIS_GATEWAY_URL` at the public gateway.

## Proof-of-AI-Work

Instead of solving pointless hash puzzles, miners do real AI tasks that are
worth something on their own. Rewards follow a fixed formula:

```
AXIS Reward = baseEpochReward × (W × Q) / (D × 100)
```

| Variable | Meaning |
|---|---|
| `W` | Verified AI workload units submitted |
| `Q` | Quality score of the output (0.0 to 1.0) |
| `D` | Difficulty factor, adjusted per epoch with network load |

All three are protocol-determined. No miner can inflate `W` beyond verified
work, manipulate `Q` outside the scoring function, or alter `D`.

### Eligible work types

* **Text inference.** Generate coherent, relevant, well-structured text.
* **Image inference.** Produce outputs scored against a reference (SSIM).
* **Audio inference.** Submit MFCC feature frames for spectral comparison.
* **Training step.** Perform a fine-tuning step with a plausible loss decrease.
* **Dataset labeling.** Label batches; agreement with peers drives the score.
* **Synthetic data.** Generate samples that match a reference distribution.
* **Peer validation.** Score other miners' outputs against consensus.

## Genesis Mining Phase

The Genesis Phase distributes the first **21,000,000 AXIS**, exactly 25% of
total supply, through open and permissionless mining. Rewards step down across
four epochs so the earliest miners earn the most, just like Bitcoin's early days.

| Epoch | AXIS / block | Cumulative mined | % of Genesis |
|---|---|---|---|
| Genesis 1 | 200 | 5,250,000 | 25% |
| Genesis 2 | 100 | 10,500,000 | 50% |
| Genesis 3 | 50 | 15,750,000 | 75% |
| Genesis 4 | 25 | 21,000,000 | 100% |

After Genesis, the network transitions to the Standard, Late, and Terminal
phases. They're all mined, and all governed by the same fixed emission. See the
[whitepaper](/whitepaper) for the full distribution model.

## Protocol access

AXIS is reachable through lightweight gateways that relay instructions to the
protocol but never take custody or privileged control:

* **This web miner.** Make a wallet and mine right in the browser.
* **Telegram & WhatsApp.** Submit tasks, watch your mining, and get rewards.
* **Direct API.** Programmatic access for developers and larger miners.

## Next steps

* **[Read the whitepaper](/whitepaper).** The vision, tokenomics, PoAIW, and roadmap.
* **[FAQ](/faq).** Common questions about mining, supply, and verification.

## Contact

For project enquiries, listings, and token verification, email
**[pierrethompsontru@gmail.com](mailto:pierrethompsontru@gmail.com)**.
