---
name: wraithgrid
description: Rent verified compute or run hardware on WRAITHGRID, an on-chain compute market on Monad. Use when a task needs a machine - serving or fine-tuning an LLM, diffusion and image generation, training runs, notebooks, renders, transcription, embeddings, transcode - or when the user wants to put their own GPU, Mac, CPU or browser tab to work and earn from it. Also covers posting and monitoring jobs, holding providers to their residency commitment, disputes, licences, earnings and liveness.
---

# WRAITHGRID

An on-chain market for compute on Monad. Every machine carries a soulbound identity minted only
after attestors watched it pass a timed proof of compute, and it has to keep proving it is alive or
the identity expires. Renting is escrowed and bonded, and a machine that stops holding what it sold
can be settled against automatically.

You can drive every side of this: post jobs, run jobs, hold providers to account, buy and sell
licences, and enrol hardware. Nothing here needs a human in the loop except the decisions that
spend the user's money.

The CLI is the interface. It is `wraith` if installed globally, `dist/wraith.exe` for the packaged
build, or `node agent/src/index.mjs` from a checkout.

## Always use `--json`

Every command takes `--json` and returns exactly one JSON document on stdout. Narration the human
version prints is captured into a `log` array instead of corrupting the parse. Failures come back
as `{"ok": false, "error": "...", "command": "..."}` with a non-zero exit, so you can tell a refusal
from a crash.

Never parse the human output. It is formatted for people and will change.

## Before anything that spends money

Renting escrows real funds, enrolling locks a real MON deposit, and buying a licence is a purchase.
All of it is the user's money.

- **Quote the cost and get a yes before opening a job.** `wraith browse --json` gives
  `pricePerHour`; multiply by the hours you intend and say the number out loud.
- **Never enrol hardware without being asked to.** It locks a deposit sized to what the machine
  can earn.
- **Never buy a licence speculatively.** It is an investment decision, not a step in a task.
- Reading is always free: `browse`, `soul`, `jobs`, `status`, `earnings`, `workloads`.

## Renting compute

```bash
wraith workloads --json                 # the catalogue, with each entry's params and device classes
wraith browse --json                    # every live machine, price, capability, reputation
wraith soul 12 --json                   # one machine in full, including what it can run
wraith rent 12 4 vllm model=meta-llama/Llama-3.1-8B-Instruct --json
wraith jobs --json                      # your jobs, their state, and what you can do next
wraith endpoint 7 --json                # decrypt the connection details for job 7
wraith confirm 7 --json                 # release payment when the work is done
```

`rent <soulId> <hours> <workload> [key=value ...]` returns `{jobId, specHash, tx}`.

Pick a machine on more than price. `soul --json` gives you:

- `wcu` — capability on one scale, where 1.00 is roughly an RTX 4090. Deposits and rewards are
  priced in this, so it is the honest comparison across classes.
- `memoryMb` — the hard floor. A model that does not fit does not run at any speed.
- `deviceClass` — 1 NVIDIA, 2 AMD, 3 Apple silicon, 4 CPU, 5 browser tab. `runnable` already
  accounts for this; a CUDA-only image will not run on a Mac and the tools will refuse rather than
  take the money.
- `trustTier` — Verified, Attested or Declared: how well the machine's identity is pinned down. A
  Declared machine is not a fake, it is one whose probe produced a weaker fingerprint, and it earns
  less permanently because of it.
- `reputation` — jobs kept versus failed, on the hardware, surviving re-enrolment.

**Match the class to the work.** Cheap CPU nodes are genuinely good at transcode, indexing,
embeddings and transcription, and genuinely bad at training. A browser tab serves small language
models for cents an hour and nothing else. Do not rent a flagship GPU to run `ffmpeg`.

### After the job is running

`wraith endpoint <jobId> --json` returns the URLs and any bearer token, decrypted locally with a
key that never left this machine. Use it, then confirm.

Confirm promptly when the work was delivered. Escrow sitting past the dispute window closes by
timeout anyway, and holding it does the user no good.

## Holding a provider to its commitment

Most machines commit to holding the majority of their own memory for the life of your job. This is
enforceable, by you, without asking anyone:

```bash
wraith jobs --json          # look at .residency on each active job
wraith challenge 7 --json   # demand proof the machine still holds it
wraith breach 7 --json      # if it could not answer: full refund plus its bond
```

`jobs --json` tells you exactly when this applies:

- `residency.protected: false` — no commitment was made. Browser jobs are always like this, and
  they say so. What you bought there is a token stream, not an exclusive machine.
- `residency.challengeOpen: true` with `blocksLeft` — a challenge is running.
- `residency.canClaimBreach: true` — the window passed with no valid answer. Call `breach`. This
  settles arithmetically, with no quorum and nobody's opinion involved.

Do not challenge in a loop. There is a cooldown, and spamming a machine that is answering correctly
is a waste of gas that proves nothing.

## When it actually went wrong

`wraith dispute <jobId> "<what happened>" --json` escalates. The note is hashed on chain and the
detail goes to a jury panel: independent operators each running a model of their own choosing,
reading the same hash-committed evidence, voting hidden and revealing afterwards. The median of
their verdicts rules.

Write the note as evidence, not as argument. What was ordered, what arrived, what you measured,
when. A panel reads it as data; rhetoric in it does nothing except make the facts harder to find.

Dispute only for genuine failure. A residency breach has its own path above and does not need one.

## Providing compute

```bash
wraith keygen --json                    # the device key for this machine
wraith scan --json                      # what is attestable here, and what each part is worth
wraith enroll 0 --json                  # prove it and mint the soul (locks the deposit)
wraith stake 2000 --json                # collateral, so it can accept jobs
wraith list 0.00025 --json              # price PER SECOND, in token units
wraith run                              # the daemon: heartbeat, accept, serve, tear down
```

`scan --json` reports the deposit and suggested rate per device before anything is committed. Show
the user both numbers and wait for a yes.

`run` must stay up. A machine that misses 72 hours of heartbeats stops being live and cannot be
rented until it proves itself again.

A browser tab is a provider too, at <https://grid.dagentx.com/provide.html> — nothing to install,
and honest about being worth a few cents an hour.

## Licences

A licence is a tradeable claim on a slice of one named machine. It pays that share of every job the
machine settles, for as long as it is held.

```bash
wraith shells 12 --json                 # what is already claimed against machine 12
wraith shell-sell 1000 0 250 --json     # sell 10%, perpetual, for 250 tokens
wraith shell-buy 4 --json
```

Selling a slice of the user's own machine and buying somebody else's are both financial decisions.
Ask first, every time.

## Money

```bash
wraith earnings --json
wraith withdraw <token> --json
wraith status --json
```

Settlement credits an internal ledger rather than pushing tokens, so earnings sit until withdrawn.
That is deliberate: a provider who cannot receive a transfer can never block anyone else's payout.

## What to tell the user honestly

- **A cheap machine is not a worse machine, and it is not a better one either.** Report the class,
  the tier and the reputation alongside the price.
- **Unprotected jobs are a real difference.** If `residency.protected` is false, say so before
  spending on a long job that assumes exclusivity.
- **This is alpha software holding real money.** Unaudited. Say so when the user is about to put
  more than pocket change into it.
