# The Claw Training Data

API: https://www.paradigm.xyz/puzzles/claw/v1/market

Recordings are nonexclusive downloads of a paid claw attempt. The seller is the
wallet that paid for that attempt. Payments go directly to sellers in OUSD on
Tempo mainnet (4217), token `0x20c0000000000000000000006a37da5c996874be`.

## Identity

POST `/auth` without credentials to receive a zero-amount MPP Tempo charge.
Return its signed proof credential on the same endpoint. This signs typed data;
it does not transfer tokens or broadcast a transaction. The response has a
`token`, `wallet`, and `expires_in` (3600 seconds). Send that token in
`X-Claw-Market-Session` on subsequent requests, including paid requests.

An unpublished browser access key can include JSON body
`{"keyAuthorization":"0x..."}` alongside its proof credential. The server checks
the root-signed grant, key signature, challenge binding, expiry and revocation.
It does not publish the key or spend funds to sign in. Play and marketplace share
the same seven-day key and cumulative allowance.

Browser users use the existing Paradigm Puzzles X login. Verifying a wallet while
signed in links that wallet to the stable X ID. One X account links to one wallet.
X sign-in can then read that wallet's library; wallet proof is required to make
new purchases or change seller prices. Agents do not need an X account.
POST `/link` with a verified wallet session and a Puzzles X cookie also links an
existing session. The browser does this when you verify your wallet after login.

## Catalog And Quotes

GET `/catalog` returns `items` with `id`, `owner`, `outcome` (`success` or
`failure`), `mode` (`manual` or `model`), `created_ms`, `frames`, `duration_ms`,
`sha256`, `bytes`, `price`, `revenue`, `ask_placed_ms`, `owned`, `pending`, and `listed`.
All prices and revenues are integer micro-OUSD (1 OUSD = 1,000,000).
The tick is 200 micro-OUSD ($0.0002). Defaults are 2000 for success and 1000 for failure.

POST `/orders` with `{"success":10,"failure":20}` to buy by quantity, or
`{"ids":["recording-uuid", "another-uuid"]}` for an explicit batch. Up to 500
recordings per order. Already-owned recordings are never sold again to that
wallet. Selection order is price ascending, then **each recording's** all-time
confirmed revenue ascending, then oldest sell order at its current price, then ID.
Changing a price or relisting resets time priority. Saving an unchanged price or
making a sale does not. The recording's creation date is not used for matching.

A quote freezes the recording IDs, hashes, sellers, and prices for five minutes.
Later price changes do not alter the quote. One open order per wallet prevents
overlapping purchases across tabs or requests. An existing open order is returned
instead of creating a second one. DELETE `/orders/{id}` cancels only unpaid,
unsubmitted chunks; it never cancels a pending transaction.

## Pay

The order response contains `chunks`. Each has `id`, `amount`, `transfers`
(`recipient`, integer `amount`), and `state`. Amounts for the same seller are
aggregated; one chunk contains at most 11 sellers. There is no platform fee.

For each `quoted` chunk, POST `/payments/{chunk.id}` to get its 402 MPP challenge.
Verify the chain, OUSD address, exact total, and every seller recipient against
the order. Use standard Tempo MPP **pull** mode with swaps disabled. Sign the
ordinary transferWithMemo transaction and return the credential. The server
sponsors gas. No custom contract calls or channels are needed. Existing
appropriate access keys work; a bounded OUSD `transferWithMemo` key grant can be
published with the first sponsored purchase.

MPP's standard client gives these transactions an expiring nonce and a short
validity window. Validity must be at most ten minutes. Each chunk is atomic;
different chunks are separate payments. Access is granted after confirmation and
verification of all seller payments in that chunk, not merely an RPC success.

Persist the order ID before signing. On HTTP 202, timeout, network loss, or a
second 402, **do not sign another payment automatically**. GET `/orders/{id}`
until resolved. The server journals the exact sponsored transaction before
broadcast and reconciles it after restart. `paid` means access is granted;
`pending` means wait; `review` means contact the operator without paying again.
`failed`, `expired`, and `canceled` grant no new access. Confirmed earlier chunks
remain owned even if a later chunk fails.

GET `/orders` lists recent orders. GET `/me` returns identity and configuration.

## Download

GET `/data/{id}/download` with wallet session or linked X cookie returns a
60-second S3 download URL, ZIP SHA-256, and byte count. Only the owner or a buyer
can obtain it. Do not send wallet proofs or session tokens to S3.

Bundles contain `video.mkv` (lossless FFV1), `trace.npz` (original RGB frames,
capture times and actions), `actions.jsonl`, `policy_ticks.json`, and a hashed
`manifest.json`. Video plays at nominal 10 fps; the trace retains exact capture
timestamps. Model ticks identify the frame used for each inference. Manual runs
are labeled separately. Operational logs, model binaries, and credentials are
not included. Downloads are nonexclusive; resale ownership is not transferred.

## Sell

GET `/seller` returns the wallet's prices, listing status, number of recordings,
copies sold and confirmed all-time revenue. PUT `/seller` with
`{"success":2000,"failure":1000,"listed":true}` changes prices for that
wallet's recordings. Both prices must be multiples of 200, from 200 to
1,000,000,000 micro-OUSD. Disabling listings prevents new quotes without removing
previously purchased access or changing outstanding quotes.
