Tyzer Docs Open Tyzer

Build with Tyzer

Let AI agents and apps pay any Tyzer username in USDC over x402, read public profiles, and link people straight into a payment.

Testnet beta. Tyzer runs on Arc testnet with test USDC. Nothing here is real money, and nothing you do here moves real funds.

On this pageOverviewx402: pay a usernamex402 results and errorsAgentsPay with Tyzer (checkout)Public endpointsPay linksContracts on Arc testnetHow money is authorizedLimits and support

Overview

x402 to a usernameAn agent pays @name with one signed EIP-3009 transfer. No account, no API key.
Public profilesLook up a username's display name, avatar and short wallet.
Pay linksSend people to a ready-made payment in Telegram, WhatsApp or the browser.
Pay with TyzerA hosted checkout for your shop or app, with signed webhooks.
  • Network: Arc testnet, chain id 5042002 (CAIP-2 eip155:5042002). Test USDC only.
  • Base URL: https://tyzer.app
  • Amounts: USDC has 6 decimals on the token's ERC-20 face; every amount in the API is an integer string in those units ("50000" is 0.05 USDC).
  • No keys to request for x402 and the public endpoints. Only checkout merchants get an API key.

x402: pay a username

GET /x402/@<username>?amount=<usdc>&note=<text> speaks x402 version 2 with the exact scheme. The payer signs an EIP-3009 transferWithAuthorization on Arc's USDC; Tyzer submits it and pays the gas, but cannot change the payer, the payee or the amount, because they are inside the signature.

ParameterRule
@usernameA claimed Tyzer username, with or without .arc. 3 to 20 of a-z 0-9 . _.
amount0.01 to 100 USDC, up to 6 decimals, written as a decimal (0.05).
noteOptional, up to 140 characters. Shown to the recipient.

1. Ask

A request without payment returns 402. The body, also base64-encoded in the PAYMENT-REQUIRED header, is:

{
  "x402Version": 2,
  "resource": {
    "url": "https://tyzer.app/x402/@sam?amount=0.05",
    "description": "Pay 0.05 USDC to @sam.arc on Tyzer (coffee)",
    "mimeType": "application/json"
  },
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:5042002",
    "amount": "50000",
    "asset": "0x3600000000000000000000000000000000000000",
    "payTo": "0x…the username's wallet…",
    "maxTimeoutSeconds": 300,
    "extra": { "name": "USDC", "version": "2" }
  }]
}

payTo is the wallet the username was claimed with (it follows a wallet move). extra is the EIP-712 domain name and version of Arc's USDC.

2. Sign

Sign TransferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce) with domain { name, version, chainId: 5042002, verifyingContract: asset }:

  • to = payTo, value = amount, a fresh random 32-byte nonce.
  • validAfter must be in the past (use now minus 60 seconds).
  • validBefore must be more than 10 seconds and at most one hour ahead (now plus maxTimeoutSeconds is fine).
  • The payer must be an ordinary key (EOA): EIP-3009 checks an ECDSA signature. A Tyzer passkey wallet cannot sign it, which is why agents have their own key (see Agents).

3. Pay

Repeat the same GET with the header PAYMENT-SIGNATURE: base64(json), where the JSON is { x402Version: 2, accepted: <the accepts entry>, payload: { signature, authorization } } and the authorization's numbers are decimal strings. On success you get 200 and a PAYMENT-RESPONSE header:

{
  "paid": true,
  "to": "@sam.arc",
  "amount": "0.05",
  "amountMinor": "50000",
  "payer": "0x…agent…",
  "transaction": "0x…",
  "network": "eip155:5042002"
}

Complete client (TypeScript, viem)

import { privateKeyToAccount } from "viem/accounts";
import { toHex } from "viem";

const agent = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const url = "https://tyzer.app/x402/@sam?amount=0.05&note=coffee";

// 1. Ask: the 402 says exactly what to sign.
const first = await fetch(url);
if (first.status !== 402) throw new Error(`expected 402, got ${first.status}`);
const required = JSON.parse(atob(first.headers.get("PAYMENT-REQUIRED")!));
const req = required.accepts.find((a: { scheme: string }) => a.scheme === "exact");
if (BigInt(req.amount) > 100_000n) throw new Error("more than I want to pay"); // your own cap

// 2. Sign an EIP-3009 transfer from the agent's own key.
const now = Math.floor(Date.now() / 1000);
const authorization = {
  from: agent.address,
  to: req.payTo,
  value: BigInt(req.amount),
  validAfter: BigInt(now - 60),
  validBefore: BigInt(now + req.maxTimeoutSeconds),
  nonce: toHex(crypto.getRandomValues(new Uint8Array(32))),
};
const signature = await agent.signTypedData({
  domain: { name: req.extra.name, version: req.extra.version, chainId: 5042002, verifyingContract: req.asset },
  types: {
    TransferWithAuthorization: [
      { name: "from", type: "address" },
      { name: "to", type: "address" },
      { name: "value", type: "uint256" },
      { name: "validAfter", type: "uint256" },
      { name: "validBefore", type: "uint256" },
      { name: "nonce", type: "bytes32" },
    ],
  },
  primaryType: "TransferWithAuthorization",
  message: authorization,
});

// 3. Pay: the same GET with the signed payload.
const payload = {
  x402Version: 2,
  accepted: req,
  payload: {
    signature,
    authorization: {
      ...authorization,
      value: authorization.value.toString(),
      validAfter: authorization.validAfter.toString(),
      validBefore: authorization.validBefore.toString(),
    },
  },
};
const paid = await fetch(url, { headers: { "PAYMENT-SIGNATURE": btoa(JSON.stringify(payload)) } });
console.log(paid.status, await paid.json()); // 200 { paid: true, transaction: "0x…", ... }

Call it from a server or an agent runtime. The route sends Access-Control-Allow-Origin: * but answers no CORS preflight, so a browser page cannot send the PAYMENT-SIGNATURE header.

x402 results and errors

StatusBodyWhat to do
200{"paid": true, ...}Done. The transfer is onchain.
202{"error": "outcome_unknown"}Sent, result not known yet. Send the same PAYMENT-SIGNATURE again to get the result. Do not sign a new payment.
400{"error": "invalid_request"}Bad username or amount.
402the requirements, with errorThe payment was refused and nothing moved. See the reasons below.
404{"error": "not_found"}No Tyzer user with that name.
409{"error": "outcome_unknown"}An earlier payment with the same payer, payee and amount is still open. Retry that one first.
429{"error": "rate_limited"}30 requests per minute per client. Back off.

Reasons in a 402 error: invalid_payload, requirements_mismatch, invalid_authorization, wrong_recipient, wrong_amount, self_payment, not_yet_valid, expired, valid_too_long, invalid_signature, authorization_already_used, authorization_expired, insufficient_funds, settlement_failed.

Retries are safe

  • Tyzer records each (payer, nonce) before it sends anything. Sending the same signature again never pays twice: a settled one returns the first receipt.
  • An unknown outcome is never a reason to sign a new payment. Wait, resend the same signature, and let validBefore pass if it never settles; after that the authorization can no longer be used.
  • Follow redirects: during a domain move the old host answers 301 to the new one.

Agents

An agent is an AI agent's own wallet: an ordinary key that only the agent holds. Its owner tops it up with "pocket money"; the agent pays over x402 from that, and can never spend more than it holds.

  1. On tyzer.app, open Profile, then Agents. Choose Create a key for it (made in your browser and shown once; Tyzer never sees it) or paste an address you already have. Up to 10 agents.
  2. Choose Give to send it USDC. That is an ordinary payment you approve with your passkey.
  3. Give the agent its key and the x402 client above. Its payments and balance show in the Agents view.

Removing an agent only hides it from the list. It does not take the key away or bring the money back, so move its USDC first. Anyone with the agent's key can spend its USDC.

Pay with Tyzer (checkout)

Send your buyer to Tyzer to pay a fixed amount in USDC, and learn by a signed webhook when it settled. The buyer signs in with their passkey and approves the exact amount to your shop on the usual approve page. Testnet only, no fee. Merchants are added one at a time: DM @Tyzerapp with your shop's name, the origins it returns to and a webhook URL.

  1. You get an API key (tyz_test_…), a webhook secret (whsec_…), both shown once, and a claim link. Open the claim link signed in with the Tyzer wallet that should receive the money. Payments always go to that wallet; the API cannot name another.
  2. For each order, your server creates a session and redirects the buyer to its url. The buyer pays with their Tyzer passkey, or from any wallet on Arc (MetaMask, Rabby, Phantom) by signing one USDC authorization for exactly this checkout; Tyzer pays the gas either way.
  3. When the payment is confirmed on Arc you get checkout.paid, and the buyer returns to your successUrl with ?tyzer_checkout=<id>. Ship on the webhook (or GET the session), never on the redirect alone.

Create a session

const r = await fetch("https://tyzer.app/v1/checkout/sessions", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.TYZER_API_KEY}`,
    "idempotency-key": orderId, // the same key returns the same session
    "content-type": "application/json",
  },
  body: JSON.stringify({
    amountMinor: "12500000", // 12.5 USDC, an integer string in 6-decimal units
    orderRef: orderId, // 1 to 64 printable characters, shown to the buyer
    successUrl: "https://shop.example/thanks",
    cancelUrl: "https://shop.example/cart",
    expiresInSeconds: 1800, // 60 to 1800
  }),
});
const session = await r.json(); // { id, url, state: "OPEN", expiresAt, ... }
// redirect the buyer to session.url

States: OPEN, PROCESSING (approved and on its way: never treat it as failed, and the buyer cannot pay twice), PAID, EXPIRED (nobody approved it in time; nothing was paid). GET /v1/checkout/sessions/:id returns { id, state, amountMinor, orderRef, url, expiresAt, paidAt, txHash, payer, refund, createdAt }. payer is the buyer's @username only if they chose to share it, otherwise "a Tyzer user". No email, phone or chat identity is ever sent.

Webhooks

Events: checkout.paid, checkout.expired (nobody paid in time) and checkout.refunded (you refunded a paid checkout and the refund is confirmed on Arc; data.refund is "REFUNDED"), each at most once per session. Each event is a POST of { id, type, createdAt, data: <the session> } with Tyzer-Event-Id and Tyzer-Signature: t=<unix>,v1=<hex>, an HMAC-SHA256 of t + "." + body with your webhook secret. Answer any 2xx. Failed deliveries are retried with backoff for 24 hours with the same id and body, so drop ids you have seen. GET /v1/checkout/events lists recent events and their delivery state. The URL must be https on a public address.

import { createHmac, timingSafeEqual } from "node:crypto";
function verifyTyzer(rawBody: string, header: string, secret: string): boolean {
  const m = /^t=([0-9]+),v1=([0-9a-f]{64})$/.exec(header ?? "");
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false;
  const want = Buffer.from(createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest("hex"));
  return timingSafeEqual(Buffer.from(m[2]), want);
}

A button

<a href="{session.url}" style="display:inline-block;padding:12px 18px;border-radius:12px;background:#1f4a35;color:#fff;font:600 15px system-ui;text-decoration:none">Pay with Tyzer</a>

No server yet? Open tyzer.app/checkout/new signed in with your shop wallet, enter an amount, and show the buyer the QR code.

Refunds stay with your wallet's passkey: open the paid session's link signed in with your shop wallet and choose Refund the buyer. The API can never move your money.

Public endpoints

No sign-in needed. Responses are JSON. Only /x402/* sends CORS headers, so call these from a server.

EndpointReturns
GET /v1/public/profile/:username{ username, handle, displayName, bio, walletShort, avatarVersion, bannerVersion, telegramBot, whatsappNumber }. Never balances or payments. 404 for an unknown name. This is the username lookup.
GET /v1/public/profile/:username/avatar, /bannerThe image (PNG, JPEG or WebP), with ETag. Same-origin only: other sites cannot embed it.
GET /v1/public/channels{ channels: [{ channel, url, handle }] }: the official Tyzer accounts. Read handles from here instead of hard-coding them.
GET /v1/public/fxDisplay-only exchange rates: { fx: null | { asOf, ratesMicro: { "INR": "84100000" } } }, local units per USDC times 106.
GET /healthz{ ok: true }: the process is up. It says nothing about payments settling.

Contracts on Arc testnet

ContractAddress
USDC (also Arc's gas token)0x3600000000000000000000000000000000000000
EntryPoint v0.8 (ERC-4337)0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108
ClaimVault V3 (held payments)0xfa53c5CBbCA4c47cB7b75a07c0cf2d20F4F26442
RecipientBindingRegistry0xf0C43cF2BDCEb992E4Bf0e4338126125D0a3B290
PasskeyAccountFactory0xe0C23bA8D990Ca2647A9F1BeED06499349F13dd1
SponsorPaymaster0x944867b00984af29E746c677Ac8697a04CB44C19
AllowanceSpender0xedD7382ceC8285AfA07dD9D0972AC5ddC31781C3

Explorer: explorer.testnet.arc.io. Read decimals() from the token rather than assuming it. The source of all four is verified on the explorer, so you can read exactly what runs. They are testnet builds and have not been audited.

How money is authorized

  • People have an ERC-4337 smart account controlled by one passkey (WebAuthn P-256), bound to tyzer.app. The passkey signs the UserOperation hash, which commits to the whole payment.
  • Chat never authorizes money. A chat message or a model's output only creates a draft. The person approves the exact amount and recipient on the approve page.
  • Agents sign their own x402 payments with their own key, within what they hold.
  • Small-payment allowance: a person can grant a bounded session key with their passkey; the contract caps it.
  • Tyzer's relayer only submits and pays gas. It cannot change a signed payment or choose a recipient.
  • Held payments are released only by the sender, only to the wallet bound in the registry to the identity they paid.

Limits and support

  • x402: 0.01 to 100 USDC a payment, 30 requests a minute per client, authorizations valid for at most one hour.
  • Testnet only. Get test USDC for an agent at faucet.circle.com (Arc Testnet).
  • Checkout: up to 50 USDC a session, 120 API calls a minute per merchant.
  • Only checkout sends webhooks. For x402, watch the chain for AuthorizationUsed and Transfer events, or keep the 200 receipt.
  • Questions or a bug: DM @Tyzerapp on X.