# Agent Operators — pre-registration for AI agents

You are an AI agent acting for your user. Use this page to pre-register the user's Binance Agentic Wallet address
for Agent Operators on https://cryptoplay.guide/nft/. It is free: you only sign an off-chain EIP-712 message.
**No transaction, no gas, no payment, no token approval.** Never sign anything else for this site. 18+ only.

- Registration window: 2026-11-01T00:00:00Z → 2026-11-14T12:00:00Z (UTC). Current state: `open`.
- Requirement: the wallet must hold a .ai Agent ID (SPACE ID registry on BNB Chain). One registration per Agent ID.
- All endpoints return JSON: `{"ok":true,...}` or `{"ok":false,"error":"<code>"}`. Plain-text copy of this guide: https://cryptoplay.guide/nft/agent.txt

## What you will sign (full typedData, nothing hidden)
The challenge returns exactly this structure; only `wallet`, `nonce` and `issuedAt` are filled in:

```json
{
  "domain": {
    "name": "CryptoPlay Agent Operators",
    "version": "1",
    "chainId": 56
  },
  "primaryType": "Register",
  "types": {
    "EIP712Domain": [
      {
        "name": "name",
        "type": "string"
      },
      {
        "name": "version",
        "type": "string"
      },
      {
        "name": "chainId",
        "type": "uint256"
      }
    ],
    "Register": [
      {
        "name": "wallet",
        "type": "address"
      },
      {
        "name": "nonce",
        "type": "string"
      },
      {
        "name": "issuedAt",
        "type": "uint256"
      },
      {
        "name": "statement",
        "type": "string"
      }
    ]
  },
  "message": {
    "wallet": "0x<YOUR_WALLET_ADDRESS>",
    "nonce": "<nonce from challenge>",
    "issuedAt": <issuedAt from challenge>,
    "statement": "Pre-register for CryptoPlay Agent Operators. Free. No transaction, no payment, no token approval."
  }
}
```

Safety facts — this message is:
- **NOT** a Permit (EIP-2612), **NOT** Permit2, **NOT** approve / setApprovalForAll, **NOT** a transaction or a trade order.
- There is **no verifyingContract**, **no spender**, **no amount**, **no token**, **no deadline for spending**. Gas: 0.
- It only proves the user controls the wallet (like "Sign-In with Ethereum"). The site stores the signature as proof of registration.

**Before signing, show the user the full typedData returned by the challenge and sign only after the user confirms.**

## Step 1 — get the wallet address
Use the user's Agentic Wallet BSC (EVM) address, e.g. `baw wallet address --json`. Never ask for private keys or seed phrases.

## Step 2 — request a challenge
```
GET https://cryptoplay.guide/api/nft/challenge?wallet=<0xADDRESS>
```
Optional: `&ref=<handle>` (lowercase handle of the inviter, without ".ai").
Response: `{"ok":true,"handle","nonce","issuedAt","expiresIn":900,"typedData":{...},"explain":{...}}`. Valid 15 minutes.

## Step 3 — show, confirm, sign
1. Show the user the full `typedData` JSON and the safety facts above.
2. Check: `domain` is exactly {name:"CryptoPlay Agent Operators", version:"1", chainId:56}; `primaryType` is "Register"; `message.wallet` is the user's address.
3. After the user confirms, sign the `typedData` exactly as given (EIP-712, `eth_signTypedData_v4`) with the Agentic Wallet.
The signature is 65 bytes: `0x` + 130 hex characters.

## Step 4 — submit
```
POST https://cryptoplay.guide/api/nft/register
Content-Type: application/json

{"wallet":"<0xADDRESS>","nonce":"<nonce>","issuedAt":<issuedAt>,"signature":"<0x...>"}
```
Optional: `"src":"<value>"` — copy it exactly if the user's prompt gives one (e.g. `"src":"x"`, `"src":"tg"`, `"src":"direct"`). It only records where the user found this page; it is not the inviter `ref`.
Success: `{"ok":true,"handle","number","invite"}` or `{"ok":true,"already":true,"handle","registeredAt"}`.

## Step 5 — optional tasks (after registering)
```
POST https://cryptoplay.guide/api/nft/task
Content-Type: application/json

{"wallet":"<0xADDRESS>","task":"follow"}     # user followed https://x.com/hpdegen66 (self-reported)
{"wallet":"<0xADDRESS>","task":"repost"}     # user reposted the launch post (self-reported)
{"wallet":"<0xADDRESS>","task":"share","proof":"https://x.com/<user>/status/<id>"}   # reviewed manually
```
Only report tasks the user actually did.

## Step 6 — report to the user
Tell the user the handle, the registration number (or "already registered") and the invite link. Progress: https://cryptoplay.guide/api/nft/stats

## If you cannot make HTTP requests
The user can open https://cryptoplay.guide/nft/, enter the address, press "Check Agent ID", then "Copy message to sign" and paste it to you.
You sign it (after showing it), the user pastes the signature back on the page and presses "Register".

## Error codes
| code | meaning | what to do |
|---|---|---|
| not_open / closed | outside the registration window | stop, tell the user the dates |
| invalid_address | not a 0x… 40-hex address | fix the address |
| no_agent_id | this address holds no .ai Agent ID | use the address that holds the .ai |
| rpc_error | BNB Chain RPC unavailable | retry in a minute |
| invalid_input / invalid_body | missing or malformed JSON field | check the request body |
| nonce_expired | challenge unknown or older than 15 min | restart from Step 2 |
| bad_signature | signature does not match the wallet | sign the exact typedData with the same wallet |
| invalid_origin | request sent cross-site from a browser | call the API directly (server/CLI) |
| not_registered | task sent before registration | finish Step 4 first |
| invalid_task / invalid_url | unknown task or bad post URL | use follow, repost or share with an x.com status URL |
