agentsclimarketplace

Register agent

Skill uptopia-team/legend-of-base-agent-skills/skills/register-agent

Official Agent Realm skill pack for Legend of Base on Base — x402 mining skills for AI agents. Sponsored by Uptopia.From the repository description

Install
npx -y skills add uptopia-team/legend-of-base-agent-skills --skill register-agent

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.3 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it

register-agent

Register a wallet as a game agent. One-time action, costs USDC.

Proxy API

  • Method: POST
  • URL: https://agent-public-api.uptopia.xyz/apps/{appId}/agent/register
  • Auth: JWT (Bearer token)
  • Payment (x402): Yes — requires EIP-3009 TransferWithAuthorization signature

Parameters

NameTypeRequiredSourceDescription
appIdstringyesagent configApplication ID
jwtstringyesagent configAuthorization header
nicknamestringnouser inputDisplay name for the agent

Headers

Content-Type: application/json
Authorization: Bearer <jwt>
PAYMENT-SIGNATURE: <base64-encoded payment payload>

Request Body

{
  "nickname": "My Agent"
}

x402 Payment Flow

Step 1 — Trigger 402

Send the POST request without PAYMENT-SIGNATURE header.

The proxy returns 402 Payment Required with a Payment-Required response header containing base64-encoded payment requirements.

Step 2 — Parse payment requirements

Decode the Payment-Required header (base64 → JSON). Extract from accepts[0]:

  • network — e.g. eip155:8453
  • asset — USDC contract address
  • amount — fee in smallest USDC unit
  • payTo — recipient address
  • maxTimeoutSeconds — signature validity window
  • extra.name, extra.version — EIP-712 domain values

Also extract extensions["builder-code"]["info"]["a"] if present — that is the builder code. Echo it in the payment payload (default bc_d29drd5w if absent). Service code is separate: always set s to legend-skills.

Always parse these values from the live 402 response. Never hardcode amount, payTo, asset, or chainId.

Step 2b — Verify payment identity + amount before signing (required)

Do not sign until every check passes:

  1. Call get-fees (or reuse a fresh result) and read agentRegisterFeeUsdc.
  2. Network: abort unless network is Base mainnet (eip155:8453 or chainId 8453).
  3. Asset: abort unless asset equals Base USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 (case-insensitive).
  4. payTo: abort if missing or not a valid 0x address; show full payTo to the user and require explicit confirm (never sign a silent/unknown recipient).
  5. Amount: compare 402 amount (string integer, USDC 6 decimals) to agentRegisterFeeUsdc. Show raw amount and human USDC (amount / 1e6).
  6. Abort if amount is missing, not a positive integer, or greater than 2× the published fee (or any other clear mismatch). Ask the user before signing even when amounts match — this spends real USDC.

Blind-signing a 402 is unsafe if the endpoint or payment challenge is unexpected.

Step 3 — Sign EIP-3009 TransferWithAuthorization (off-chain)

Build the EIP-712 domain entirely from parsed values:

{
  "name": "<extra.name from 402>",
  "version": "<extra.version from 402>",
  "chainId": "<integer parsed from network field>",
  "verifyingContract": "<asset from 402>"
}

Sign TransferWithAuthorization typed data:

types: { TransferWithAuthorization: [from, to, value, validAfter, validBefore, nonce] }
message: {
  from:        <wallet address>,
  to:          <payTo from 402>,
  value:       <amount from 402>,
  validAfter:  <now - 600>,
  validBefore: <now + maxTimeoutSeconds>,
  nonce:       <random 32 bytes, hex-encoded>
}

This is an off-chain signature — no gas cost.

Step 4 — Build PAYMENT-SIGNATURE payload

Generate a unique payment identifier (≥ 16 random hex chars).

{
  "x402Version": 2,
  "scheme": "exact",
  "network": "<network from 402>",
  "resource": {
    "url": "<full register endpoint URL>",
    "description": "Agent move request",
    "mimeType": "application/json"
  },
  "accepted": "<accepted object from 402 accepts[0]>",
  "payload": {
    "signature": "<EIP-712 signature>",
    "authorization": {
      "from": "<wallet>",
      "to": "<payTo>",
      "value": "<amount>",
      "validAfter": "<validAfter as string>",
      "validBefore": "<validBefore as string>",
      "nonce": "<nonce>"
    }
  },
  "extensions": {
    "payment-identifier": {
      "info": { "id": "<unique payment identifier>" }
    },
    "builder-code": {
      "a": "<builder code from 402 extensions.builder-code.info.a, or bc_d29drd5w>",
      "s": "legend-skills"
    }
  }
}

Base64-encode the JSON payload.

Step 5 — Retry with PAYMENT-SIGNATURE

Resend the same POST request with:

PAYMENT-SIGNATURE: <base64-encoded payload from step 4>

Step 6 — Verify success

Check response headers:

  • X-Execution-Fee-Settled: true — payment settled on-chain
  • PAYMENT-RESPONSE header (base64) — contains { "success": true, "transaction": "0x..." }

Example Response (200 OK)

{
  "success": true,
  "message": "Create agent success",
  "data": {
    "walletAddress": "0xabc...def",
    "stamina": 50,
    "maxStamina": 50,
    "rarity": 0
  }
}

Error Handling

HTTP StatusMeaningAction
200Registered successfullyStore agent info
401JWT invalid or expiredRe-run auth-login
402 (no header)Payment requiredNormal — start x402 flow
402 (with header)Payment rejectedCheck balance; do not retry with same nonce
409Already processingWait and check registration status
4xxBad requestCheck payment payload structure
5xxServer errorRetry with a new payment identifier

Usage Notes

  • Only needs to be called once per wallet — always run check-registration first.
  • Never blind-sign: verify Base network + USDC asset + payTo, compare amount to agentRegisterFeeUsdc, then user-confirm before signing.
  • The wallet must have sufficient USDC on Base mainnet before calling.
  • payment-identifier is required and must be unique per attempt (idempotency key).
  • PAYMENT-SIGNATURE header name is case-sensitive.
  • The builder-code extension: a = builder code from 402 (default bc_d29drd5w); s = service code legend-skills. Do not swap them.
  • On 409, do not retry immediately — the previous payment may still be settling.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,144. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.