Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Add payment-sessions, walk-leaderboard, and world-lines docs; x402-mcp examples; seed tx-uniqueness test

nirholas0731b49fcf83
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4aedf9396..4a22e68bd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Money Pulse volume restored: shared treasury wallets now refill against their strictest floor** — The autonomous economy's treasury refill sweep judged a wallet shared by two roles against the more permissive role's minimum balance, so the circulation treasury could sit nearly empty without ever qualifying for a top-up. With no measured shortfall, the USDC-to-SOL refuel lane stayed idle too, and the Money Pulse quietly dropped to free actions only. Shared wallets are now topped up once but held to the strictest floor across all their roles, so paid activity (tips, agent payments, trades, launches) self-heals instead of flatlining. `[fix, infra]`
- **New engineering post: how our 3D generation runs on NVIDIA L4 and Blackwell GPUs** — A long-form write-up of what it actually took to get the high-realism image-to-3D lane onto newer NVIDIA hardware, published for anyone building on the same stack. It covers the memory ceiling that killed every startup of the new model, why the GPU driver software had to be rebuilt for the newer card, the regional capacity limits that made the bigger GPU the easier one to get, and a nine-point checklist for teams doing the same port. The NVIDIA documentation pages on three.ws are now cross-linked and registered in the sitemap, so the free model map and the Developer Forums write-up are discoverable from search and from the docs front door. (`/blog/image-to-3d-on-nvidia-l4-and-blackwell`) `[docs, infra]`
- **New guide: how to charge other agents for your own tools** — A complete, hands-on walkthrough of the seller side of agent payments, written for anyone who wants their code to earn money from other people's AI agents. It covers how to tell whether a capability is worth charging for, how to set a price in fractions of a cent, the exact ordering that keeps you honest (check the payment, do the work, only then take the money, so a failure never charges anyone), how to charge per tool inside an assistant connector, how to get listed where agents shop for paid services, and how to prove an assistant can find and buy your service with no human involved. Every example is real and every endpoint quoted is live, including one you can try from a terminal in one line. (`/blog/monetize-mcp-server-x402-paid-tools`) `[docs, sdk]`
+- **Our AWS Builder Center articles are now linked from the site and the docs** — three.ws has published two engineering deep dives on Amazon's official AWS Builder Center, and until now nothing on the site pointed at either of them. Both are now linked from the AWS partner page, indexed in the docs with a note on exactly which open-source code each one walks through, and announced in the news feed with working links to the live articles. The news feed also stopped mislabelling articles published elsewhere as posts from X, so every piece is now credited to the place it actually appeared. (`/aws`) `[docs, improvement]`
- **Paid requests stop being refused after they were already served** — When someone pays for one of our endpoints, we broadcast their payment to Solana and confirm it. Before broadcasting, we asked one of our own nodes to dry-run it first. But the payer builds and signs their payment against their own node, so if the node that answered us happened to be running a few slots behind, it had simply never seen the reference the payment was built against and rejected it as unknown. The payment was perfectly valid. Because that check runs after we have already done the paid work, the caller was charged effort and then handed an error. We now hand that decision to the network itself rather than to whichever of our nodes replied: if the payment is still live it goes through, and if it has genuinely expired it is dropped without landing and without a fee. Resending is safe because Solana ignores a duplicate of a payment it has already seen. Genuine faults, such as an underfunded account, are still refused on the first attempt as before. `[fix]`
- **Payment health now names the real cause when settlements stall** — The platform watches how many of its automated payments actually settle. When that number fell, the alert always said the same thing: payments are being rejected. That was misleading in the most common case, where nothing is rejected at all. The platform simply stops offering Solana as a payment option while its sponsor wallet is topped up, so its own agents have nothing they can pay. The health report now tells these two situations apart by name, counts how often the Solana option was unavailable, and points at the one-command self-repair instead of sending whoever is on call to the wrong system. `[infra, improvement]`
- **Payment Sessions, the developer platform, and the media APIs are now documented** — Three new developer guides: Payment Sessions (fund a capped spend envelope from prepaid credits and let an agent pay x402 services with a bearer token, no private key involved), the developer platform (API keys, usage metrics, signed webhooks, the one-call MCP connection test, and the public tool and skills catalogs), and the media and render API (avatar image renders, posed clip renders, the runtime GLB optimizer, the open model proxy, and the free vision and speech-to-text endpoints). Every endpoint ships with a runnable example. (`/docs/payment-sessions`) `[docs]`
diff --git a/README.md b/README.md
index 5e329ff24..4ae60cda7 100644
--- a/README.md
+++ b/README.md
@@ -9002,17 +9002,24 @@ The loader ([public/artifact.js](public/artifact.js)) mounts a rotatable 3D view
## Tutorials
-Step-by-step guides in [`docs/tutorials/`](docs/tutorials/):
-
-| Tutorial | What you'll build | Time |
-| -------------------------------------------------------------- | -------------------------------------------------------------------- | ------- |
-| [Turn a Text Prompt into a 3D Model](docs/tutorials/text-to-3d.md) | A real, textured, downloadable 3D model from a one-line description | ~5 min |
-| [Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md) | A GLB reconstructed from 1–4 photos of a real object | ~10 min |
-| [Build Your First Agent](docs/tutorials/first-agent.md) | A talking 3D character on a shareable page, from zero | ~20 min |
-| [Embed on Your Website](docs/tutorials/embed-on-website.md) | Add an agent to any page — plain HTML, React, Webflow, WordPress | ~15 min |
-| [Write a Custom Skill](docs/tutorials/custom-skill.md) | A new tool the agent can call (e.g., fetch live weather data) | ~30 min |
-| [Register On-Chain](docs/tutorials/register-onchain.md) | Mint your agent onchain — ERC-8004 on EVM or Metaplex Core on Solana | ~20 min |
-| [Build a Personal AI Site](docs/tutorials/personal-ai-site.md) | A full personal site with an embedded AI version of yourself | ~45 min |
+54 step-by-step guides ship in [`docs/tutorials/`](docs/tutorials/), and every one is published live at [three.ws/tutorials](https://three.ws/tutorials). The core path:
+
+| Tutorial | What you'll build | Time | Live |
+| -------------------------------------------------------------- | -------------------------------------------------------------------- | ------- | ---- |
+| [Turn a Text Prompt into a 3D Model](docs/tutorials/text-to-3d.md) | A real, textured, downloadable 3D model from a one-line description | ~5 min | [open](https://three.ws/tutorials/text-to-3d) |
+| [Turn Photos into a 3D Model](docs/tutorials/image-to-3d.md) | A GLB reconstructed from 1-4 photos of a real object | ~10 min | [open](https://three.ws/tutorials/image-to-3d) |
+| [Build Your First Agent](docs/tutorials/first-agent.md) | A talking 3D character on a shareable page, from zero | ~20 min | [open](https://three.ws/tutorials/first-agent) |
+| [Embed on Your Website](docs/tutorials/embed-on-website.md) | Add an agent to any page: plain HTML, React, Webflow, WordPress | ~15 min | [open](https://three.ws/tutorials/embed-on-website) |
+| [Write a Custom Skill](docs/tutorials/custom-skill.md) | A new tool the agent can call (e.g., fetch live weather data) | ~30 min | [open](https://three.ws/tutorials/custom-skill) |
+| [Register On-Chain](docs/tutorials/register-onchain.md) | Mint your agent onchain: ERC-8004 on EVM or Metaplex Core on Solana | ~20 min | [open](https://three.ws/tutorials/register-onchain) |
+| [Build a Personal AI Site](docs/tutorials/personal-ai-site.md) | A full personal site with an embedded AI version of yourself | ~45 min | [open](https://three.ws/tutorials/personal-ai-site) |
+
+Beyond the core path, the catalog covers every surface in this README. A sampler, grouped by what you want to do:
+
+- **Embed & integrate:** [Embed in 30 seconds](https://three.ws/tutorials/embed-in-30-seconds) · [Add a 3D assistant to your app](https://three.ws/tutorials/add-a-3d-assistant) · [Build a site concierge](https://three.ws/tutorials/build-a-site-concierge) · [Shopify shopping assistant](https://three.ws/tutorials/shopify-shopping-assistant) · [JS API and events](https://three.ws/tutorials/js-api-events) · [Trigger from page events](https://three.ws/tutorials/trigger-from-page-events)
+- **Avatars & 3D:** [Selfie to avatar](https://three.ws/tutorials/selfie-to-avatar) · [Animate your avatar](https://three.ws/tutorials/animate-your-avatar) · [Build a 3D scene](https://three.ws/tutorials/build-a-scene) · [View in AR](https://three.ws/tutorials/view-in-ar) · [Upload a custom GLB](https://three.ws/tutorials/upload-custom-glb) · [Voice and lip-sync](https://three.ws/tutorials/voice-and-lipsync)
+- **Agents & AI:** [Connect an AI brain](https://three.ws/tutorials/connect-ai-brain) · [Agent personality](https://three.ws/tutorials/agent-personality) · [Create and edit memory](https://three.ws/tutorials/create-and-edit-memory) · [Multi-agent coordination](https://three.ws/tutorials/multi-agent-coordination) · [MCP server for your agent](https://three.ws/tutorials/mcp-server-for-your-agent)
+- **On-chain & payments:** [Claim your threews.sol name](https://three.ws/tutorials/claim-threews-name) · [Mint a pump.fun token](https://three.ws/tutorials/mint-pumpfun-token) · [Mine a vanity address](https://three.ws/tutorials/mine-vanity-address) · [x402 server SDK](https://three.ws/tutorials/x402-server-sdk) · [Solana agent reputation](https://three.ws/tutorials/solana-agent-reputation)
### Common gotchas
@@ -9740,28 +9747,27 @@ The driver is source-agnostic: it accepts any `AudioBuffer`, so it works identic
| Demo | Path | What it shows |
| ----------------------------------- | -------------------------------- | -------------------------------------------------------- |
-| **USDZ & AR Quick Look** | `/demos/usdz-ar.html` | iOS USDZ export + AR Quick Look on a real device |
-| **Half-body XR** | `/demos/halfbody-xr.html` | Upper-body avatar in WebXR (Meta Quest, Vision Pro) |
-| **Avatar SDK** | `/demos/avatar-sdk.html` | `@three-ws/avatar` SDK loading + animating an avatar |
-| **React SDK** | `/demos/react-sdk.html` | React wrapper around the `<agent-3d>` element |
-| **Audio-driven lipsync (mic)** | `/lipsync/mic` | Live microphone → ARKit-52 lip-sync |
-| **Audio-driven lipsync (TTS)** | `/lipsync` | ElevenLabs TTS → ARKit-52 lip-sync |
-| **Multi-LLM brain** | `/brain` | Side-by-side comparison of Claude / GPT / Groq / Gemini |
-| **ERC-8004 registry browser** | `/demos/erc8004.html` | Browse all registered agents across chains |
-| **Button jump** | `/demos/button-jump.html` | Avatar reacts to a 2D button press |
-| **Tactile button (Gemini concept)** | `/demos/gemini-jump.html` | Tactile button demo with avatar |
-| **Create v2** | `/demos/create-v2.html` | Next-generation agent creation flow |
-| **3D home** | `/demos/3d-home.html` | Home page with overlay canvas + transparent-bg viewer |
-| **Selfie fit** | `/demos/selfie-fit.html` | Selfie reconstruction pipeline (Phase 1) |
-| **Persona extract** | `/demos/persona-extract.html` | Voice & Persona Hub onboarding interview |
-| **Memory seed** | `/demos/memory-seed.html` | Memory seeding from X/GitHub/Farcaster |
-| **Voice clone** | `/demos/voice-clone.html` | 3–10s recording → ElevenLabs custom voice |
-| **Livepeer inference** | `/demos/livepeer-inference.html` | Decentralized GPU inference end-to-end |
-| **Skill royalty** | `/demos/skill-royalty.html` | Per-call royalty payouts to skill authors |
-| **EAS reputation** | `/demos/eas-reputation.html` | EAS-attested reputation viewer |
-| **Bonding curve** | `/demos/bonding-curve.html` | Pre-launch bonding-curve pricing simulator |
-| **Gallery picker** | `/demos/gallery-picker.html` | Lazy 3D-thumbnail avatar picker (Embed Editor primitive) |
-| **Button** | `/demos/button.html` | Minimal `<agent-3d>` embed reaction test |
+| **USDZ & AR Quick Look** | [`/demos/usdz-ar.html`](https://three.ws/demos/usdz-ar.html) | iOS USDZ export + AR Quick Look on a real device |
+| **Half-body XR** | [`/demos/halfbody-xr.html`](https://three.ws/demos/halfbody-xr.html) | Upper-body avatar in WebXR (Meta Quest, Vision Pro) |
+| **Avatar SDK** | [`/demos/avatar-sdk.html`](https://three.ws/demos/avatar-sdk.html) | `@three-ws/avatar` SDK loading + animating an avatar |
+| **React SDK** | [`/demos/react-sdk.html`](https://three.ws/demos/react-sdk.html) | React wrapper around the `<agent-3d>` element |
+| **Audio-driven lipsync (mic)** | [`/lipsync/mic`](https://three.ws/lipsync/mic) | Live microphone → ARKit-52 lip-sync |
+| **Audio-driven lipsync (TTS)** | [`/lipsync`](https://three.ws/lipsync) | ElevenLabs TTS → ARKit-52 lip-sync |
+| **Multi-LLM brain** | [`/brain`](https://three.ws/brain) | Side-by-side comparison of Claude / GPT / Groq / Gemini |
+| **ERC-8004 registry browser** | [`/demos/erc8004.html`](https://three.ws/demos/erc8004.html) | Browse all registered agents across chains |
+| **Button jump** | [`/demos/button-jump.html`](https://three.ws/demos/button-jump.html) | Avatar reacts to a 2D button press |
+| **Create v2** | [`/demos/create-v2.html`](https://three.ws/demos/create-v2.html) | Next-generation agent creation flow |
+| **3D home** | [`/demos/3d-home.html`](https://three.ws/demos/3d-home.html) | Home page with overlay canvas + transparent-bg viewer |
+| **Selfie fit** | [`/demos/selfie-fit.html`](https://three.ws/demos/selfie-fit.html) | Selfie reconstruction pipeline (Phase 1) |
+| **Persona extract** | [`/demos/persona-extract.html`](https://three.ws/demos/persona-extract.html) | Voice & Persona Hub onboarding interview |
+| **Memory seed** | [`/demos/memory-seed.html`](https://three.ws/demos/memory-seed.html) | Memory seeding from X/GitHub/Farcaster |
+| **Voice clone** | [`/demos/voice-clone.html`](https://three.ws/demos/voice-clone.html) | 3–10s recording → ElevenLabs custom voice |
+| **Livepeer inference** | [`/demos/livepeer-inference.html`](https://three.ws/demos/livepeer-inference.html) | Decentralized GPU inference end-to-end |
+| **Skill royalty** | [`/demos/skill-royalty.html`](https://three.ws/demos/skill-royalty.html) | Per-call royalty payouts to skill authors |
+| **EAS reputation** | [`/demos/eas-reputation.html`](https://three.ws/demos/eas-reputation.html) | EAS-attested reputation viewer |
+| **Bonding curve** | [`/demos/bonding-curve.html`](https://three.ws/demos/bonding-curve.html) | Pre-launch bonding-curve pricing simulator |
+| **Gallery picker** | [`/demos/gallery-picker.html`](https://three.ws/demos/gallery-picker.html) | Lazy 3D-thumbnail avatar picker (Embed Editor primitive) |
+| **Button** | [`/demos/button.html`](https://three.ws/demos/button.html) | Minimal `<agent-3d>` embed reaction test |
The demos are intentionally separate from production routes (`/create`, `/avatars/[id]`, etc.) so the production flow keeps working while we test new ideas.
@@ -9800,38 +9806,38 @@ Fifteen packages ship from this repo, all published to npm under the **`@three-w
| Package | Install | What it does |
| --- | --- | --- |
-| [`@three-ws/avatar`](avatar-sdk/) | `npm i @three-ws/avatar` | 3D avatar viewer, creator iframe, AR/VR runtime + React bindings (`/react`) |
-| [`@three-ws/agent-ui`](agent-ui-sdk/) | `npm i @three-ws/agent-ui` | Drop a 3D avatar overlay into any UI; it reacts to buttons, inputs, and navigation |
-| [`@three-ws/avatar-schema`](packages/avatar-schema/) | `npm i @three-ws/avatar-schema` | JSON Schema + validator for on-chain avatar manifests |
-| [`@three-ws/viewer-presets`](packages/viewer-presets/) | `npm i @three-ws/viewer-presets` | Tuned light-rig, floor-reflection, and bloom presets for avatar viewers |
-| [`@three-ws/avatar-cli`](packages/avatar-cli/) | `npm i -g @three-ws/avatar-cli` | Scaffold, validate, hash, and preview avatar manifests from your shell or CI |
+| [`@three-ws/avatar`](avatar-sdk/) | [`npm i @three-ws/avatar`](https://www.npmjs.com/package/@three-ws/avatar) | 3D avatar viewer, creator iframe, AR/VR runtime + React bindings (`/react`) |
+| [`@three-ws/agent-ui`](agent-ui-sdk/) | [`npm i @three-ws/agent-ui`](https://www.npmjs.com/package/@three-ws/agent-ui) | Drop a 3D avatar overlay into any UI; it reacts to buttons, inputs, and navigation |
+| [`@three-ws/avatar-schema`](packages/avatar-schema/) | [`npm i @three-ws/avatar-schema`](https://www.npmjs.com/package/@three-ws/avatar-schema) | JSON Schema + validator for on-chain avatar manifests |
+| [`@three-ws/viewer-presets`](packages/viewer-presets/) | [`npm i @three-ws/viewer-presets`](https://www.npmjs.com/package/@three-ws/viewer-presets) | Tuned light-rig, floor-reflection, and bloom presets for avatar viewers |
+| [`@three-ws/avatar-cli`](packages/avatar-cli/) | [`npm i -g @three-ws/avatar-cli`](https://www.npmjs.com/package/@three-ws/avatar-cli) | Scaffold, validate, hash, and preview avatar manifests from your shell or CI |
**Agents & payments**
| Package | Install | What it does |
| --- | --- | --- |
-| [`@three-ws/sdk`](sdk/) | `npm i @three-ws/sdk` | Ship an ERC-8004 agent: chat panel, voice I/O, on-chain registration, `.well-known` manifests |
-| [`@three-ws/solana-agent`](solana-agent-sdk/) | `npm i @three-ws/solana-agent` | Solana agent ops — keypair + browser wallet, transfers, swaps, x402 exact-scheme payments |
-| [`@three-ws/agent-payments`](agent-payments-sdk/) | `npm i @three-ws/agent-payments` | Agent-token payments — USDC/Token-2022, v2 trades, plus EVM / x402 / a2a / cross-chain |
+| [`@three-ws/sdk`](sdk/) | [`npm i @three-ws/sdk`](https://www.npmjs.com/package/@three-ws/sdk) | Ship an ERC-8004 agent: chat panel, voice I/O, on-chain registration, `.well-known` manifests |
+| [`@three-ws/solana-agent`](solana-agent-sdk/) | [`npm i @three-ws/solana-agent`](https://www.npmjs.com/package/@three-ws/solana-agent) | Solana agent ops: keypair + browser wallet, transfers, swaps, x402 exact-scheme payments |
+| [`@three-ws/agent-payments`](agent-payments-sdk/) | [`npm i @three-ws/agent-payments`](https://www.npmjs.com/package/@three-ws/agent-payments) | Agent-token payments: USDC/Token-2022, v2 trades, plus EVM / x402 / a2a / cross-chain |
**MCP servers** (run over stdio with one command — also in the [official MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas))
| Package | Run | What it does |
| --- | --- | --- |
-| [`@three-ws/mcp-server`](mcp-server/) | `npx -y @three-ws/mcp-server` | 16 tools: free text→3D (`forge_free`) + 15 paid x402 — text/image→3D, rigging, pose, pump.fun, ERC-8004, vanity, AgenC, aixbt |
-| [`@three-ws/avatar-agent`](packages/avatar-agent-mcp/) | `npx -y @three-ws/avatar-agent` | Spawn a textured GLB avatar with a Solana wallet, a voice, and pump.fun launch powers |
-| [`@three-ws/avatar-mcp`](packages/threews-avatar-mcp/) | `npx -y @three-ws/avatar-mcp` | Render a live, rotatable on-chain avatar inline + a paste-anywhere embed (free) |
-| [`@three-ws/pumpfun-mcp`](packages/pumpfun-mcp/) | `npx -y @three-ws/pumpfun-mcp` | 23 free, read-only pump.fun + Solana tools — no API key |
-| [`@three-ws/three-token-mcp`](packages/three-token-mcp/) | `npx -y @three-ws/three-token-mcp` | Price, hold, and burn **$THREE** on Solana — deflation as an agent primitive |
-| [`@three-ws/ibm-watsonx-mcp`](packages/ibm-watsonx-mcp/) | `npx -y @three-ws/ibm-watsonx-mcp` | IBM watsonx.ai Granite (chat, generate, embed, forecast) with your own IBM key |
-| [`@three-ws/ibm-x402-mcp`](packages/ibm-x402-mcp/) | `npx -y @three-ws/ibm-x402-mcp` | Pay-per-use IBM Granite — USDC on Solana, no IBM account required |
-| [`@three-ws/mcp-bridge`](mcp-bridge/) | `npx -y @three-ws/mcp-bridge` | x402 universal payer — auto-pay any x402 endpoint on the open web, with Bazaar discovery + spend caps |
-| [`@three-ws/x402-mcp`](packages/x402-mcp/) | `npx -y @three-ws/x402-mcp` | Self-custodial x402 wallet — discover, inspect, and pay any x402 service in USDC |
-| [`@three-ws/scene-mcp`](packages/scene-mcp/) | `npx -y @three-ws/scene-mcp` | Compose a placed 3D diorama from one sentence, then browse the saved scene gallery |
-| [`@three-ws/intel-mcp`](packages/intel-mcp/) | `npx -y @three-ws/intel-mcp` | Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards |
-| [`@three-ws/vanity-mcp`](packages/vanity-mcp/) | `npx -y @three-ws/vanity-mcp` | Solana vanity-address bounty market — quote difficulty + USDC price, browse the board |
-| [`@three-ws/marketplace-mcp`](packages/marketplace-mcp/) | `npx -y @three-ws/marketplace-mcp` | Browse the public three.ws agent marketplace + skills catalog (read-only) |
-| [`@three-ws/naming-mcp`](packages/naming-mcp/) | `npx -y @three-ws/naming-mcp` | On-chain identity for agents — resolve .sol names, reverse-lookup wallets, check handles |
+| [`@three-ws/mcp-server`](mcp-server/) | [`npx -y @three-ws/mcp-server`](https://www.npmjs.com/package/@three-ws/mcp-server) | 16 tools: free text→3D (`forge_free`) + 15 paid x402: text/image→3D, rigging, pose, pump.fun, ERC-8004, vanity, AgenC, aixbt |
+| [`@three-ws/avatar-agent`](packages/avatar-agent-mcp/) | [`npx -y @three-ws/avatar-agent`](https://www.npmjs.com/package/@three-ws/avatar-agent) | Spawn a textured GLB avatar with a Solana wallet, a voice, and pump.fun launch powers |
+| [`@three-ws/avatar-mcp`](packages/threews-avatar-mcp/) | [`npx -y @three-ws/avatar-mcp`](https://www.npmjs.com/package/@three-ws/avatar-mcp) | Render a live, rotatable on-chain avatar inline + a paste-anywhere embed (free) |
+| [`@three-ws/pumpfun-mcp`](packages/pumpfun-mcp/) | [`npx -y @three-ws/pumpfun-mcp`](https://www.npmjs.com/package/@three-ws/pumpfun-mcp) | 23 free, read-only pump.fun + Solana tools: no API key |
+| [`@three-ws/three-token-mcp`](packages/three-token-mcp/) | [`npx -y @three-ws/three-token-mcp`](https://www.npmjs.com/package/@three-ws/three-token-mcp) | Price, hold, and burn **$THREE** on Solana: deflation as an agent primitive |
+| [`@three-ws/ibm-watsonx-mcp`](packages/ibm-watsonx-mcp/) | [`npx -y @three-ws/ibm-watsonx-mcp`](https://www.npmjs.com/package/@three-ws/ibm-watsonx-mcp) | IBM watsonx.ai Granite (chat, generate, embed, forecast) with your own IBM key |
+| [`@three-ws/ibm-x402-mcp`](packages/ibm-x402-mcp/) | [`npx -y @three-ws/ibm-x402-mcp`](https://www.npmjs.com/package/@three-ws/ibm-x402-mcp) | Pay-per-use IBM Granite: USDC on Solana, no IBM account required |
+| [`@three-ws/mcp-bridge`](mcp-bridge/) | [`npx -y @three-ws/mcp-bridge`](https://www.npmjs.com/package/@three-ws/mcp-bridge) | x402 universal payer: auto-pay any x402 endpoint on the open web, with Bazaar discovery + spend caps |
+| [`@three-ws/x402-mcp`](packages/x402-mcp/) | [`npx -y @three-ws/x402-mcp`](https://www.npmjs.com/package/@three-ws/x402-mcp) | Self-custodial x402 wallet: discover, inspect, and pay any x402 service in USDC |
+| [`@three-ws/scene-mcp`](packages/scene-mcp/) | [`npx -y @three-ws/scene-mcp`](https://www.npmjs.com/package/@three-ws/scene-mcp) | Compose a placed 3D diorama from one sentence, then browse the saved scene gallery |
+| [`@three-ws/intel-mcp`](packages/intel-mcp/) | [`npx -y @three-ws/intel-mcp`](https://www.npmjs.com/package/@three-ws/intel-mcp) | Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards |
+| [`@three-ws/vanity-mcp`](packages/vanity-mcp/) | [`npx -y @three-ws/vanity-mcp`](https://www.npmjs.com/package/@three-ws/vanity-mcp) | Solana vanity-address bounty market: quote difficulty + USDC price, browse the board |
+| [`@three-ws/marketplace-mcp`](packages/marketplace-mcp/) | [`npx -y @three-ws/marketplace-mcp`](https://www.npmjs.com/package/@three-ws/marketplace-mcp) | Browse the public three.ws agent marketplace + skills catalog (read-only) |
+| [`@three-ws/naming-mcp`](packages/naming-mcp/) | [`npx -y @three-ws/naming-mcp`](https://www.npmjs.com/package/@three-ws/naming-mcp) | On-chain identity for agents: resolve .sol names, reverse-lookup wallets, check handles |
Per-server deep dives (every tool, argument, env var, and example): [Scenes](https://three.ws/docs/mcp-scenes) · [x402 Wallet](https://three.ws/docs/mcp-x402) · [Intel](https://three.ws/docs/mcp-intel) · [Vanity](https://three.ws/docs/mcp-vanity) · [Naming](https://three.ws/docs/mcp-naming) · [Marketplace](https://three.ws/docs/mcp-marketplace). Full catalog: [docs/mcp.md](docs/mcp.md).
@@ -9932,7 +9938,7 @@ The full OpenAPI 3.1 spec is available at `/openapi.json`. The key API surface i
Cron schedules are declared in `vercel.json` (still the live cron/route config the server reads) and executed in production by **Google Cloud Scheduler**, which calls each endpoint on its schedule. All cron endpoints are fail-closed — a missing auth token aborts with an error rather than silently skipping (see [Security Hardening](#security-hardening)).
-The ~80 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.
+The 101 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.
| Schedule | Endpoint | Purpose |
| -------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -10017,7 +10023,7 @@ Access tokens are short-lived JWTs (1 hour). Refresh tokens are opaque strings s
**Endpoint:** `POST /api/mcp` (tools), `GET /api/mcp` (SSE), `DELETE /api/mcp` (session terminate)
**Auth:** OAuth 2.1 Bearer token with `mcp` scope; some tools additionally require x402 USDC payment
-**Registry:** Listed on the [official MCP Registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas) as `io.github.nirholas/three.ws` — one of 42 three.ws MCP servers in the registry. Also discoverable on [Smithery](https://smithery.ai/search?q=three.ws), [Glama](https://glama.ai/mcp/servers?query=three.ws), and [PulseMCP](https://www.pulsemcp.com/servers?q=three.ws).
+**Registry:** Listed on the [official MCP Registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas) as `io.github.nirholas/three.ws`, alongside the other three.ws servers published under the `io.github.nirholas` namespace (`threews-3d-studio`, `threews-avatar`, `threews-pumpfun`, `threews-x402-bazaar`, `three-token-mcp`, and more). Also discoverable on [Smithery](https://smithery.ai/search?q=three.ws), [Glama](https://glama.ai/mcp/servers?query=three.ws), and [PulseMCP](https://www.pulsemcp.com/servers?q=three.ws).
**x402scan:** [view on x402scan](https://www.x402scan.com/server/17cbd874-52ac-4920-a020-b22ff2489a07) — paid MCP tool calls and revenue
**Available tools:**
@@ -10192,9 +10198,9 @@ three.ws is available on major cloud marketplaces and open to infrastructure par
| Cloud | Status |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| **AWS** | **AWS Partner** (APN Software Path). AWS Marketplace SaaS listing in review — see [docs/aws-marketplace.md](docs/aws-marketplace.md) and the public partner page at [three.ws/aws](https://three.ws/aws). Part of the stack runs on AWS `us-east-1` — the Forge sculptor Lambda (`three-ws-forge`) and the S3 avatar bucket — registered in AWS MyApplications under account `155407237916` (the main app runs on Google Cloud Run). |
+| **AWS** | **AWS Partner** (APN Software Path). AWS Marketplace SaaS listing in review: see [docs/aws-marketplace.md](docs/aws-marketplace.md) and the public partner page at [three.ws/aws](https://three.ws/aws). Part of the stack runs on AWS `us-east-1` (the Forge sculptor Lambda `three-ws-forge` and the S3 avatar bucket), registered in AWS MyApplications under account `155407237916` (the main app runs on Google Cloud Run). We publish engineering write-ups on the AWS Builder Center as [@threews](https://builder.aws.com/community/@threews); the index is [docs/aws-builder-center.md](docs/aws-builder-center.md). |
| **Alibaba Cloud** | Live: [product listing →](https://marketplace.alibabacloud.com/products/56724001/sgcmfw00036800.html) · [storefront →](https://marketplace.alibabacloud.com/store/3247293.html) |
-| **Google Cloud** | Production runs on **Google Cloud Run** (`three-ws-api`, `us-central1`) fronted by a global HTTPS load balancer + Cloud CDN, with all 100 scheduled jobs on Cloud Scheduler and GPU inference workers on Cloud Run — a natural fit for GCP's AI infrastructure and Vertex AI. Open to co-listing, credits, and joint GTM. |
+| **Google Cloud** | Production runs on **Google Cloud Run** (`three-ws-api`, `us-central1`) fronted by a global HTTPS load balancer + Cloud CDN, with all 101 scheduled jobs on Cloud Scheduler and GPU inference workers on Cloud Run: a natural fit for GCP's AI infrastructure and Vertex AI. Open to co-listing, credits, and joint GTM. |
## Ecosystem Directories
@@ -10373,23 +10379,23 @@ See [`contracts/DEPLOYMENTS.md`](contracts/DEPLOYMENTS.md) for current mainnet a
**Mainnet (across Ethereum, Optimism, BSC, Gnosis, Polygon, Fantom, zkSync Era, Moonbeam, Mantle, Base, Arbitrum One, Celo, Avalanche, Linea, Scroll):**
-| Contract | Address |
-| ------------------ | -------------------------------------------- |
-| IdentityRegistry | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` |
-| ReputationRegistry | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` |
-| ValidationRegistry | _(same address on all chains)_ |
+| Contract | Address | Proof |
+| ------------------ | -------------------------------------------- | ----- |
+| IdentityRegistry | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` | [Basescan](https://basescan.org/address/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432) · [Etherscan](https://etherscan.io/address/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432) |
+| ReputationRegistry | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` | [Basescan](https://basescan.org/address/0x8004BAa17C55a88189AE136b182e5fdA19dE9b63) · [Etherscan](https://etherscan.io/address/0x8004BAa17C55a88189AE136b182e5fdA19dE9b63) |
+| ValidationRegistry | not yet deployed on mainnet | see [contracts/DEPLOYMENTS.md](contracts/DEPLOYMENTS.md) |
**Testnet (BSC Testnet, Ethereum Sepolia, Base Sepolia, Arbitrum Sepolia, Optimism Sepolia, Polygon Amoy, Avalanche Fuji):**
-| Contract | Address |
-| ------------------ | -------------------------------------------- |
-| IdentityRegistry | `0x8004A818BFB912233c491871b3d84c89A494BD9e` |
-| ReputationRegistry | `0x8004B663056A597Dffe9eCcC1965A193B7388713` |
-| ValidationRegistry | `0x8004Cb1BF31DAf7788923b405b754f57acEB4272` |
+| Contract | Address | Proof |
+| ------------------ | -------------------------------------------- | ----- |
+| IdentityRegistry | `0x8004A818BFB912233c491871b3d84c89A494BD9e` | [Base Sepolia](https://sepolia.basescan.org/address/0x8004A818BFB912233c491871b3d84c89A494BD9e) |
+| ReputationRegistry | `0x8004B663056A597Dffe9eCcC1965A193B7388713` | [Base Sepolia](https://sepolia.basescan.org/address/0x8004B663056A597Dffe9eCcC1965A193B7388713) |
+| ValidationRegistry | `0x8004Cb1BF31DAf7788923b405b754f57acEB4272` | [Base Sepolia](https://sepolia.basescan.org/address/0x8004Cb1BF31DAf7788923b405b754f57acEB4272) |
### CREATE2 Factory (ThreeWSFactory)
-A custom vanity-prefixed CREATE2 deployer at `0x00000000D49195AE81759cd247cFeDD9D0B479df` (7 leading zeros) is used to mint matching addresses across chains. The factory init code hash is `0x30f9d9020bf9622bbe7f8a1625d447efe350dfafd0a91e6dbd62d56547db835f`; bytecode is byte-identical on every deployed chain. Source is verified on each chain's explorer.
+A custom vanity-prefixed CREATE2 deployer at [`0x00000000D49195AE81759cd247cFeDD9D0B479df`](https://basescan.org/address/0x00000000D49195AE81759cd247cFeDD9D0B479df) (7 leading zeros) is used to mint matching addresses across chains. The factory init code hash is `0x30f9d9020bf9622bbe7f8a1625d447efe350dfafd0a91e6dbd62d56547db835f`; bytecode is byte-identical on every deployed chain. Source is verified on each chain's explorer.
### Audits & EAS
@@ -10964,7 +10970,7 @@ npm run build # frontend build to dist/ (only when frontend changed)
npm run deploy:gcp # check:dist + db:check, gcloud builds submit, purge CDN
```
-`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (100 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.
+`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (101 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.
**Environment variables** live on the Cloud Run service, not in `.env` files — inspect or update them with `gcloud run services describe/update three-ws-api --region us-central1`. See [Environment Variables](#environment-variables) for the full list.
diff --git a/api/_lib/migrations/20260626010000_payment_sessions.sql b/api/_lib/migrations/20260626010000_payment_sessions.sql
index 0c634fdb4..0a0b438e2 100644
--- a/api/_lib/migrations/20260626010000_payment_sessions.sql
+++ b/api/_lib/migrations/20260626010000_payment_sessions.sql
@@ -24,7 +24,9 @@
-- connector_ref — opaque reference to which wallet/connector to use (null = platform default)
-- status — 'active' | 'exhausted' | 'expired' | 'cancelled'
-- expires_at — hard expiry; payments rejected after this time
--- token_hash — bcrypt hash of the bearer token (token itself never stored)
+-- token_hash : HMAC-SHA256 of the bearer token, keyed by PAYMENT_SESSION_SECRET
+-- (see hashToken in api/_lib/pay/spend-governor.js; the token itself
+-- is never stored, and lookup is by id + hash so a stolen row is inert)
-- session_metadata — arbitrary JSON for caller bookkeeping
-- created_at / updated_at
diff --git a/api/_lib/rss-feed.js b/api/_lib/rss-feed.js
index 43cae2ff9..7fa9780b4 100644
--- a/api/_lib/rss-feed.js
+++ b/api/_lib/rss-feed.js
@@ -66,6 +66,11 @@ export async function loadCuratedItems({ includeDrafts = false } = {}) {
slug,
permalink: `${SITE_ORIGIN}${NEWS_PATH_PREFIX}/${slug}`,
externalLink,
+ // Where the item was first published. Most curated items are X posts, so
+ // that stays the default; articles published at a named venue (the AWS
+ // Builder Center, a partner blog) set external_source to be attributed
+ // correctly instead of being labelled as an X post.
+ externalSource: typeof e.external_source === 'string' && e.external_source ? e.external_source : 'X',
title: String(e.title),
author: typeof e.author === 'string' && e.author ? e.author : 'three.ws',
summary: typeof e.summary === 'string' ? e.summary : deriveSummary(e.body_html),
@@ -275,7 +280,7 @@ function renderItemXml(item) {
\t\t\t</media:content>`;
}
const bodyWithAttribution = item.externalLink
- ? `${item.bodyHtml}\n<p><em>Originally shared on <a href="${escapeAttr(item.externalLink)}" rel="noopener">X</a> — follow more updates at <a href="https://three.ws" rel="noopener">three.ws</a>.</em></p>`
+ ? `${item.bodyHtml}\n<p><em>Originally published on <a href="${escapeAttr(item.externalLink)}" rel="noopener">${escapeXml(item.externalSource)}</a>. Follow more updates at <a href="https://three.ws" rel="noopener">three.ws</a>.</em></p>`
: item.bodyHtml;
return `\t\t<item>
\t\t\t<title>${escapeXml(item.title)}</title>
diff --git a/api/_lib/x402/autonomous-registry.js b/api/_lib/x402/autonomous-registry.js
index 80b7f578d..602469733 100644
--- a/api/_lib/x402/autonomous-registry.js
+++ b/api/_lib/x402/autonomous-registry.js
@@ -2123,13 +2123,13 @@ const SELF_ENDPOINTS = [
{ ex: BRIDGE_ALERT_TTL_SECONDS },
);
console.warn(
- `[x402/bridge-status] ALERT: \${v.down_count} bridge(s) down — \${downBridges.join(', ')}`,
+ `[x402/bridge-status] ALERT: ${v.down_count} bridge(s) down: ${downBridges.join(', ')}`,
);
} else if (typeof v.down_count === 'number') {
await redis.del(BRIDGE_ALERT_KEY);
}
} catch (err) {
- console.warn(`[x402/bridge-status] alert write failed: \${err?.message || err}`);
+ console.warn(`[x402/bridge-status] alert write failed: ${err?.message || err}`);
}
},
},
diff --git a/api/cron/world-health.js b/api/cron/world-health.js
index fba949332..73bd90fbe 100644
--- a/api/cron/world-health.js
+++ b/api/cron/world-health.js
@@ -182,6 +182,11 @@ export default wrapCron(async (req, res) => {
const detail = missing
.map((m) => `${m.blueprintId || 'unknown'}: ${m.assetUrl} (${m.error || `HTTP ${m.status}`})`)
.join('\n');
+ // Log the URLs as well as alerting. sendOpsAlert dedups by signature for an
+ // hour and does not reach the logs, so a sustained gap left nothing in
+ // Cloud Logging to identify WHICH asset was missing; the less severe
+ // transient branch was strictly better instrumented than this one.
+ console.warn(`[world-health] missing assets: ${detail.replace(/\n/g, ' | ')}`);
sendOpsAlert('World asset MISSING', detail, {
// Signature keyed to the set of missing URLs so a new gap re-alerts but
// the same sustained outage dedups to once an hour.
diff --git a/api/cron/x402-seed-cron.js b/api/cron/x402-seed-cron.js
index b41781eb3..450b046db 100644
--- a/api/cron/x402-seed-cron.js
+++ b/api/cron/x402-seed-cron.js
@@ -129,7 +129,7 @@ function parseSolanaAccept(challengeBody) {
// Build and sign a USDC TransferChecked versioned transaction for x402.
// Caller provides a pre-fetched blockhash and mint to avoid per-call RPCs.
-function buildPaymentTx({ accept, buyer, blockhash, mintInfo, receiverAtaExists }) {
+export function buildPaymentTx({ accept, buyer, blockhash, mintInfo, receiverAtaExists, index = 0 }) {
const mint = new PublicKey(accept.asset);
const payTo = new PublicKey(accept.payTo);
const feePayer = new PublicKey(accept.extra.feePayer);
@@ -144,7 +144,19 @@ function buildPaymentTx({ accept, buyer, blockhash, mintInfo, receiverAtaExists
const ixs = [
ComputeBudgetProgram.setComputeUnitLimit({ units: 60_000 }),
- ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 }),
+ // The priority fee is what makes each transaction in a batch DISTINCT, and
+ // it has to be: every other input (blockhash, amount, accounts, decimals) is
+ // identical across the batch, so a fixed price made all N transactions
+ // byte-identical. Identical bytes mean one signature, and the paid endpoint
+ // derives paymentId by hashing the payment proof, so the whole batch
+ // collided on a single id: one call landed and the rest 409'd on
+ // writeConflict, while any that raced past the guard hit the chain as a
+ // duplicate signature and settled as `broadcast_failed` with empty
+ // simulation logs. Measured 2026-07-30: ~40 of 41 calls per tick lost, the
+ // single largest source of 4xx on the fleet at 2,403/hour.
+ // Cost of the spread is negligible: 60k CU * N microLamports is 0.06*N
+ // lamports, so a full batch adds a few lamports in total.
+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 1 + index }),
];
if (!receiverAtaExists) {
ixs.push(createAssociatedTokenAccountIdempotentInstruction(
@@ -328,8 +340,8 @@ export default wrapCron(async (req, res) => {
// ── Step 3: build the signed transactions (synchronous) ───────────────────
const affordable = plan.batch;
- const txBases = Array.from({ length: affordable }, () =>
- buildPaymentTx({ accept, buyer, blockhash, mintInfo, receiverAtaExists }),
+ const txBases = Array.from({ length: affordable }, (_, index) =>
+ buildPaymentTx({ accept, buyer, blockhash, mintInfo, receiverAtaExists, index }),
);
// ── Step 4: fire all in parallel ──────────────────────────────────────────
diff --git a/api/pay/execute.js b/api/pay/execute.js
index c21e9de06..27a26da21 100644
--- a/api/pay/execute.js
+++ b/api/pay/execute.js
@@ -285,7 +285,7 @@ export default wrap(async (req, res) => {
return json(res, 200, {
ok: true,
paid: false,
- note: 'Endpoint served response without a 402 — no payment needed.',
+ note: 'Endpoint served response without a 402. No payment needed.',
status: probeResult.status,
result: probeResult.result,
});
@@ -348,7 +348,7 @@ export default wrap(async (req, res) => {
headers: { 'X-PAYMENT': xPayment },
});
} catch (err) {
- // Network failure AFTER signing — chain state unknown, do NOT roll back.
+ // Network failure AFTER signing: chain state unknown, do NOT roll back.
await recordExecution({
sessionId: sessionRecord.id,
userId: sessionRecord.user_id,
@@ -366,7 +366,7 @@ export default wrap(async (req, res) => {
idempotencyKey,
}).catch(() => {});
return error(res, 502, 'settle_uncertain',
- 'Payment was submitted but confirmation was not received — do not retry immediately.');
+ 'Payment was submitted but confirmation was not received. Do not retry immediately.');
}
const paidJson = safeJson(paid.text) ?? paid.text;
@@ -395,7 +395,7 @@ export default wrap(async (req, res) => {
idempotencyKey,
}).catch(() => {});
return error(res, 402, 'payment_rejected',
- 'Service rejected the payment before settlement — budget has been restored.',
+ 'Service rejected the payment before settlement. Budget has been restored.',
typeof paidJson === 'object' ? paidJson : null);
}
diff --git a/data/changelog.json b/data/changelog.json
index ff922fdc4..39cb5a6ad 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-30",
+ "title": "Our AWS Builder Center articles are now linked from the site and the docs",
+ "summary": "three.ws has published two engineering deep dives on Amazon's official AWS Builder Center, and until now nothing on the site pointed at either of them. Both are now linked from the AWS partner page, indexed in the docs with a note on exactly which open-source code each one walks through, and announced in the news feed with working links to the live articles. The news feed also stopped mislabelling articles published elsewhere as posts from X, so every piece is now credited to the place it actually appeared.",
+ "tags": [
+ "docs",
+ "improvement"
+ ],
+ "link": "/aws"
+ },
{
"date": "2026-07-30",
"title": "Skill trials in the agent marketplace can finally turn into real purchases",
diff --git a/data/rss/items.json b/data/rss/items.json
index 6a0eac394..d305bd3be 100644
--- a/data/rss/items.json
+++ b/data/rss/items.json
@@ -1,6 +1,21 @@
{
"_readme": "Curated RSS items for https://three.ws/rss/announcements.xml. Edit this file to control exactly what HackerNoon (and any RSS reader) sees. Each entry needs: id (stable slug), title, date (ISO 8601), body_html. Optional: link, author, summary, tags. Items are served newest-first by date; cap is 80. Last merged from data/archives/trythreews_tweets_2026-06-03.json on 2026-06-05 (102 total items, merged June 2026 posts).",
"items": [
+ {
+ "id": "monetize-mcp-server-x402-paid-tools",
+ "slug": "monetize-mcp-server-x402-paid-tools",
+ "title": "How to Monetize an MCP Server: Paid Tools with x402",
+ "date": "2026-07-30T12:00:00.000Z",
+ "author": "three.ws",
+ "link": "https://three.ws/blog/monetize-mcp-server-x402-paid-tools",
+ "summary": "The seller-side guide to agent payments: choose work worth charging for, price it in atomic USDC units, answer unpaid calls with a real 402, verify then work then settle, charge per tool inside an MCP tools/call, and get indexed where agents shop for paid services.",
+ "body_html": "<p><strong>The Model Context Protocol solved distribution for tools and left payment unsolved</strong>, because every payment system on the web assumes a human with a credit card completes a signup form. An autonomous agent has a wallet, not an inbox.</p>\n<h2>What the guide covers</h2>\n<ul>\n<li>How to tell whether a capability is worth charging for, and how to price it in fractions of a cent.</li>\n<li>Wrapping a route so unpaid requests receive a real <code>402 Payment Required</code> challenge, on Solana first with Base as a second accept.</li>\n<li>The ordering that keeps it honest: verify the payment, do the work, only then settle, so a failure charges nobody and a retry cannot double-charge.</li>\n<li>Charging per tool inside an MCP <code>tools/call</code> using the <code>_meta</code> payment convention, plus why every paid connector should ship one free explainer tool.</li>\n<li>Getting listed in the x402 bazaar where agents shop for paid capabilities, and proving an assistant can buy your service unattended with spend caps in place.</li>\n</ul>\n<p>Every example is real and the production endpoint quoted in the article returns a live 402 you can inspect from a terminal in one line. Read it: <a href=\"https://three.ws/blog/monetize-mcp-server-x402-paid-tools\" rel=\"noopener\">three.ws/blog/monetize-mcp-server-x402-paid-tools</a></p>",
+ "tags": [
+ "x402",
+ "mcp",
+ "agent-payments"
+ ]
+ },
{
"id": "quicknode-startup-program",
"slug": "quicknode-startup-program",
diff --git a/docs/aws-builder-center-agent-payment-sessions.md b/docs/aws-builder-center-agent-payment-sessions.md
new file mode 100644
index 000000000..4a964ee10
--- /dev/null
+++ b/docs/aws-builder-center-agent-payment-sessions.md
@@ -0,0 +1,446 @@
+---
+title: "Give your AI agent a budget, not a private key"
+venue: AWS Builder Center
+account: three.ws (official)
+status: draft
+description: "An autonomous agent that pays for tools needs spending power, and every shortcut for granting it ends with a private key inside a prompt-injectable loop. Here is the pattern we shipped instead: a Payment Session that separates custody from authority from execution, enforced atomically in Postgres, with the real code, the race condition, and the failure mode nobody writes about."
+tags: [agentic-ai, ai-agents, security, serverless, api]
+index: docs/aws-builder-center.md
+---
+
+# Give your AI agent a budget, not a private key
+
+There is a moment in every agentic build where the agent needs to buy something.
+
+Maybe it is a paid data feed mid-reasoning. Maybe it is another agent's tool. Maybe it is a rendering job it decided to queue. Whatever it is, the agent has hit a `402 Payment Required` and the loop stops, because the one thing your agent does not have is spending power.
+
+So you give it some. And this is where most designs quietly go wrong.
+
+The obvious move is to put a wallet key in the agent's environment. It works immediately, which is the problem: you have now placed an unbounded bearer credential inside a system whose entire job is to read untrusted text and decide what to do next. Prompt injection is not a hypothetical against that design. It is the design's specification.
+
+This is a walk through the pattern we shipped instead, in production, at [three.ws](https://three.ws). It is called a **Payment Session**, and the one-line version is:
+
+> The agent does not hold a wallet. It proposes spend. Governance enforces policy.
+
+Everything below is real code from our Apache 2.0 repository, including the concurrency bug we had to design around and the failure mode that has no clean answer.
+
+## The three bad options, and what each one actually costs
+
+Before the pattern, the alternatives, because the pattern only looks good next to them.
+
+| Approach | What the agent holds | What a compromise costs you | Why teams pick it |
+|---|---|---|---|
+| Hand the agent a wallet key | Full signing authority, forever | Everything in the wallet, plus everything the key can authorize later | It takes four minutes |
+| Give the agent a funded burner wallet | Full authority over a smaller pot | The burner's balance, plus a refill treadmill and dust stranded across dozens of addresses | It feels bounded |
+| Human-in-the-loop on every payment | Nothing | Nothing, but the agent is no longer autonomous | It is defensible in a review |
+
+The burner wallet is the interesting failure, because it looks like the right answer. It is bounded, so a compromise is capped. But you have replaced a security problem with an operations problem: every agent now needs funding, refunding, and sweeping, and capital disperses one way into wallets that never send it back. We ran a fleet like this. The dispersion, not the theft, is what hurt.
+
+What all three share is a category error. They conflate three separate concerns that only look like one:
+
+- **Custody**: who holds the key that signs.
+- **Authority**: who decides how much may be spent, on what, and until when.
+- **Execution**: who initiates a given payment.
+
+A private key fuses all three into one secret. Split them apart and the design gets much better very quickly.
+
+## The pattern
+
+```
+ Developer Platform Agent
+ ───────── ──────── ─────
+ funds a budget ──────> holds the keys <────── proposes a payment
+ sets the policy ──────> enforces the policy ──────> gets the result
+ signs the tx
+ logs everything
+```
+
+The developer creates a session: a budget envelope with a total, a per-transaction ceiling, a host allowlist, a network, and an expiry. In return they get a bearer token, once.
+
+They hand that token to the agent. The agent can now call paid endpoints. It cannot exceed the budget, cannot pay a host outside the allowlist, cannot spend after the expiry, and cannot sign anything itself, because the platform's wallet does the signing and the agent never sees a key.
+
+Custody sits with the platform. Authority sits with the developer. Execution sits with the agent. Compromising the agent gets an attacker exactly one thing: the remaining budget, spendable only at hosts you already approved, only until the session expires.
+
+That is not zero. It is a number you chose in advance, which is the entire point.
+
+## The data model
+
+Two tables. The session is the policy plus the counter, and the execution log is the immutable audit trail.
+
+```sql
+create table if not exists payment_sessions (
+ id uuid primary key default gen_random_uuid(),
+ user_id uuid not null references users(id) on delete cascade,
+ agent_id uuid references agent_identities(id) on delete set null,
+
+ label text not null default '',
+ budget_usdc bigint not null check (budget_usdc > 0),
+ spent_usdc bigint not null default 0 check (spent_usdc >= 0),
+ max_per_tx_usdc bigint check (max_per_tx_usdc > 0),
+ allowed_hosts text[] not null default '{}',
+ network text not null default 'solana' check (network in ('solana', 'base')),
+
+ status text not null default 'active'
+ check (status in ('active', 'exhausted', 'expired', 'cancelled')),
+ expires_at timestamptz not null,
+ token_hash text not null,
+
+ session_metadata jsonb not null default '{}'::jsonb,
+ created_at timestamptz not null default now(),
+ updated_at timestamptz not null default now()
+);
+```
+
+Three details in there are load-bearing.
+
+**Money is `bigint`, never `float`.** USDC has six decimals, so every amount is stored in atomic units and converted at the edges. A rounding error in a budget check is a security bug, not a display bug.
+
+```js
+export function usdToAtomics(usd) {
+ return BigInt(Math.round(Number(usd) * 1_000_000));
+}
+export function atomicsToUsd(atomics) {
+ return Number(atomics) / 1_000_000;
+}
+```
+
+**`spent_usdc` lives on the session row, not derived from the log.** It is tempting to compute spend with `SELECT sum(amount) FROM executions`. Do not. That number has to be checked and incremented in the same atomic operation as the authorization decision, and a sum over a second table cannot give you that without a lock you will regret. The log reconciles the counter; it does not replace it.
+
+**The token is never stored.** Only its HMAC is:
+
+```js
+const TOKEN_PREFIX = 'pss_';
+
+export function generateSessionToken(sessionId) {
+ const rand = randomBytes(16).toString('hex');
+ return `${TOKEN_PREFIX}${sessionId}_${rand}`;
+}
+
+export function hashToken(token) {
+ return createHmac('sha256', hmacKey()).update(String(token)).digest('hex');
+}
+```
+
+The session id is embedded in the token so lookup is a primary-key hit rather than a table scan over hashes, and verification is `WHERE id = $1 AND token_hash = $2`. A dumped database row is inert without the HMAC key; a leaked token is bounded by the policy on the row it points at.
+
+## The request path
+
+The agent makes one call: `POST /api/pay/execute` with a session token and a URL. Six phases run behind it.
+
+### Phase 0: verify the token before touching the network
+
+```js
+try {
+ await verifySessionToken(sessionToken);
+} catch (err) {
+ if (err instanceof SpendGovernorError) {
+ return error(res, err.status, err.code, err.message, err.detail);
+ }
+ throw err;
+}
+```
+
+Cheap check first. There is no reason to make an outbound request on behalf of a token that does not exist.
+
+### Phase 1: probe for the payment challenge
+
+x402 works over ordinary HTTP. You request the resource, and a paid endpoint answers `402` with a JSON body describing what it will accept: network, asset, amount, and where to send it. So we ask before we authorize, because until the endpoint tells us the price, there is no amount to check the policy against.
+
+```js
+let accept = challenge.accepts.find(
+ (a) => typeof a?.network === 'string' &&
+ a.network.startsWith('solana') &&
+ a.asset === USDC_SOLANA_MINT,
+);
+```
+
+If the endpoint answers with something other than a `402`, it was free, and we return the response without ever touching the session:
+
+```js
+if (probeResult.free) {
+ return json(res, 200, {
+ ok: true,
+ paid: false,
+ note: 'Endpoint served response without a 402. No payment needed.',
+ status: probeResult.status,
+ result: probeResult.result,
+ });
+}
+```
+
+Small thing, easy to skip, and it matters: an agent should not burn budget discovering that something was free.
+
+### Phase 2: the governor
+
+Now the policy runs, in order, cheapest and most decisive first: status, then expiry, then the allowlist, then the per-transaction ceiling, then the budget.
+
+The allowlist check is the one worth showing, because the subdomain rule is where these go wrong:
+
+```js
+const canonicalAllowlist = allowedHosts.map(normalizeHost).filter(Boolean);
+const allowed = canonicalAllowlist.some(
+ (h) => targetHost === h || targetHost.endsWith(`.${h}`),
+);
+```
+
+`targetHost.endsWith('.' + h)` and not `targetHost.endsWith(h)`. Without the dot, an allowlist entry of `example.com` also authorizes `evil-example.com`, and an attacker who can steer your agent to a URL just needs to register the right domain. Hosts are normalized through the URL parser first, so `HTTPS://Example.COM:443/x` and `example.com` compare equal.
+
+### Phase 3: the atomic reservation
+
+Here is the concurrency bug, and it is not a theoretical one. Agents are concurrent by nature. A single agent run can have three tool calls in flight, and a multi-agent orchestrator can have thirty.
+
+Read-then-write does not work:
+
+```
+Session budget: $1.00 remaining
+
+Request A: SELECT remaining -> $1.00. Enough for $0.80? Yes.
+Request B: SELECT remaining -> $1.00. Enough for $0.80? Yes.
+Request A: UPDATE spent = spent + 0.80
+Request B: UPDATE spent = spent + 0.80
+
+Spent: $1.60 against a $1.00 budget.
+```
+
+The fix is to make the check and the increment the same statement, and let the database resolve the race:
+
+```js
+const [updated] = await sql`
+ UPDATE payment_sessions
+ SET spent_usdc = spent_usdc + ${amount.toString()},
+ updated_at = now()
+ WHERE id = ${session.id}
+ AND status = 'active'
+ AND (budget_usdc - spent_usdc) >= ${amount.toString()}
+ RETURNING id, spent_usdc, budget_usdc
+`;
+```
+
+Row-level locking means the second `UPDATE` re-evaluates its `WHERE` clause against the first one's committed result. It matches zero rows, `updated` is undefined, and the caller gets a precise error rather than an overdraft:
+
+```js
+if (!updated) {
+ const [fresh] = await sql`
+ SELECT budget_usdc, spent_usdc FROM payment_sessions WHERE id = ${session.id}
+ `;
+ const remaining = fresh ? BigInt(fresh.budget_usdc) - BigInt(fresh.spent_usdc) : 0n;
+ throw new SpendGovernorError(
+ 'insufficient_budget',
+ `Insufficient session budget. Need $${atomicsToUsd(amount)}, remaining $${atomicsToUsd(remaining)}`,
+ { need_usd: atomicsToUsd(amount), remaining_usd: atomicsToUsd(remaining) },
+ );
+}
+```
+
+No advisory locks, no transaction retry loop, no distributed lock service. One statement whose `WHERE` clause is the invariant. If you take one thing from this article, take this: **write the budget check as a predicate in the `UPDATE`, not as a `SELECT` before it.**
+
+Note that this is a *reservation*, taken before the payment is attempted. Optimistic ordering, because the alternative is holding budget open across a network call to a third party.
+
+### Phase 4: sign and present
+
+The platform payer signs a Solana USDC transfer, serializes it, and presents it in the `X-PAYMENT` header on a retry of the original request. The agent's token never enters this path, and the keypair never leaves the server.
+
+```js
+const xPayment = Buffer.from(JSON.stringify(paymentPayload)).toString('base64');
+
+paid = await guardedFetch(targetUrl, {
+ method,
+ body: requestBody,
+ headers: { 'X-PAYMENT': xPayment },
+});
+```
+
+`guardedFetch` is not `fetch`. More on that below.
+
+### Phase 5: settle, or fail honestly
+
+This is the section most write-ups skip, and it is the one that decides whether you can run this in production.
+
+A payment has three possible outcomes, not two, and the third is the interesting one.
+
+**Rejected before settlement.** The service answers `402` again. No funds moved, so the reservation is safe to release and the budget goes back:
+
+```js
+if (paid.status === 402) {
+ await rollbackReservation(sessionRecord.id, amountAtomics).catch(() => {});
+ // ... record the failed execution ...
+ return error(res, 402, 'payment_rejected',
+ 'Service rejected the payment before settlement. Budget has been restored.');
+}
+```
+
+**Settled.** Log the tx hash, return the result, done.
+
+**Unknown.** The request was submitted and the connection died before an answer came back. The transaction may have landed on-chain. It may not have. We cannot know from here.
+
+```js
+} catch (err) {
+ // Network failure AFTER signing: chain state unknown, do NOT roll back.
+ await recordExecution({
+ /* ... */
+ status: 'failed',
+ errorCode: 'settle_uncertain',
+ errorMessage: err?.message,
+ }).catch(() => {});
+ return error(res, 502, 'settle_uncertain',
+ 'Payment was submitted but confirmation was not received. Do not retry immediately.');
+}
+```
+
+The comment carries the whole decision: **do not roll back.** Restoring the budget after a payment that may have settled means the next call can spend money that is already gone. So the session stays debited, the execution is logged as `settle_uncertain`, and the error message tells the caller not to retry blindly.
+
+This is worse for the user than an automatic refund and better than a silent double-spend. When you cannot know the truth, bias the accounting toward the conservative answer and make the uncertainty legible instead of hiding it. Every payment system reaches this fork. Most of them pretend they do not.
+
+Idempotency is the companion control. Every execution can carry a caller-supplied key with a `unique` constraint behind it, so a retried run cannot bill twice:
+
+```sql
+idempotency_key text unique,
+```
+
+## The target URL is attacker-influenced. Treat it that way.
+
+Step back and look at what this endpoint does: it takes a URL chosen (at least partly) by an LLM and makes a server-side request to it, from inside your infrastructure. That is a server-side request forgery primitive with a payment attached.
+
+So the fetch is guarded, and the guard runs before the payment is signed:
+
+```js
+async function guardedFetch(rawUrl, { method = 'GET', headers = {}, body } = {}) {
+ const url = validatePublicUrl(rawUrl);
+ const addrs = await resolvePublicHost(url.hostname);
+ const agent = pinnedAgent(url.hostname, addrs);
+ const controller = new AbortController();
+ const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
+ try {
+ const res = await fetch(url, {
+ method,
+ redirect: 'manual',
+ signal: controller.signal,
+ dispatcher: agent,
+ /* ... */
+ });
+```
+
+Four controls, each closing a specific hole:
+
+- `validatePublicUrl` rejects non-public schemes and address ranges: link-local, loopback, private space, and the cloud metadata endpoint at `169.254.169.254` that turns SSRF into credential theft on every major cloud.
+- `resolvePublicHost` resolves DNS and validates the answers, so a hostname that resolves into private space is caught.
+- `pinnedAgent` pins the connection to the addresses that were validated. Without this you have a DNS rebinding window between the check and the connect.
+- `redirect: 'manual'` stops a public URL from bouncing you to an internal one after validation has already passed.
+
+The allowlist is policy. This is the floor underneath it, and it applies even when a session sets no allowlist at all.
+
+## Wiring it into an agent
+
+The interface is an MCP server, so any client that speaks the Model Context Protocol gets these as ordinary tools. Nothing here is specific to a particular agent framework: it is an npm bridge to an HTTP API, so it drops into a Bedrock AgentCore agent, a Strands agent, a Claude Code session, or your own loop, without caring where the agent runs.
+
+```json
+{
+ "mcpServers": {
+ "three-ws-payments": {
+ "command": "npx",
+ "args": ["-y", "@three-ws/agentcore-payments-mcp"],
+ "env": {
+ "THREE_WS_SESSION": "__Host-sid=...",
+ "PAYMENT_SESSION_TOKEN": "pss_..."
+ }
+ }
+ }
+}
+```
+
+Create a session with the policy you are willing to live with:
+
+```json
+{
+ "budget_usd": 10.00,
+ "label": "Research agent, June sprint",
+ "expiry_seconds": 86400,
+ "max_per_tx_usd": 0.50,
+ "allowed_hosts": ["api.example.com", "data.provider.io"],
+ "network": "solana"
+}
+```
+
+Then the agent pays:
+
+```json
+{
+ "url": "https://api.example.com/data",
+ "method": "GET",
+ "session_token": "pss_...",
+ "idempotency_key": "run-42-fetch-data"
+}
+```
+
+It gets back the result it wanted plus the receipt it did not ask for: amount, network, payer, payee, transaction hash, explorer link, and the updated budget. The audit trail is a side effect of the design rather than an integration you have to remember to add.
+
+```json
+{
+ "ok": true,
+ "paid": true,
+ "result": { "...": "the endpoint's response" },
+ "payment": {
+ "amount_usd": 0.05,
+ "network": "solana",
+ "tx_hash": "...",
+ "explorer": "https://solscan.io/tx/...",
+ "pay_to": "..."
+ },
+ "session": { "spent_usd": 1.35, "remaining_usd": 8.65 }
+}
+```
+
+## Budgets that expire have to give the money back
+
+A budget is debited from the developer's credit balance the moment the session is created, which means an expiry that just marks a row `expired` quietly keeps their money. A sweep runs every five minutes and refunds the difference:
+
+```js
+const allExpired = await sql`
+ UPDATE payment_sessions
+ SET status = 'expired', updated_at = now()
+ WHERE status = 'active'
+ AND expires_at < now()
+ RETURNING id, user_id, budget_usdc, spent_usdc
+`;
+```
+
+Then, per row, with an idempotency key derived from the session id so overlapping ticks cannot double-refund:
+
+```js
+await creditAccount({
+ userId: row.user_id,
+ amountUsd: atomicsToUsd(refundAtomics),
+ kind: 'refund',
+ action: 'payment_session_expire',
+ refType: 'payment_session',
+ refId: row.id,
+ idempotencyKey: `paysess_expire_${row.id}`,
+});
+```
+
+The same refund path runs on manual cancellation. Short-lived sessions are the security posture we want people to adopt, so expiring one has to be free. If it costs the user money, they will set the TTL to a year and the control is gone.
+
+## What we would tell you to copy
+
+The specifics here are Solana, USDC, Postgres, and x402, and none of that is the transferable part. The pattern is:
+
+1. **Separate custody, authority, and execution.** Whatever your rail (a card token, an internal ledger, a cloud budget), do not let one credential carry all three. Everything else follows from this.
+2. **Give the agent a grant, not a key.** Bounded by amount, by destination, and by time. Then a compromise costs a number you picked instead of a number an attacker picks.
+3. **Enforce the budget as a predicate in the write.** `UPDATE ... WHERE remaining >= amount RETURNING` is the whole concurrency story. Read-then-write is an overdraft waiting for enough traffic.
+4. **Design the uncertain outcome first.** Success and rejection are easy. The submitted-but-unconfirmed case is the one that decides whether your accounting can be trusted, and it deserves an explicit state rather than a `catch` that guesses.
+5. **Assume the URL is hostile.** Any agent-driven outbound request is an SSRF primitive. Validate, resolve, pin, and refuse redirects, before anything is signed.
+6. **Make expiry cheap.** Refund on expiry and on cancel, idempotently, or nobody will use short sessions.
+
+An autonomous agent with a private key is a liability you cannot bound. An autonomous agent with a budget is a line item. The difference is about four hundred lines of code, and most of them are the boring ones.
+
+## Resources
+
+- **Source (Apache 2.0):** [`api/pay/execute.js`](https://github.com/nirholas/three.ws/blob/main/api/pay/execute.js) is the request path, [`api/_lib/pay/spend-governor.js`](https://github.com/nirholas/three.ws/blob/main/api/_lib/pay/spend-governor.js) is the governor, [`api/_lib/pay/payment-session.js`](https://github.com/nirholas/three.ws/blob/main/api/_lib/pay/payment-session.js) is the lifecycle
+- **MCP server:** [`@three-ws/agentcore-payments-mcp`](https://github.com/nirholas/three.ws/tree/main/packages/agentcore-payments-mcp)
+- **x402:** [x402.org](https://www.x402.org), the HTTP-native pay-per-call standard the payments settle over
+- **Model Context Protocol:** [modelcontextprotocol.io](https://modelcontextprotocol.io)
+- **Our previous Builder Center article:** [How we metered a SaaS product through AWS Marketplace with the AWS SDK for JavaScript v3](https://builder.aws.com/content/3ESpll50BdSp9eiCEIxcfG9pGUN/how-we-metered-a-saas-product-through-aws-marketplace-with-the-aws-sdk-for-javascript-v3), which covers the other half of this: how the credits that fund a session get billed to an AWS invoice
+
+---
+
+*three.ws is a verified AWS Partner and an open-source platform for 3D AI agents and on-chain communities, available on AWS Marketplace with AWS billing wired into its metered API. Live at [three.ws](https://three.ws).*
diff --git a/docs/aws-builder-center.md b/docs/aws-builder-center.md
index fe971b5b5..1c194347e 100644
--- a/docs/aws-builder-center.md
+++ b/docs/aws-builder-center.md
@@ -38,6 +38,7 @@ Written and reviewed in this repo, not yet submitted:
| Draft | Subject |
|---|---|
+| [aws-builder-center-agent-payment-sessions.md](./aws-builder-center-agent-payment-sessions.md) | Agent Payment Sessions: giving an agent a budget instead of a private key, and enforcing it atomically in Postgres |
| [aws-builder-center-mcp-agents.md](./aws-builder-center-mcp-agents.md) | An MCP server whose paid tools settle per call in USDC over HTTP 402 |
## Publishing checklist
diff --git a/docs/index.html b/docs/index.html
index dd5d894db..5fe715943 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -891,6 +891,7 @@
{ label: 'Skills system', path: 'skills' },
{ label: 'Multi-agent', path: 'multi-agent' },
{ label: 'IRL (agents in the real world)', path: 'irl' },
+ { label: 'World Lines (proof of presence)', path: 'world-lines' },
{ label: 'Permissions', path: 'permissions' },
{ label: 'Layers', path: 'layers' },
],
diff --git a/docs/start-here.md b/docs/start-here.md
index 7701891e7..efb1640e9 100644
--- a/docs/start-here.md
+++ b/docs/start-here.md
@@ -105,6 +105,7 @@ Curious what happens between the prompt and the model? [How the Forge works](./h
- **Rendering avatars outside the viewer?** → [Media and render API](./media-api.md): avatar PNG renders for `<img>` tags, posed clip renders, the runtime GLB optimizer, the CORS-open model proxy, and the free vision and speech-to-text endpoints; companion to the [3D API](./3d-api.md)
- **Minting your work on-chain?** → [Minted 3D assets](./minted.md): the /minted gallery of avatars minted as Metaplex Core NFTs, the opt-in mint flow, baked provenance, and enforced remix royalties
- **Letting an agent spend without your key?** → [Payment Sessions](./payment-sessions.md): fund a capped envelope from prepaid credits, hand the agent a bearer token, and it pays x402 endpoints under your caps and allowlist, refundable on cancel
+- **Earning proof you were somewhere?** → [World Lines](./world-lines.md): walk to an agent's real-world spot, complete its AR challenge, and its wallet signs an ed25519 proof of presence you own and anyone can verify. No coordinate finer than a roughly 1 km cell is ever stored
- **Driving an agent wallet from code?** → [The agent wallet control API](./agent-wallet-api.md): the reference for all seven owner-only surfaces on an agent's Solana wallet (scoped session keys, programmable orders, plain-language intents, Treasury Autopilot, portfolio P&L, guardians and the dead-man switch, and the anomaly guard), each with its exact JSON, every error, and a curl example
- **Turning a token into a paid endpoint?** → [CA to x402](./ca2x402.md): paste a contract address and get a live agent-payable market-intel endpoint, discoverable in the bazaar, with the generated snippets
- **Checking whether the economy is real?** → [Agent economy volume](./agent-economy-volume.md) counts only settled agent-to-agent USDC for paid skills, and [Viability](./viability.md) shows the unit economics (GMV, take rate, repeat buyers, realized P&L) from on-chain data with no projections
diff --git a/docs/walk-leaderboard.md b/docs/walk-leaderboard.md
new file mode 100644
index 000000000..3727e141d
--- /dev/null
+++ b/docs/walk-leaderboard.md
@@ -0,0 +1,275 @@
+# Walk Leaderboard
+
+Every step your avatar takes on three.ws is measured, rolled up, and ranked. The **Walk Leaderboard** is the public board for it: walkers ordered by **distance walked**, **sites visited**, or **time on their feet**, over **today**, **this week**, or **all time**. Signed-in accounts and anonymous walkers compete on the same board, and your own row is always pinned to the bottom of the page even when your rank is off-screen.
+
+Live at `three.ws/walk-leaderboard`. Backed by one endpoint, `GET /api/walk/leaderboard`, over the `walk_metrics` rollup that `POST /api/walk/metrics` writes.
+
+Code: [pages/walk-leaderboard.html](../pages/walk-leaderboard.html) (page and its inline module), [api/walk/leaderboard.js](../api/walk/leaderboard.js) (ranking), [api/walk/metrics.js](../api/walk/metrics.js) (ingest), [src/walk.js](../src/walk.js) (the accumulator in the walk runtime), [api/\_lib/migrations/20260621140000\_walk\_metrics.sql](../api/_lib/migrations/20260621140000_walk_metrics.sql) (schema).
+
+---
+
+## What is measured
+
+Three metrics, all derived from the same rollup table. Pick one with the **Distance / Sites / Time** control; it becomes the ranked column.
+
+| Metric | Column and aggregate | What it actually counts |
+| --- | --- | --- |
+| `distance` | `sum(distance_meters)` | Metres the avatar moved horizontally in the 3D scene, integrated per frame from the controller's resolved displacement. Rendered as metres under 1 km, kilometres above. |
+| `time` | `sum(duration_sec)` | Seconds spent *moving*. Idle time is not counted (see the motion gate below). Rendered as seconds, minutes, or hours. |
+| `sites` | `count(distinct coalesce(embed_origin, site_hostname))`, non-null only | Distinct third-party hosts the avatar walked on. `embed_origin` is derived server-side from the request's `Origin` or `Referer`; `site_hostname` is the host an external pilot (such as a browser extension) reports. |
+
+Two consequences of how `sites` is defined, stated plainly because they are easy to misread:
+
+- **three.ws itself never counts as a site.** `deriveEmbedOrigin()` returns `null` for `three.ws`, `www.three.ws`, and `localhost`, so a walk on the platform's own pages adds distance and time but contributes nothing to the sites metric. That is deliberate: "unique sites" is meant to measure reach across the web, not our own surfaces.
+- **A row only reaches the sites metric if a client supplies one of those two dimensions.** The metric is a real query over real columns, so as soon as an off-platform embed or pilot posts from its own host, its walkers rank on it. In the current tree the only client that flushes metrics is the walk runtime served from three.ws, so the sites column is sparse in practice while distance and time are fully populated.
+
+Values are rounded to two decimals in the response. A walker with a zero (or absent) value for the selected metric and window is excluded from the ranking entirely (`having <aggregate> > 0`), which is why the daily board is short early in a UTC day.
+
+### The delta column
+
+Every row carries `deltaFromYesterday`: the same metric earned **today** minus the same metric earned **yesterday**, both as UTC days. It is momentum, not a total, and it is computed identically for all three time windows, so the "vs. yesterday" column means the same thing whether you are looking at the daily, weekly, or all-time board. Zero renders as a neutral dash rather than `+0`.
+
+---
+
+## The three views
+
+`?period=` selects the window, all boundaries in UTC:
+
+| View | `period` | Window |
+| --- | --- | --- |
+| Today | `daily` | Rows whose `day` is the current UTC date. |
+| This Week | `weekly` (default) | The current UTC date and the previous 6 days, so a rolling 7 days rather than a calendar week. |
+| All Time | `all-time` | No lower bound. |
+
+The page defaults to **This Week / Distance**. Switching either control refetches from offset 0. Both control groups are ARIA tablists with left and right arrow-key navigation, and the board sets `aria-busy` while loading.
+
+Ranking rules:
+
+- Walkers are sorted by the window value descending, with ties broken deterministically by walker key (`u:<userId>` or `a:<anonId>`), so equal totals never shuffle between requests.
+- Ranks are sequential positions in that sorted list (1, 2, 3, ...). The top three render medals instead of a number.
+- `total` is the count of all qualifying walkers, not the page size, so `hasMore` is exact.
+- Pagination is `limit` (1 to 100, default 50) and `offset`. **Show more** appends the next page in place.
+
+### Identity on the board
+
+- **Signed-in walkers** show `@username` (or their display name when no username is set), link to `/u/<username>`, and carry an avatar thumbnail: the most recently created non-deleted avatar the account owns that has a thumbnail, which is not necessarily the avatar they walked with.
+- **Anonymous walkers** rank too, under a derived handle: `walker-` plus the last four alphanumeric characters of their anonymous id. No profile link, and an initial-letter fallback tile instead of a thumbnail.
+- **Your own row** is resolved from a session cookie, a bearer token, or the `anonId` query parameter, and returned as `me` even when it falls outside the requested page. `me.onPage` tells the client whether it is already visible above. A walker with an identity but no qualifying metrics in the window comes back as `me` with `rank: null`, `value: 0`, and `unranked: true`, which the page renders as a dash rather than hiding you.
+
+The page reads `localStorage['twx_walk_anon']` to pass `anonId`. It only reads, never creates, that key: the walk runtime is what mints it. So the pinned row appears for anonymous walkers who have actually walked, and simply does not appear for a first-time visitor.
+
+---
+
+## How a walk session is counted
+
+The board never talks to the walk runtime directly. One ingest feeds it.
+
+**1. Per-frame accumulation.** `accumulateWalkMetrics(dt)` runs once per rendered frame in the walk runtime. It takes the horizontal displacement between this frame's avatar position and the last one (`hypot(dx, dz)`) and adds it to a pending distance, plus `dt` to a pending duration, but only when all three of these hold:
+
+- the step is larger than 0.001 m, so a standing avatar accrues no phantom distance from float jitter;
+- the step is smaller than 5 m, so a teleport, a spawn, or a world swap is discarded rather than banked as a sprint;
+- the controller's motion state is `walk` or `run`, so time only accrues while actually moving.
+
+**2. Session counting.** The first qualifying movement flips a `counted` flag. The first flush that carries it sends `sessions: 1`, and a `sessionFlushed` flag makes sure the same page load never counts a second session. So a session is "one page load in which the avatar genuinely moved", not a timer and not a page view.
+
+**3. Flush cadence.** Batches go to `POST /api/walk/metrics` every 60 s via `fetch` with `keepalive`, and once more on `pagehide` or on `visibilitychange` to hidden via `navigator.sendBeacon`, so the final partial minute survives a tab close or an app backgrounding. Pending counters reset on dispatch. A flush with nothing to report is skipped entirely, and a failed flush is swallowed: metrics never surface an error to the walker.
+
+**4. Rollup on the server.** Each batch UPSERTs into a per-`(walker, UTC day, environment, embed origin, avatar)` row in `walk_metrics`, adding its increments onto whatever is there. The unique index is over the COALESCE'd dimension tuple (Postgres treats NULLs as distinct, which would otherwise spawn a new row per batch and break the rollup). An hour of walking is therefore a handful of rows, not thousands, and the leaderboard aggregates over a compact indexed table.
+
+**5. Attribution.** A signed-in session or bearer wins and the batch is keyed to `user_id`. Otherwise it is keyed to the client's `anonId`, a stable id persisted in `localStorage` (or a per-page id when storage is blocked). A batch with neither identity is accepted with `202` and explicitly not recorded.
+
+The same batch also carries any achievement thresholds the runtime crossed this session. The ingest persists them once each into `walk_achievements` under a per-`(walker, code)` unique index, from an allowlist of four codes: `distance_1km`, `distance_5km`, `sites_10`, and `all_environments`. The walk runtime currently fires three of them (1 km walked, 5 km walked, and all six environments in one session), each with a toast; `sites_10` is accepted by the ingest but has no client that fires it. And for signed-in walkers a batch with real metrics counts as a qualifying daily activity for the cross-surface streak.
+
+### What feeds the board today
+
+Only the walk runtime in [src/walk.js](../src/walk.js) flushes metrics, so the board is fed by the pages that load it: `/temporary` (including the `/wk/:avatar` route that rewrites to it) and `/marketplace-walk`. The chrome-less embed runtime, [src/walk-embed.js](../src/walk-embed.js), is a deliberate fork of the same engine for iframes and does not currently flush, so `/walk/app` and the iframe embeds on the `/walk` landing page do not accrue leaderboard distance.
+
+---
+
+## What prevents trivially faking distance
+
+As coded, in layers. Each one bounds a different kind of nonsense:
+
+| Guard | Where | Effect |
+| --- | --- | --- |
+| Teleport rejection: a single frame moving 5 m or more is discarded | `accumulateWalkMetrics` in [src/walk.js](../src/walk.js) | A world swap, respawn, or position restore cannot be laundered into distance. |
+| Jitter floor: steps at or below 0.001 m are ignored | same | A parked avatar earns nothing, so leaving a tab open all day adds zero distance. |
+| Motion gate: only `walk` and `run` states accumulate | same | Idle, gesture, and cutscene time do not count toward the time metric. |
+| Per-batch ceilings: `distanceMeters` at most 50000, `durationSec` at most 86400, `sessions` at most 50 | zod schema in [api/walk/metrics.js](../api/walk/metrics.js) | A batch claiming an implausible jump is rejected outright with `400 validation_error`, not clamped and stored. A brisk walk is about 1.4 m/s, so even a ten-minute batch is well under a kilometre. |
+| Strict schema | same | Unknown fields are rejected (`.strict()`), so the ingest has no room for extra dimensions a caller might invent. |
+| Server-derived origin | `deriveEmbedOrigin()` in [api/walk/metrics.js](../api/walk/metrics.js) | `embedOrigin` is accepted in the schema for forward compatibility and then ignored: the stored value always comes from the request's `Origin` or `Referer`. A caller cannot attribute walks to a host it does not control, so the sites metric cannot be inflated with invented hostnames. |
+| Identity requirement | same | A batch with neither a session nor an `anonId` is a no-op `202`. Nothing anonymous-and-unkeyed can enter the rollup. |
+| Rate limit: 60 requests per minute per IP | `limits.irlInteractIp` | Matches the roughly one-per-minute flush cadence plus retries, and caps how many batches one address can land. |
+| Achievement allowlist | same | Only the four known codes persist, and each unlocks once per walker, so badges cannot be farmed by replaying a batch. |
+| Idempotent rollup | unique index in [the migration](../api/_lib/migrations/20260621140000_walk_metrics.sql) | Batches merge into one row per dimension tuple per day, so the table cannot be flooded into a different shape. |
+
+**What these guards do and do not claim.** `POST /api/walk/metrics` is a public, open-CORS ingest keyed on a client-supplied anonymous id, because embeds post from third-party hosts and anonymous walkers are first-class on the board. The guards above bound the size, rate, and attribution of any single claim; they do not cryptographically prove that a walk happened. There is no cross-batch plausibility check (for example, distance against elapsed duration) and no server-side replay of the controller. Treat the board as a gamified activity ranking, not as an audited measurement. If you need a movement claim that a third party can verify, that is a different product: [World Lines](./world-lines.md) issue agent-signed proofs of physical presence with server-derived co-location.
+
+---
+
+## API
+
+### `GET /api/walk/leaderboard`
+
+Public. Open CORS (`GET`, `OPTIONS`). Rate limited at 240 requests per minute per IP. Cached at the edge with `public, max-age=15, s-maxage=30, stale-while-revalidate=60`, so the board is live without every switch of a control hitting the database.
+
+| Parameter | Values | Default |
+| --- | --- | --- |
+| `period` | `daily` \| `weekly` \| `all-time` | `weekly` |
+| `metric` | `distance` \| `sites` \| `time` | `distance` |
+| `limit` | 1 to 100 | 50 |
+| `offset` | 0 or greater | 0 |
+| `anonId` | a stable anonymous walker id, to pin that walker's row | none |
+
+Identity for the pinned `me` row comes from an `Authorization: Bearer` token, the session cookie, or `anonId`, in that order.
+
+```bash
+curl -s 'https://three.ws/api/walk/leaderboard?period=weekly&metric=distance&limit=3'
+```
+
+```json
+{
+ "period": "weekly",
+ "metric": "distance",
+ "total": 128,
+ "limit": 3,
+ "offset": 0,
+ "hasMore": true,
+ "rows": [
+ {
+ "rank": 1,
+ "key": "u:8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31",
+ "userId": "8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31",
+ "anonId": null,
+ "username": "ada",
+ "handle": "@ada",
+ "profileUrl": "/u/ada",
+ "avatarId": "c9d2a71e-3b44-4f88-9a01-6de5f2b7c410",
+ "avatar": "https://<avatar-cdn-domain>/u/8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31/thumb.webp",
+ "value": 18452.31,
+ "deltaFromYesterday": 1240.5
+ },
+ {
+ "rank": 2,
+ "key": "a:anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2",
+ "userId": null,
+ "anonId": "anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2",
+ "username": null,
+ "handle": "walker-55e2",
+ "profileUrl": null,
+ "avatarId": null,
+ "avatar": null,
+ "value": 15990.08,
+ "deltaFromYesterday": -320.75
+ },
+ {
+ "rank": 3,
+ "key": "u:2b6f0cc9-04e0-4b1f-9c8a-77d5b2e13a90",
+ "userId": "2b6f0cc9-04e0-4b1f-9c8a-77d5b2e13a90",
+ "anonId": null,
+ "username": null,
+ "handle": "three.ws walker",
+ "profileUrl": null,
+ "avatarId": null,
+ "avatar": null,
+ "value": 14201.4,
+ "deltaFromYesterday": 0
+ }
+ ],
+ "me": null
+}
+```
+
+Pin an anonymous walker's own row:
+
+```bash
+curl -s 'https://three.ws/api/walk/leaderboard?period=daily&metric=time&limit=1&anonId=anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2'
+```
+
+```json
+{
+ "period": "daily",
+ "metric": "time",
+ "total": 41,
+ "limit": 1,
+ "offset": 0,
+ "hasMore": true,
+ "rows": [
+ {
+ "rank": 1,
+ "key": "u:8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31",
+ "userId": "8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31",
+ "anonId": null,
+ "username": "ada",
+ "handle": "@ada",
+ "profileUrl": "/u/ada",
+ "avatarId": "c9d2a71e-3b44-4f88-9a01-6de5f2b7c410",
+ "avatar": "https://<avatar-cdn-domain>/u/8f14e45f-ceea-467a-9c4b-2b0a1d5f7c31/thumb.webp",
+ "value": 5402.7,
+ "deltaFromYesterday": 900.1
+ }
+ ],
+ "me": {
+ "rank": 7,
+ "key": "a:anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2",
+ "userId": null,
+ "anonId": "anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2",
+ "username": null,
+ "handle": "walker-55e2",
+ "profileUrl": null,
+ "avatarId": null,
+ "avatar": null,
+ "value": 1843.2,
+ "deltaFromYesterday": 612.4,
+ "onPage": false
+ }
+}
+```
+
+Errors: `400 bad_period`, `400 bad_metric`, `429` when the public per-IP limit trips. Out-of-range `limit` and `offset` are clamped rather than rejected.
+
+### `POST /api/walk/metrics` (the ingest)
+
+The board's write side, shared with the per-creator embed analytics dashboard. Open CORS so third-party embeds can post. Body fields relevant to the leaderboard:
+
+| Field | Type | Notes |
+| --- | --- | --- |
+| `distanceMeters` | number, 0 to 50000 | Increment since the last flush. |
+| `durationSec` | number, 0 to 86400 | Increment since the last flush. |
+| `sessions` | integer, 0 to 50 | Send `1` once per page load that produced real movement. |
+| `anonId` | string, 8 to 64 chars | Required when there is no session or bearer. |
+| `envId` | string | Walk environment name, a rollup dimension. |
+| `avatarId` | uuid | The avatar being walked, a rollup dimension. |
+| `siteHostname` | string | The host an external pilot reports, feeding the sites metric. |
+| `achievements` | array, up to 8 | Codes from the allowlist; anything else is dropped. |
+| `eventName`, `value` | string, number | Creator-defined conversion event for the analytics funnel, not the leaderboard. |
+| `embedOrigin` | string | Accepted and ignored; the stored origin is always server-derived. |
+
+```bash
+curl -s https://three.ws/api/walk/metrics \
+ -H 'content-type: application/json' \
+ -d '{"distanceMeters":412.5,"durationSec":295.4,"sessions":1,"envId":"park","anonId":"anon_4f6c2b19-77d3-4a2e-9b58-0c1e7a3d55e2"}'
+```
+
+```json
+{ "ok": true, "recorded": true }
+```
+
+A batch with no identity returns `202` with `{ "ok": false, "reason": "no walker identity", "recorded": false }`. A batch that violates a ceiling returns `400 validation_error` naming the field.
+
+---
+
+## Privacy and identity
+
+No geolocation is involved anywhere on this surface. Distance is virtual-world displacement in a 3D scene, not GPS, so nothing here touches the presence machinery that gates the real-world features. What the board stores about a walker is an account id or a client-generated anonymous id, plus per-day totals and rollup dimensions.
+
+The anonymous id is generated and persisted by the walk runtime in `localStorage` under `twx_walk_anon` and is the only thing linking an anonymous walker's rows across visits. Clearing site data ends that continuity: the old rows stay on the board under their old derived handle and a new id starts from zero. Public rows expose only the derived `walker-xxxx` handle, never the full id, and never an IP.
+
+---
+
+## Related
+
+- [Add the Walk Companion to your site](./tutorials/walk-companion.md), the hands-on path from a copy-paste iframe to the `@three-ws/walk` package, including the surfaces that produce the metrics ranked here.
+- The walk documentation set on the site, served from `public/docs/walk/`: `/docs/walk` (index), `/docs/walk/walk-page`, `/docs/walk/embed-iframe`, `/docs/walk/embed-sdk`, `/docs/walk/companion-mode`, `/docs/walk/chrome-extension`, `/docs/walk/postmessage-events`, and `/docs/walk/analytics`, which covers the per-creator dashboard fed by the same ingest.
+- The creator-side view of this data: `three.ws/walk-analytics`, backed by `GET /api/walk/analytics`.
+- [World Lines](./world-lines.md), for movement claims that carry a verifiable agent signature rather than a leaderboard rank.
diff --git a/docs/world-lines.md b/docs/world-lines.md
new file mode 100644
index 000000000..1fead7ab0
--- /dev/null
+++ b/docs/world-lines.md
@@ -0,0 +1,577 @@
+# World Lines: agent-signed proof of presence
+
+A **World Line** is a quest an agent leaves at a real place. Someone walks to that spot, completes the agent's AR challenge, and the agent's own wallet signs an ed25519 **proof of presence**: a tamper-evident receipt that says *this visitor was in this area and did this thing*. The proof is independently verifiable by anyone, ownable by the visitor, and it never carries a coordinate finer than a roughly 1 km cell.
+
+Live at `three.ws/world-lines`. Four tabs: **Near me** (fix-gated quests within walking range), **Explore** (coordinate-free region roll-up), **My proofs** (your earned collectibles, each re-verifiable in place), and **Create** (place a quest on a pin you own, plus the completion dashboard).
+
+This document is the deep reference. For where World Lines sits inside the wider IRL product (placing agents, discovering by walking up, Money Drops, the presence privacy contract), read the short version first: [IRL: agents in the real world](./irl.md#world-lines). The REST summary lives in the [API reference](./api-reference.md); everything below is the full contract, the anti-cheat reasoning, and the exact privacy posture as coded.
+
+Code: [api/irl/world-lines.js](../api/irl/world-lines.js) (all nine endpoints), [api/\_lib/world-lines.js](../api/_lib/world-lines.js) (the pure crypto and ceremony core), [src/world-lines.js](../src/world-lines.js) (the page), [src/irl/world-line-ar.js](../src/irl/world-line-ar.js) (the completion ceremony), [src/irl/world-lines-client.js](../src/irl/world-lines-client.js) (browser client), [packages/irl](../packages/irl/README.md) (the npm SDK).
+
+---
+
+## The model in one pass
+
+```
+your IRL pin (precise lat/lng, yours)
+ └── World Line (title, prompt, challenge, reward, difficulty, expiry)
+ stores: pin_id + coarse_cell (~1.1 km) + region_cell (~5 km)
+ signs with: the agent's custodial ed25519 wallet key
+ │
+ ▼ a visitor walks there
+ challenge → single-use nonce (HMAC, 5 min, bound to quest + cell)
+ ▼
+ complete → co-location re-checked, interaction graded,
+ agent signs the canonical message
+ ▼
+ presence proof → { signature, signed_message, signer_pubkey, coarse_cell }
+ collectible mint id: presence:<proof-id>
+ ▼
+ verify → anyone re-runs the ed25519 check, no auth, no account
+```
+
+Two tables back it, both created on demand by the handler:
+
+| Table | Holds | Location data in it |
+| --- | --- | --- |
+| `irl_world_lines` | creator, agent id, signer pubkey, anchor `pin_id`, title, prompt, `challenge_spec`, reward, difficulty, caps, expiry | `coarse_cell` (precision-6 geohash, about 1.2 km by 0.6 km) and `region_cell` (precision-5, about 5 km). No latitude or longitude column. |
+| `irl_presence_proofs` | quest id, agent id, signer pubkey, `nonce_id`, salted `completer_hash`, signature, signed message, challenge kind, collectible mint and name | `coarse_cell` only. |
+
+The precise coordinate of the quest lives in exactly one place: the anchor row in `irl_pins`, which the creator placed themselves. The World Line points at it by id and reads it server-side only to compute a co-location boolean.
+
+---
+
+## Creating a World Line
+
+`POST /api/irl/world-lines`, signed in, CSRF-protected. The rules are ownership rules, not preferences:
+
+1. **You must own the anchor pin.** The pin carries the precise spot, so anchoring to someone else's pin would publish their coordinate. Wrong owner returns `403`.
+2. **The pin must be public.** A World Line is an open invitation for strangers to walk to a place. Anchoring one to a pin whose `published` is `false` returns `409` with guidance to make the pin public first, rather than silently hiding the quest from discovery later.
+3. **You must own the signing agent.** The agent's custodial wallet signs every proof this quest ever mints, so accountability is non-negotiable. The agent defaults to the pin's agent; pass `agentId` to use another agent you own. A pin with no agent and no `agentId` returns `400`.
+4. **Anonymous device placements cannot create quests.** They have no agent wallet, so there is nothing to sign with. `401`.
+
+At creation the handler provisions (idempotently) the agent's Solana wallet and stores its address as `signer_pubkey`. Verification is therefore anchored to the key in force when the quest was created, which is what makes a proof checkable years later without trusting the current state of the agent.
+
+### Body
+
+| Field | Type | Notes |
+| --- | --- | --- |
+| `pinId` | string, required | A pin you own, public, not hidden, not expired. |
+| `title` | string, required | Up to 80 chars. Whitespace-collapsed, content-gated. |
+| `prompt` | string | Up to 240 chars. The line the agent speaks aloud in the ceremony. |
+| `agentId` | uuid | Defaults to the anchor pin's agent. Must be yours. |
+| `challenge` | object | `{ kind: "tap" \| "quiz" \| "phrase", ... }`. Defaults to `tap`. |
+| `reward_kind` | `collectible` \| `three_pool` | Anything else normalizes to `collectible`. |
+| `reward_ref` | string | Up to 80 chars. Also becomes the collectible's name when set. |
+| `difficulty` | `easy` \| `medium` \| `hard` | Anything else normalizes to `easy`. |
+| `max_completions` | integer | 1 to 100000. Omit for unlimited. |
+| `lifetime_days` | number | 1 to 90, default 30. |
+
+`camelCase` aliases are accepted for `maxCompletions` and `rewardKind`.
+
+**Content gate.** `title`, `prompt`, and the challenge's `prompt` / `question` all pass the same floor a pin caption does: a slur blacklist and a coin guard that permits only `$THREE`. A cashtag other than `$THREE`, or a base58 mint ending in `pump` that is not the `$THREE` contract, returns `422` with the offending field.
+
+**Caps.** 30 active quests per creator (`429 quest_limit`), 200 active quests per roughly 5 km region (`429 region_full`), and a create rate limit of 15 per 10 minutes per IP.
+
+### Challenge kinds
+
+Normalized and validated in [api/\_lib/world-lines.js](../api/_lib/world-lines.js):
+
+- **`tap`** (default). Presence *is* the challenge. The visitor walks up and taps the agent. Nothing to grade beyond co-location.
+- **`phrase`** with `phrase` (up to 80 chars, required). Stored lowercased and whitespace-normalized. The visitor must reproduce it; grading is case and spacing insensitive.
+- **`quiz`** with `question` (up to 240 chars), `choices` (2 to 4, each up to 60 chars), and `answer` (the index of the correct choice). An out-of-range index is a `400`.
+
+The stored spec contains the answer, so it is redacted for anyone who has not proven co-location: `GET /api/irl/world-lines/:id` returns the quiz question and choices but not the answer index, and never echoes a passphrase. Only the creator's own dashboard and a co-located caller see the full spec. This is deliberate: a remote caller who could read the answer could pre-solve every quest in a city.
+
+### Rewards, stated precisely
+
+The collectible's display name is `reward_ref` when you set one, otherwise it is derived from the quest title with a "proof of presence" suffix, so setting `reward_ref` is how you control what the visitor's collectible is called.
+
+`reward_kind` is quest metadata. `collectible` means the reward is the agent-signed proof itself, which is minted on completion and appears in the visitor's collectibles. `three_pool` labels a quest as backing a `$THREE` prize pool and renders as such on the page, but the completion path performs no token transfer: the only thing `complete` mints is the proof. If you need real escrowed value at a place today, use Money Drops (fresh per-drop escrow wallet, on-chain release to the claimer), described in [IRL](./irl.md#money-drops).
+
+---
+
+## The quest and challenge flow
+
+What the visitor sees, and what the server checks under each step. The ceremony state machine is [src/irl/world-line-ar.js](../src/irl/world-line-ar.js); every state below is a rendered state, including the failure ones.
+
+**1. Discover.** The page watches geolocation, mints a fix token, and calls `GET /nearby`. Each quest card shows a distance chip coarsened to 10 m, the difficulty, the reward, and whether you already hold its proof. Under 80 m the button becomes "You're here, begin"; further away it reads "Travel here to begin".
+
+**2. Open the encounter.** The client fetches `GET /:id` with the fix so the server can decide whether to reveal the answer. The agent's avatar renders in the card (idle clip retargeted onto its own rig) and the quest prompt is shown.
+
+**3. Begin.** `POST /challenge`. The server re-derives co-location, refuses if the quest is at capacity, short-circuits with `already_completed` plus your existing `proof_id` if you have done this one, and otherwise mints a single-use nonce and returns the fully revealed challenge spec. The agent speaks the prompt through `/api/tts/speak`; speech is best-effort and the prompt is always on screen, so a TTS failure never blocks the quest.
+
+**4. Interact.** `tap` renders one button. `phrase` renders a text input. `quiz` renders the choices as a radiogroup. A wrong answer is recoverable: `complete` returns `422 challenge_failed`, the ceremony re-renders the interaction with the error inline, and the same nonce is still spendable until it expires.
+
+**5. Complete.** `POST /complete` with the nonce plus `answer` or `phrase`. On success the card shows the signing agent's key, the collectible mint id, and a link that re-verifies the signature in public. The creator gets a notification carrying the quest id, title, coarse cell, new completion count, and a link back to their dashboard. Nothing else: not the coordinate, not who completed it.
+
+Server-side, `complete` runs eight steps in this order, and each one can end the request:
+
+1. Co-location, re-derived from scratch (never carried over from the challenge call).
+2. Nonce verification: unforged HMAC, inside its 5 minute TTL, and bound to this quest id and coarse cell.
+3. Interaction grading for `quiz` and `phrase`. For `tap` the interaction is presence, already proven.
+4. One proof per visitor per quest: an existing proof is returned as-is rather than minting a second.
+5. Capacity re-check, immediately before signing.
+6. The agent wallet signs the canonical message, and the server verifies its own signature against the `signer_pubkey` captured at creation before persisting anything. A stored proof is therefore always genuine.
+7. Insert under two unique indexes, `nonce_id` and `(world_line_id, completer_hash)`, so a racing double completion is a clean conflict that returns the existing proof instead of a double mint. Then the collectible id is stamped and the completion count is bumped under the capacity guard.
+8. Notify the creator.
+
+### Anti-cheat, summarized
+
+| Attack | What stops it |
+| --- | --- |
+| Complete from across town | Fix token proves a real recent GPS fix, then the server measures the claimed point against the anchor pin's own coordinates. The request body is never trusted for the distance check. |
+| Pre-solve quizzes remotely, then walk up once | The answer is redacted from every non-co-located read of the quest. |
+| Replay a captured completion | The nonce is single-use: `nonce_id` carries a `UNIQUE` index, and a replay returns the original proof (idempotent), never a second one. |
+| Forge a nonce | The nonce is an HMAC over its payload with a server secret, compared in constant time, and bound to the quest id and coarse cell. |
+| Farm a quest for many collectibles | `(world_line_id, completer_hash)` is unique. One proof per visitor per quest, whether identified by account or device token. |
+| Lift someone else's proof and claim it | The signed bytes include the completer's salted hash, so a proof only ever attests to one visitor. |
+| Mint proofs without the agent | The signing key is the agent's custodial wallet, and the verifier checks against the pubkey captured at creation. |
+| Script the endpoints | Per-IP limits: 15 creates per 10 min, 30 challenges per 5 min, 20 completes per 5 min, 240 public reads per min, 30 fix mints per min. |
+
+---
+
+## How proximity is proven and bounded
+
+Two mechanisms compose. Neither alone is sufficient.
+
+**The fix token** ([api/\_lib/irl-presence.js](../api/_lib/irl-presence.js)) turns "query anywhere" into "query where you are". The client posts its live fix to `POST /api/irl/fix-token` and gets back a stateless, HMAC-signed token whose payload holds the fix rounded to 3 decimal places (about 110 m), the precision-7 geocell it fell in, and an issue time. TTL is 180 s. A read is honoured when the claimed point is within 250 m of the token anchor. No DB row, no stored coordinate.
+
+**The server-side distance check** (`resolveColocation`) then measures the claimed point against the anchor pin's unrounded coordinates with a haversine, and requires 80 m or better. So a caller must both hold a genuine fix near the point they claim *and* have that point actually be at the quest.
+
+Every radius in play, and why they differ:
+
+| Bound | Value | Purpose |
+| --- | --- | --- |
+| Co-location for `challenge` and `complete` | 80 m | Slightly wider than the 60 m pin read, to tolerate GPS jitter at the moment of the tap. |
+| Nearby discovery, default | 250 m | Wide enough for "a quest is about 250 m north" wayfinding. |
+| Nearby discovery, max | 600 m | Hard ceiling; the request's radius is clamped to `[30, 600]`. |
+| Fix-token anchor tolerance | 250 m | About one geocell plus edge slack, so a walker near a cell boundary keeps polling without re-minting. |
+| Distance returned to the client | rounded to 10 m | Successive reads cannot be triangulated into an exact spot. |
+| Coarse cell stored on quests and proofs | precision-6 geohash, about 1.2 km by 0.6 km | The only location a proof carries. |
+| Region cell used by public browse | precision-5 geohash, about 5 km | Aggregate-only discovery map. |
+| Nearby result cap | 50 rows before the radius filter | Bounds a sweep's yield per request. |
+
+`GET /nearby` also enforces the anchor pin's visibility (`p.published IS NOT FALSE`). It has the widest coordinate-bearing radius on the platform, so without that filter it would be the cheapest private-pin bypass in the product.
+
+**Enforcement is config-gated.** `fixEnforced()` is true only when `IRL_FIX_SECRET` is set to at least 16 characters. Without it (local and preview) the token check is skipped, but the server-side distance check still runs, so co-location is never simply trusted. Same shape for the nonce: `WORLD_LINE_SECRET` must be set in production; otherwise a stable, deliberately non-secret dev key is used, and a nonce minted under the dev key stops verifying the moment a real secret is configured.
+
+---
+
+## What the agent signs
+
+One canonical, domain-separated, versioned string. Field order is fixed, and every field is coarse or hashed:
+
+```
+three.ws/world-line-presence:v1|wl=<worldLineId>|cell=<coarseCell>|nonce=<nonceId>|who=<completerHash>
+```
+
+- `PROOF_DOMAIN` (`three.ws/world-line-presence:v1`) prevents a signature from being replayed as a different kind of attestation, and gives future versions a clean break.
+- `wl` binds the proof to one quest.
+- `cell` is the precision-6 geohash of the anchor, derived from the pin, not from the caller. It is the only location in the signed bytes.
+- `nonce` is the nonce id, which is the first 32 chars of the nonce's HMAC. It ties the proof to one server-authorized attempt at a specific time window.
+- `who` is `sha256("wlc:" + secret + ":" + stableId)` truncated to 32 chars, where `stableId` is the account id when signed in, otherwise the device token. Stable, so the same visitor maps to the same hash, and salted with a server secret so it cannot be dictionary-attacked back to a device token.
+
+The signature is ed25519 over the UTF-8 bytes of that string, produced with the agent's Solana keypair seed and returned base58 alongside the base58 public key. Nothing in the signed payload, the nonce, or any log line is finer than the coarse cell.
+
+---
+
+## Verifying a proof as a third party
+
+### Over HTTP, no auth
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/verify/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f
+```
+
+```json
+{
+ "verified": true,
+ "proof": {
+ "id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "world_line_id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
+ "world_line_title": "Find the lobby greeter",
+ "agent_id": "7c6b5a49-3827-1605-f4e3-d2c1b0a99887",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "coarse_cell": "u4pruy",
+ "signed_message": "three.ws/world-line-presence:v1|wl=1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d|cell=u4pruy|nonce=<32-char nonce id>|who=<32-char completer hash>",
+ "signature": "<base58 ed25519 signature>",
+ "signature_scheme": "ed25519",
+ "collectible_mint": "presence:9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "collectible_name": "<reward_ref when set, else the quest title with a proof-of-presence suffix>",
+ "completed_at": "2026-07-30T11:02:14.318Z"
+ }
+}
+```
+
+`verified` is not a stored flag. The endpoint re-runs the ed25519 check over `signed_message` against `signer_pubkey` on every request, using only fields present on the returned row. A malformed key or signature yields `verified: false` rather than an error. Unknown proof id returns `404`.
+
+### Offline, trusting nobody
+
+The response is self-contained, so you can re-check it yourself. This is the same code path `/verify` runs:
+
+```js
+import { ed25519 } from '@noble/curves/ed25519.js';
+import bs58 from 'bs58';
+
+const res = await fetch('https://three.ws/api/irl/world-lines/verify/' + proofId);
+const { proof } = await res.json();
+
+const pub = bs58.decode(proof.signer_pubkey);
+const sig = bs58.decode(proof.signature);
+const msg = new TextEncoder().encode(proof.signed_message);
+
+const genuine = pub.length === 32 && sig.length === 64 && ed25519.verify(sig, msg, pub);
+console.log(genuine ? 'genuine proof of presence' : 'not genuine');
+```
+
+What a `true` result actually tells you: the holder of the agent's private key attested that the visitor identified by `who` completed quest `wl` in cell `cell` under server nonce `nonce`. It does not tell you the exact spot (by design), and it does not tell you the visitor's identity (only that it is one stable visitor). To tie a proof to a person, ask them to fetch it from their own `GET /collectibles`, which is scoped to their session or device token.
+
+Coverage for the crypto core lives in [tests/world-lines-crypto.test.js](../tests/world-lines-crypto.test.js): tampered message, tampered signature, wrong signer, cross-quest nonce reuse, expiry, and the "another visitor cannot reuse this signature" case.
+
+---
+
+## Privacy: exactly what is stored
+
+The engineering analysis for all of IRL is the [IRL threat model](./irl/THREAT-MODEL.md); the user-facing summary is the `three.ws/irl-privacy` page. World Lines specifically:
+
+**Stored.**
+
+- On the quest: the anchor `pin_id`, a precision-6 coarse cell (about 1 km), a precision-5 region cell (about 5 km), the creator's user id, the agent id, the signer pubkey, and the creator's own text.
+- On a proof: the coarse cell, the nonce id, the salted completer hash, the signature and signed message, the challenge kind, and the collectible mint and name.
+- Also on a proof row, server-side only: `completer_user_id` and `completer_device`. The raw device token is stored because `GET /collectibles` scopes an anonymous visitor's own collection to it. It is never returned by any endpoint (`publicProof`, `collectibleOf`, and the collectibles query all select around it), never enters the signed message, and never reaches a notification or a log line.
+
+**Not stored, anywhere.**
+
+- The visitor's latitude and longitude. They are parsed from the request, used to verify the fix token and compute one distance, and discarded. No row, no log.
+- The quest's coordinate on the quest itself. It exists only on the creator's own pin row.
+- A precise coordinate in a proof, a nonce, a notification, or the collectible.
+- Camera frames or gyroscope readings. The ceremony renders locally; nothing is uploaded.
+- Analytics events. Unlike pins and shares, the World Lines handler writes no `irl_events` rows, so there is no separate telemetry trail for quest reads.
+
+**Never revealed.**
+
+- Who completed a quest. The creator's dashboard and the completion notification carry counts grouped by coarse cell, nothing more.
+- A quest's location to a non-co-located caller. `browse` is aggregate-only and never returns a coordinate or a distance; `nearby` requires a fix token and returns distance rounded to 10 m; `:id` redacts the challenge answer without co-location.
+- Another visitor's collectibles. The collectibles query null-guards each identity arm, so a missing identifier cannot widen the scope.
+
+**Retention.** A quest always carries an expiry (creator-chosen, 90 days maximum). The hourly reaper [api/cron/irl-reap.js](../api/cron/irl-reap.js) deletes a quest one day past expiry, then sweeps every proof whose quest no longer exists. A proof lives as long as its quest, so a collectible is durable but not permanent: if you want to hold on to one, keep the verify response, which is fully self-verifying without the server.
+
+---
+
+## API contract
+
+Base path `/api/irl/world-lines`. CORS allows GET, POST, OPTIONS with credentials. Headers used throughout:
+
+| Header | Meaning |
+| --- | --- |
+| `x-irl-fix` | The proof-of-presence token from `POST /api/irl/fix-token`. Required on co-located calls when `IRL_FIX_SECRET` is configured. |
+| `x-irl-device` | The anonymous device token. A bearer credential, so it rides in the header only, never in a URL. |
+| `X-CSRF-Token` | Required on `POST /api/irl/world-lines` (the only authed write). |
+
+### Mint a fix token first
+
+```bash
+curl -s https://three.ws/api/irl/fix-token \
+ -H 'content-type: application/json' \
+ -H 'x-irl-device: 6b1e1c9a-0f4d-4e6a-9d7a-2f0c8b5a1e33' \
+ -d '{"lat":37.77493,"lng":-122.41942,"accuracy":8}'
+```
+
+```json
+{ "token": "<base64url payload>.<hmac>", "expires_in": 180, "cell": "9q8yyk8" }
+```
+
+Re-mint when you move far enough to leave the token's area or when it ages out. The shipped browser client caches one token per coordinate rounded to 3 decimals (roughly 110 m) and re-mints 15 s before expiry.
+
+### `POST /api/irl/world-lines`
+
+Create. Auth plus CSRF. Returns `201` with the owner view of the quest (full `challenge_spec` included, since you wrote it).
+
+```bash
+curl -s https://three.ws/api/irl/world-lines \
+ -H 'content-type: application/json' \
+ -H 'X-CSRF-Token: <token from /api/csrf-token>' \
+ -b 'session=<your session cookie>' \
+ -d '{
+ "pinId": "3f2a1b0c-9d8e-7f6a-5b4c-3d2e1f0a9b8c",
+ "title": "Find the lobby greeter",
+ "prompt": "Welcome, traveler. Tap me to prove you came.",
+ "challenge": { "kind": "quiz", "question": "What floor am I on?", "choices": ["Ground", "Third"], "answer": 0 },
+ "difficulty": "easy",
+ "reward_kind": "collectible",
+ "max_completions": 250,
+ "lifetime_days": 30
+ }'
+```
+
+```json
+{
+ "world_line": {
+ "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
+ "agent_id": "7c6b5a49-3827-1605-f4e3-d2c1b0a99887",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "pin_id": "3f2a1b0c-9d8e-7f6a-5b4c-3d2e1f0a9b8c",
+ "coarse_cell": "9q8yyk",
+ "region_cell": "9q8yy",
+ "title": "Find the lobby greeter",
+ "prompt": "Welcome, traveler. Tap me to prove you came.",
+ "challenge": { "kind": "quiz", "prompt": null, "question": "What floor am I on?", "choices": ["Ground", "Third"], "answer": 0 },
+ "reward_kind": "collectible",
+ "reward_ref": null,
+ "difficulty": "easy",
+ "max_completions": 250,
+ "completion_count": 0,
+ "created_at": "2026-07-30T10:41:07.882Z",
+ "expires_at": "2026-08-29T10:41:07.882Z"
+ }
+}
+```
+
+Errors: `401` not signed in, `403` pin or agent not yours, `404` pin or agent not found, `409` pin is private, `422` content gate, `429` quest or region cap or rate limit, `502` the agent's signing wallet could not be provisioned.
+
+### `GET /api/irl/world-lines/nearby?lat=&lng=[&radius=]`
+
+Fix-gated discovery. Radius clamps to `[30, 600]`, default 250.
+
+```bash
+curl -s 'https://three.ws/api/irl/world-lines/nearby?lat=37.77493&lng=-122.41942&radius=400' \
+ -H 'x-irl-fix: <token>' \
+ -H 'x-irl-device: 6b1e1c9a-0f4d-4e6a-9d7a-2f0c8b5a1e33'
+```
+
+```json
+{
+ "world_lines": [
+ {
+ "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
+ "agent_id": "7c6b5a49-3827-1605-f4e3-d2c1b0a99887",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "pin_id": "3f2a1b0c-9d8e-7f6a-5b4c-3d2e1f0a9b8c",
+ "coarse_cell": "9q8yyk",
+ "title": "Find the lobby greeter",
+ "prompt": "Welcome, traveler. Tap me to prove you came.",
+ "challenge": { "kind": "quiz", "prompt": null, "question": "What floor am I on?", "choices": ["Ground", "Third"] },
+ "reward_kind": "collectible",
+ "difficulty": "easy",
+ "max_completions": 250,
+ "completion_count": 12,
+ "distance_m": 70,
+ "completed_by_me": false,
+ "capacity_reached": false
+ }
+ ]
+}
+```
+
+Note the redacted challenge: no `answer`. Errors: `400` missing or non-finite `lat`/`lng` or an unparseable radius, `401 fix_required` (with a `reason` of `missing`, `malformed`, `forged`, `expired`, or `out_of_area`), `429` rate limited.
+
+### `GET /api/irl/world-lines/browse[?region=&difficulty=]`
+
+Public, no fix, no coordinates. With no query it returns the region roll-up, which is the only branch that sets an edge cache header (60 s, with a 300 s stale-while-revalidate window):
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/browse
+```
+
+```json
+{ "regions": [ { "region_cell": "9q8yy", "quests": 7, "hard": 2, "completions": 41 } ] }
+```
+
+With `region` (a precision-5 geohash from the roll-up) it returns that region's quests, up to 60, optionally filtered by `difficulty`:
+
+```bash
+curl -s 'https://three.ws/api/irl/world-lines/browse?region=9q8yy&difficulty=hard'
+```
+
+```json
+{
+ "region": "9q8yy",
+ "quests": [
+ { "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "title": "Find the lobby greeter",
+ "reward_kind": "collectible", "difficulty": "hard", "completion_count": 12, "capacity_reached": false }
+ ]
+}
+```
+
+An invalid `region` is ignored (you get the roll-up) rather than erroring.
+
+### `GET /api/irl/world-lines/:id[?lat=&lng=]`
+
+Single quest. Pass the fix and coordinates to unlock the full challenge spec; omit them for the "travel here" view.
+
+```bash
+curl -s 'https://three.ws/api/irl/world-lines/1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d?lat=37.77493&lng=-122.41942' \
+ -H 'x-irl-fix: <token>'
+```
+
+```json
+{ "world_line": { "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "challenge": { "kind": "quiz", "prompt": null, "question": "What floor am I on?", "choices": ["Ground", "Third"], "answer": 0 } }, "colocated": true }
+```
+
+`colocated` is `false` (and the answer withheld) whenever the coordinates are absent, the fix fails, or the distance exceeds 80 m. Errors: `400` invalid id, `404` unknown, hidden, or expired quest.
+
+### `POST /api/irl/world-lines/challenge`
+
+Issue a single-use nonce. Requires co-location.
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/challenge \
+ -H 'content-type: application/json' \
+ -H 'x-irl-fix: <token>' \
+ -H 'x-irl-device: 6b1e1c9a-0f4d-4e6a-9d7a-2f0c8b5a1e33' \
+ -d '{"world_line_id":"1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d","lat":37.77493,"lng":-122.41942}'
+```
+
+```json
+{
+ "nonce": "<base64url payload>.<hmac>",
+ "expires_in": 300,
+ "challenge": { "kind": "quiz", "prompt": null, "question": "What floor am I on?", "choices": ["Ground", "Third"], "answer": 0 },
+ "agent_id": "7c6b5a49-3827-1605-f4e3-d2c1b0a99887",
+ "world_line": { "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "title": "Find the lobby greeter", "prompt": "Welcome, traveler. Tap me to prove you came.", "reward_kind": "collectible", "reward_ref": null }
+}
+```
+
+If you already completed this quest you get `200 { "already_completed": true, "proof_id": "...", "collectible_mint": "..." }` instead of a nonce. Errors: `400` bad body or id, `401 fix_required`, `403 not_colocated` (with `within_m: 80`), `404` unknown quest, `409 capacity_reached`, `410 anchor_gone` (the pin was removed or expired), `429` rate limited, `500` if the nonce could not be minted.
+
+### `POST /api/irl/world-lines/complete`
+
+The proof ceremony. Send the nonce from `challenge` plus the interaction payload: `answer` (choice index) for a quiz, `phrase` for a phrase quest, nothing extra for a tap.
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/complete \
+ -H 'content-type: application/json' \
+ -H 'x-irl-fix: <token>' \
+ -H 'x-irl-device: 6b1e1c9a-0f4d-4e6a-9d7a-2f0c8b5a1e33' \
+ -d '{"world_line_id":"1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d","nonce":"<nonce>","lat":37.77493,"lng":-122.41942,"answer":0}'
+```
+
+```json
+{
+ "ok": true,
+ "proof": {
+ "id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "world_line_id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
+ "agent_id": "7c6b5a49-3827-1605-f4e3-d2c1b0a99887",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "coarse_cell": "9q8yyk",
+ "signature": "<base58 ed25519 signature>",
+ "signed_message": "three.ws/world-line-presence:v1|wl=1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d|cell=9q8yyk|nonce=<32-char nonce id>|who=<32-char completer hash>",
+ "signature_scheme": "ed25519",
+ "completed_at": "2026-07-30T11:02:14.318Z",
+ "verify_url": "/api/irl/world-lines/verify/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
+ },
+ "collectible": {
+ "mint": "presence:9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "name": "<reward_ref when set, else the quest title with a proof-of-presence suffix>",
+ "kind": "proof-of-presence",
+ "reward_kind": "collectible",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "signature": "<base58 ed25519 signature>",
+ "proof_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
+ }
+}
+```
+
+A repeat call returns `200` with `already_completed: true` and the original proof. Errors: `400` bad body, missing nonce, or bad id, `401 fix_required`, `403 not_colocated` or `403 invalid_nonce` (`reason`: `missing`, `malformed`, `forged`, `mismatch`), `404` unknown quest, `409 capacity_reached` or `409 already_completed`, `410 anchor_gone` or `410 invalid_nonce` with `reason: "expired"`, `422 challenge_failed` (wrong answer or passphrase, retryable with the same nonce), `429` rate limited, `502` if the agent could not sign or the server's own signature check failed.
+
+### `GET /api/irl/world-lines/mine`
+
+Creator dashboard. Auth. Returns up to 100 of your quests including hidden and expired ones, each with the full `challenge_spec`, plus a completions heatmap grouped by coarse cell.
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/mine -b 'session=<your session cookie>'
+```
+
+```json
+{
+ "world_lines": [ { "id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "title": "Find the lobby greeter", "completion_count": 12, "max_completions": 250, "coarse_cell": "9q8yyk", "expired": false, "hidden": false } ],
+ "heatmap": [ { "world_line_id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "coarse_cell": "9q8yyk", "completions": 12 } ]
+}
+```
+
+Errors: `401` not signed in.
+
+### `GET /api/irl/world-lines/collectibles`
+
+Your earned proofs, up to 200, newest first. Scoped to your session or your device token; one of the two is required (`400` otherwise).
+
+```bash
+curl -s https://three.ws/api/irl/world-lines/collectibles \
+ -H 'x-irl-device: 6b1e1c9a-0f4d-4e6a-9d7a-2f0c8b5a1e33'
+```
+
+```json
+{
+ "collectibles": [
+ {
+ "mint": "presence:9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "name": "<reward_ref when set, else the quest title with a proof-of-presence suffix>",
+ "kind": "proof-of-presence",
+ "reward_kind": "collectible",
+ "signer_pubkey": "<base58 ed25519 public key>",
+ "signature": "<base58 ed25519 signature>",
+ "proof_id": "9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
+ "world_line_id": "1b2a3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
+ "world_line_title": "Find the lobby greeter",
+ "difficulty": "easy",
+ "coarse_cell": "9q8yyk",
+ "earned_at": "2026-07-30T11:02:14.318Z",
+ "verify_url": "/api/irl/world-lines/verify/9f1c2d3e-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
+ }
+ ]
+}
+```
+
+### `GET /api/irl/world-lines/verify/:proofId`
+
+Public. See "Verifying a proof as a third party" above.
+
+---
+
+## Build on it with the SDK
+
+[`@three-ws/irl`](../packages/irl/README.md) wraps every endpoint with the presence plumbing handled for you: `nearbyWorldLines`, `browseWorldLines`, `getWorldLine`, `createWorldLine`, `myWorldLines`, `myCollectibles`, `challengeWorldLine`, `completeWorldLine`, and `verifyProof`. It mirrors the server's validation client-side (challenge kinds, difficulties, reward kinds, region cell shape) so a malformed quest fails fast with a readable message instead of a round-trip, and it normalizes snake_case responses into camelCase shapes.
+
+```js
+import { createIrl } from '@three-ws/irl';
+
+const irl = createIrl({ baseUrl: 'https://three.ws' });
+const presence = await irl.checkIn({ lat: 37.77493, lng: -122.41942 });
+
+const quests = await irl.nearbyWorldLines(presence, { radius: 400 });
+const started = await irl.challengeWorldLine({ worldLineId: quests[0].id, presence });
+const done = await irl.completeWorldLine({
+ worldLineId: quests[0].id,
+ nonce: started.nonce,
+ presence,
+ answer: started.challenge.kind === 'quiz' ? 0 : undefined,
+});
+
+const check = await irl.verifyProof(done.proof.id);
+console.log(check.verified, done.collectible.mint);
+```
+
+The zero-config path is the same functions imported directly (`import { checkIn, nearbyWorldLines } from '@three-ws/irl'`); use `createIrl` when you want to bind a base URL, an `apiKey` for signed-in creation, or a default device token once.
+
+---
+
+## Configuration
+
+| Variable | Effect if unset |
+| --- | --- |
+| `IRL_FIX_SECRET` (16+ chars) | Fix tokens are minted and verified with a stable non-secret dev key and the token gate is bypassed. The server-side distance check still runs. Required in production. |
+| `WORLD_LINE_SECRET` (16+ chars) | Nonces and completer hashes fall back to a stable non-secret dev key. Required in production. Rotating it invalidates outstanding nonces and changes every future completer hash, so past proofs stay verifiable while a visitor's hash for new quests changes. |
+
+Both handlers log their enforcement mode once per cold start, so a production misconfiguration is visible without grepping request logs.
+
+---
+
+## Related
+
+- [IRL: agents in the real world](./irl.md#world-lines), the product-level overview and the rest of the presence layer.
+- [IRL threat model](./irl/THREAT-MODEL.md), the adversarial analysis behind every radius and cap above.
+- [Place a 3D agent in your real environment](./tutorials/place-agent-irl.md), how to create the anchor pin a World Line needs.
+- [API reference](./api-reference.md), the one-screen summary of these endpoints alongside the rest of `/api/irl/*`.
+- [AR](./ar.md), the camera and WebXR layer the ceremony builds on.
diff --git a/packages/x402-mcp/examples/list-tools.mjs b/packages/x402-mcp/examples/list-tools.mjs
new file mode 100644
index 000000000..dded47239
--- /dev/null
+++ b/packages/x402-mcp/examples/list-tools.mjs
@@ -0,0 +1,104 @@
+// list-tools.mjs: print every tool @three-ws/x402-mcp advertises, with its
+// input schema.
+//
+// Spawns this package's own server over stdio the way the README runs it
+// (`node src/index.js`), performs the MCP initialize handshake, calls
+// tools/list, and prints each tool's title, annotation hints, and parameters.
+//
+// node examples/list-tools.mjs
+//
+// No key, no signer, no network payment: registration is env-free, so the
+// server advertises all four tools even with no SOLANA_SECRET_KEY set.
+
+import { fileURLToPath } from 'node:url';
+
+import { Client } from '@modelcontextprotocol/sdk/client/index.js';
+import {
+ StdioClientTransport,
+ getDefaultEnvironment,
+} from '@modelcontextprotocol/sdk/client/stdio.js';
+
+// The README's "Run standalone" entry point. Swap for
+// { command: 'npx', args: ['-y', '@three-ws/x402-mcp'] } to exercise the
+// published package instead of this checkout.
+const SERVER_PATH = fileURLToPath(new URL('../src/index.js', import.meta.url));
+
+// Env this server reads (see src/config.js). getDefaultEnvironment() drops
+// everything else, so an example never leaks unrelated secrets to the child.
+const FORWARDED_ENV = ['THREE_WS_BASE', 'THREE_WS_TIMEOUT_MS', 'SOLANA_RPC_URL'];
+
+function childEnv() {
+ const env = getDefaultEnvironment();
+ for (const key of FORWARDED_ENV) {
+ const value = process.env[key];
+ if (value) env[key] = value;
+ }
+ return env;
+}
+
+/** One-line summary of a tool's MCP annotation hints. */
+function hints(annotations) {
+ if (!annotations) return 'no hints';
+ const flags = [];
+ if (annotations.readOnlyHint) flags.push('read-only');
+ if (annotations.destructiveHint) flags.push('destructive');
+ if (annotations.idempotentHint) flags.push('idempotent');
+ if (annotations.openWorldHint) flags.push('open-world');
+ return flags.length ? flags.join(', ') : 'no hints';
+}
+
+/** Render a JSON Schema property as one readable constraint string. */
+function constraints(prop) {
+ const parts = [prop.type ?? 'any'];
+ if (Array.isArray(prop.enum)) parts.push(`one of ${prop.enum.join(' | ')}`);
+ if (prop.default !== undefined) parts.push(`default ${JSON.stringify(prop.default)}`);
+ if (prop.minimum !== undefined) parts.push(`min ${prop.minimum}`);
+ if (prop.maximum !== undefined) parts.push(`max ${prop.maximum}`);
+ if (prop.minLength !== undefined) parts.push(`minLength ${prop.minLength}`);
+ if (prop.maxLength !== undefined) parts.push(`maxLength ${prop.maxLength}`);
+ return parts.join(', ');
+}
+
+function printTool(tool, index) {
+ const schema = tool.inputSchema ?? {};
+ const properties = schema.properties ?? {};
+ const required = new Set(schema.required ?? []);
+ const names = Object.keys(properties);
+
+ console.log(`\n${index}. ${tool.name}`);
+ if (tool.title) console.log(` title: ${tool.title}`);
+ console.log(` hints: ${hints(tool.annotations)}`);
+ if (tool.description) console.log(` ${tool.description}`);
+ if (names.length === 0) {
+ console.log(' params: none');
+ return;
+ }
+ console.log(' params:');
+ for (const name of names) {
+ const prop = properties[name];
+ const flag = required.has(name) ? 'required' : 'optional';
+ console.log(` - ${name} (${flag}; ${constraints(prop)})`);
+ if (prop.description) console.log(` ${prop.description}`);
+ }
+}
+
+const transport = new StdioClientTransport({
+ command: process.execPath,
+ args: [SERVER_PATH],
+ env: childEnv(),
+ stderr: 'inherit',
+});
+const client = new Client({ name: 'x402-mcp-list-tools-example', version: '1.0.0' });
+
+await client.connect(transport);
+
+const server = client.getServerVersion();
+console.log(`server: ${server?.name} v${server?.version} (stdio)`);
+console.log(`capabilities: ${Object.keys(client.getServerCapabilities() ?? {}).join(', ') || 'none'}`);
+
+const { tools } = await client.listTools();
+console.log(`tools: ${tools.length}`);
+
+tools.forEach((tool, i) => printTool(tool, i + 1));
+
+await client.close();
diff --git a/pages/aws/index.html b/pages/aws/index.html
index e8c217771..9df83f5fc 100644
--- a/pages/aws/index.html
+++ b/pages/aws/index.html
@@ -81,6 +81,16 @@
.note { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; font-size: 14px; color: var(--muted); margin-top: 12px; }
.note strong { color: var(--text); }
+ .writing { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
+ .writing a { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; text-decoration: none; transition: border-color .18s ease, transform .18s ease, background-color .18s ease; }
+ .writing a:hover, .writing a:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
+ .writing a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
+ .writing a:active { transform: translateY(0); }
+ .writing .t { display: block; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; }
+ .writing .d { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.6; margin-top: 6px; }
+ .writing .m { display: block; color: var(--accent); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-top: 10px; }
+ @media (prefers-reduced-motion: reduce) { .writing a { transition: none; } .writing a:hover, .writing a:focus-visible { transform: none; } }
+
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 24px 60px; border-top: 1px solid var(--border); }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
@@ -254,6 +264,28 @@
</div>
</section>
+ <section>
+ <h2 data-i18n="aws_index.our_writing_on_the_aws_builder_center">Our writing on the AWS Builder Center.</h2>
+ <p class="sub" data-i18n="aws_index.we_publish_the_engineering_behind_this">We publish the engineering behind this integration on Amazon's community platform, under the official <a href="https://builder.aws.com/community/@threews" target="_blank" rel="noopener" style="color:var(--accent);text-decoration:none">@threews</a> account. Both articles link back to the Apache 2.0 source.</p>
+
+ <ul class="writing">
+ <li>
+ <a href="https://builder.aws.com/content/3ESpll50BdSp9eiCEIxcfG9pGUN/how-we-metered-a-saas-product-through-aws-marketplace-with-the-aws-sdk-for-javascript-v3" target="_blank" rel="noopener">
+ <span class="t" data-i18n="aws_index.how_we_metered_a_saas_product">How we metered a SaaS product through AWS Marketplace with the AWS SDK for JavaScript v3</span>
+ <span class="d" data-i18n="aws_index.resolvecustomer_meterusage_entitlements">ResolveCustomer, MeterUsage, GetEntitlements, and SNS lifecycle webhooks with real signature verification, then bridging an AWS CustomerIdentifier into the same access check that serves an on-chain x402 paywall.</span>
+ <span class="m">30 May 2026 · AWS Builder Center</span>
+ </a>
+ </li>
+ <li>
+ <a href="https://builder.aws.com/content/3FMY7S5o4lwzb40gDsCJRCE20cX/build-autonomous-ai-agents-with-d-bodies-and-on-chain-payments-threews-on-aws" target="_blank" rel="noopener">
+ <span class="t" data-i18n="aws_index.build_autonomous_ai_agents_with_3d_bodies">Build Autonomous AI Agents with 3D Bodies and On-Chain Payments</span>
+ <span class="d" data-i18n="aws_index.browser_native_3d_ai_agents_with_memory">Browser-native 3D AI agents with memory, on-chain wallets, and autonomous payments: available on AWS Marketplace, embeddable in one line of HTML, and governed before they act.</span>
+ <span class="m">27 June 2026 · AWS Builder Center</span>
+ </a>
+ </li>
+ </ul>
+ </section>
+
<section>
<h2 data-i18n="aws_index.get_notified_when_the_listing_goes_live">Get notified when the listing goes live.</h2>
<p class="sub" data-i18n="aws_index.the_aws_marketplace_listing_is_in_review">The AWS Marketplace listing is in review. Until it publishes, you can:</p>
diff --git a/pages/community.html b/pages/community.html
index dd21a2a16..fa3b0bee1 100644
--- a/pages/community.html
+++ b/pages/community.html
@@ -237,6 +237,12 @@
<p data-i18n="community.step_by_step_guides_for_creating_your">Step-by-step guides for creating your first agent, embedding on your site, minting on Solana, and adding paid skills.</p>
<a class="card-link" href="/tutorials" data-i18n="community.browse_tutorials">Browse tutorials →</a>
</div>
+ <div class="card">
+ <span class="icon">&#127970;</span>
+ <h2 data-i18n="community.ibm_user_group">IBM user group</h2>
+ <p data-i18n="community.a_public_group_on_ibm_community_for_developers">A public group on IBM Community for developers building AI agents with 3D capabilities: spatial reasoning, generative 3D, agentic pipelines, and real-time interactive systems. Threads, blogs, and a platform tour to start from.</p>
+ <a class="card-link" href="https://community.ibm.com/community/user/groups/community-home?communitykey=e71510cc-d953-408f-9a1c-019f5c0a7016" target="_blank" rel="noopener noreferrer" data-i18n="community.join_the_user_group">Join the user group →</a>
+ </div>
<div class="card">
<span class="icon">&#127942;</span>
<h2 data-i18n="community.rankings">Rankings</h2>
diff --git a/public/changelog.json b/public/changelog.json
index b27875211..94439016f 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-30T04:57:16.016Z",
+ "generated_at": "2026-07-30T05:00:04.686Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -142,6 +142,17 @@
"sdk"
]
},
+ {
+ "date": "2026-07-30",
+ "type": "update",
+ "title": "Our AWS Builder Center articles are now linked from the site and the docs",
+ "summary": "three.ws has published two engineering deep dives on Amazon's official AWS Builder Center, and until now nothing on the site pointed at either of them. Both are now linked from the AWS partner page, indexed in the docs with a note on exactly which open-source code each one walks through, and announced in the news feed with working links to the live articles. The news feed also stopped mislabelling articles published elsewhere as posts from X, so every piece is now credited to the place it actually appeared.",
+ "link": "/aws",
+ "tags": [
+ "docs",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-30",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index c52c412a6..59d37fb9c 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -110,6 +110,14 @@
<category>docs</category>
<description>A complete, hands-on walkthrough of the seller side of agent payments, written for anyone who wants their code to earn money from other people's AI agents. It covers how to tell whether a capability is worth charging for, how to set a price in fractions of a cent, the exact ordering that keeps you honest (check the payment, do the work, only then take the money, so a failure never charges anyone), how to charge per tool inside an assistant connector, how to get listed where agents shop for paid services, and how to prove an assistant can find and buy your service with no human involved. Every example is real and every endpoint quoted is live, including one you can try from a terminal in one line.</description>
</item>
+ <item>
+ <title>Our AWS Builder Center articles are now linked from the site and the docs</title>
+ <link>https://three.ws/aws</link>
+ <guid isPermaLink="false">2026-07-30:Our AWS Builder Center articles are now linked from the site and the docs</guid>
+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>
+ <category>docs</category>
+ <description>three.ws has published two engineering deep dives on Amazon's official AWS Builder Center, and until now nothing on the site pointed at either of them. Both are now linked from the AWS partner page, indexed in the docs with a note on exactly which open-source code each one walks through, and announced in the news feed with working links to the live articles. The news feed also stopped mislabelling articles published elsewhere as posts from X, so every piece is now credited to the place it actually appeared.</description>
+ </item>
<item>
<title>Paid requests stop being refused after they were already served</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index 3d2623543..51bbf5205 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-30T04:57:16.009Z",
+ "generated_at": "2026-07-30T05:00:04.679Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/footer.html b/public/footer.html
index 242ef3e86..54fa60c94 100644
--- a/public/footer.html
+++ b/public/footer.html
@@ -88,6 +88,7 @@
<h3 class="h-footer-link-heading" data-i18n="footer.resources">Resources</h3>
<a href="/dashboard" data-i18n="footer.dashboard">Dashboard</a>
<a href="/community" data-i18n="footer.community">Community</a>
+ <a href="https://community.ibm.com/community/user/groups/community-home?communitykey=e71510cc-d953-408f-9a1c-019f5c0a7016" target="_blank" rel="noopener" data-i18n="footer.ibm_user_group">IBM user group</a>
<a href="/tutorials" data-i18n="footer.tutorials">Tutorials</a>
<a href="/press" data-i18n="footer.press_kit">Press kit</a>
</div>
diff --git a/public/locales/en.json b/public/locales/en.json
index 742cae3fe..93051ed89 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -2800,6 +2800,9 @@
"newsletter": "Newsletter",
"nirholas_three_ws": "nirholas/three.ws →",
"open_the_full_feed": "Open the full feed →",
+ "ibm_user_group": "IBM user group",
+ "a_public_group_on_ibm_community_for_developers": "A public group on IBM Community for developers building AI agents with 3D capabilities: spatial reasoning, generative 3D, agentic pipelines, and real-time interactive systems. Threads, blogs, and a platform tour to start from.",
+ "join_the_user_group": "Join the user group →",
"rankings": "Rankings",
"read_the_docs": "Read the docs →",
"report_bugs_open_an_issue_on_github": "<strong>Report bugs.</strong> Open an issue on <a href=\"https://github.com/nirholas/three.ws/issues\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub</a> — we triage daily.",
@@ -7797,6 +7800,7 @@
"github": "GitHub",
"give_your_ai_a_body": "Give your AI a body.",
"ibm_community": "IBM Community",
+ "ibm_user_group": "IBM user group",
"image_to_3d": "Image to 3D",
"join_the_community": "Join the community",
"kucoin": "KuCoin",
diff --git a/public/screenshots/chat.png b/public/screenshots/chat.png
new file mode 100644
index 000000000..0e765ba8d
Binary files /dev/null and b/public/screenshots/chat.png differ
diff --git a/public/screenshots/city.png b/public/screenshots/city.png
index 095297910..33fb54a29 100644
Binary files a/public/screenshots/city.png and b/public/screenshots/city.png differ
diff --git a/public/screenshots/club.png b/public/screenshots/club.png
new file mode 100644
index 000000000..2dafad65f
Binary files /dev/null and b/public/screenshots/club.png differ
diff --git a/public/screenshots/demos.png b/public/screenshots/demos.png
new file mode 100644
index 000000000..b376129a4
Binary files /dev/null and b/public/screenshots/demos.png differ
diff --git a/public/screenshots/galaxy.png b/public/screenshots/galaxy.png
new file mode 100644
index 000000000..a70860519
Binary files /dev/null and b/public/screenshots/galaxy.png differ
diff --git a/public/screenshots/landing.png b/public/screenshots/landing.png
index 70a9bc20c..137cdec86 100644
Binary files a/public/screenshots/landing.png and b/public/screenshots/landing.png differ
diff --git a/public/screenshots/marketplace.png b/public/screenshots/marketplace.png
new file mode 100644
index 000000000..b417299d2
Binary files /dev/null and b/public/screenshots/marketplace.png differ
diff --git a/public/screenshots/pulse.png b/public/screenshots/pulse.png
new file mode 100644
index 000000000..942a5ccd8
Binary files /dev/null and b/public/screenshots/pulse.png differ
diff --git a/public/screenshots/vanity-wallet.png b/public/screenshots/vanity-wallet.png
new file mode 100644
index 000000000..af594e2a4
Binary files /dev/null and b/public/screenshots/vanity-wallet.png differ
diff --git a/public/screenshots/viewer.png b/public/screenshots/viewer.png
index 616d4aad0..296ecb73a 100644
Binary files a/public/screenshots/viewer.png and b/public/screenshots/viewer.png differ
diff --git a/scripts/build-news.mjs b/scripts/build-news.mjs
index 3f61abd1b..168be9e6c 100644
--- a/scripts/build-news.mjs
+++ b/scripts/build-news.mjs
@@ -232,7 +232,7 @@ function renderArticlePage(item) {
? `<figure class="hero"><img src="${escapeAttr(item.image)}" alt="${escapeAttr(imageAlt)}" loading="eager" fetchpriority="high"${heroDims}/></figure>`
: '';
const externalAttribution = item.externalLink
- ? `<p><em>Originally shared on <a href="${escapeAttr(item.externalLink)}" rel="noopener">X</a>.</em></p>`
+ ? `<p><em>Originally published on <a href="${escapeAttr(item.externalLink)}" rel="noopener">${escapeHtml(item.externalSource || 'X')}</a>.</em></p>`
: '';
return `<!DOCTYPE html>
<html lang="en">
diff --git a/tests/x402-seed-tx-uniqueness.test.js b/tests/x402-seed-tx-uniqueness.test.js
new file mode 100644
index 000000000..952f737ab
--- /dev/null
+++ b/tests/x402-seed-tx-uniqueness.test.js
@@ -0,0 +1,133 @@
+// Every transaction in a seed batch must be DISTINCT on the wire.
+//
+// Regression guard for a live production failure (measured 2026-07-30): the
+// seeder built its batch by calling buildPaymentTx() N times with identical
+// arguments. Every input is fixed across a tick (one blockhash, one amount, one
+// pair of token accounts, one decimals value) and the priority fee was the
+// constant `microLamports: 1`, so all N transactions serialized to the SAME
+// bytes.
+//
+// Identical bytes mean a single signature, and the paid endpoint derives
+// paymentId by hashing the payment proof. So the whole batch collided on one id:
+// exactly one call landed and the rest returned 409 writeConflict/writeInflight,
+// while any that raced past that guard reached the chain as a duplicate
+// signature and settled as `broadcast_failed` with empty simulation logs. About
+// 40 of every 41 calls per tick were lost, making this the single largest source
+// of 4xx on the fleet at ~2,403/hour, and it falsified the cron's own promise of
+// "60 real Solana micropayments per tick".
+//
+// The fix spreads the compute-unit price by index, which is the only field free
+// to vary without changing what the payment DOES. This test pins that: same
+// inputs, different index, different bytes, and the transfer itself untouched.
+
+import { describe, it, expect, beforeAll } from 'vitest';
+import { Keypair, PublicKey } from '@solana/web3.js';
+
+let buildPaymentTx;
+let VersionedTransaction;
+
+// A fixed, valid-shaped accept for the Solana exact scheme. The mint is $THREE
+// and the wallets are throwaway keypairs, so nothing here touches a real payer.
+const buyer = Keypair.generate();
+const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';
+const blockhash = '11111111111111111111111111111111';
+
+function accept() {
+ return {
+ asset: THREE_MINT,
+ payTo: Keypair.generate().publicKey.toBase58(),
+ amount: '1000',
+ network: 'solana',
+ extra: { feePayer: Keypair.generate().publicKey.toBase58() },
+ };
+}
+
+const ACCEPT = accept();
+const args = { accept: ACCEPT, buyer, blockhash, mintInfo: { decimals: 6 }, receiverAtaExists: true };
+
+beforeAll(async () => {
+ ({ buildPaymentTx } = await import('../api/cron/x402-seed-cron.js'));
+ ({ VersionedTransaction } = await import('@solana/web3.js'));
+});
+
+describe('seed batch transactions are unique per index', () => {
+ it('produces different bytes for every index in a batch', () => {
+ const batch = Array.from({ length: 60 }, (_, index) => buildPaymentTx({ ...args, index }));
+ // The regression: this set had size 1.
+ expect(new Set(batch).size).toBe(60);
+ });
+
+ it("produces a different buyer signature, so the chain sees distinct transactions", () => {
+ // signatures[0] belongs to the fee payer, which the seeder does NOT sign
+ // (the sponsor cosigns at settle), so slot 0 is all zeros on every build.
+ // The buyer's slot is the one that must vary.
+ const buyerSig = (index) => {
+ const tx = VersionedTransaction.deserialize(
+ Buffer.from(buildPaymentTx({ ...args, index }), 'base64'),
+ );
+ const slot = tx.message.staticAccountKeys
+ .slice(0, tx.message.header.numRequiredSignatures)
+ .findIndex((k) => k.equals(buyer.publicKey));
+ expect(slot).toBeGreaterThan(-1);
+ const sig = Buffer.from(tx.signatures[slot]);
+ expect(sig.some((b) => b !== 0)).toBe(true); // actually signed
+ return sig.toString('base64');
+ };
+
+ const sigs = Array.from({ length: 10 }, (_, index) => buyerSig(index));
+ expect(new Set(sigs).size).toBe(10);
+ });
+
+ it('is deterministic for a given index, so a retry rebuilds the same tx', () => {
+ expect(buildPaymentTx({ ...args, index: 7 })).toBe(buildPaymentTx({ ...args, index: 7 }));
+ });
+
+ it('defaults to index 0 so a single-payment caller is unchanged', () => {
+ expect(buildPaymentTx(args)).toBe(buildPaymentTx({ ...args, index: 0 }));
+ });
+
+ it('varies only the priority fee, never the payment itself', () => {
+ const decode = (index) =>
+ VersionedTransaction.deserialize(
+ Buffer.from(buildPaymentTx({ ...args, index }), 'base64'),
+ ).message;
+
+ const a = decode(0);
+ const b = decode(41);
+
+ // Same accounts, same programs, same instruction shape: only the compute
+ // budget instruction's data differs, so the transfer is byte-identical.
+ expect(b.staticAccountKeys.map(String)).toEqual(a.staticAccountKeys.map(String));
+ expect(b.compiledInstructions).toHaveLength(a.compiledInstructions.length);
+
+ const differing = a.compiledInstructions
+ .map((ix, i) => ({
+ i,
+ same: Buffer.from(ix.data).equals(Buffer.from(b.compiledInstructions[i].data)),
+ }))
+ .filter((x) => !x.same)
+ .map((x) => x.i);
+ expect(differing).toEqual([1]); // index 1 is setComputeUnitPrice
+
+ // The transfer instruction (last) is untouched: same program, same data.
+ const last = a.compiledInstructions.length - 1;
+ expect(Buffer.from(b.compiledInstructions[last].data)).toEqual(
+ Buffer.from(a.compiledInstructions[last].data),
+ );
+ expect(String(b.staticAccountKeys[b.compiledInstructions[last].programIdIndex])).toBe(
+ String(a.staticAccountKeys[a.compiledInstructions[last].programIdIndex]),
+ );
+ });
+
+ it('keeps the fee spread small enough to be free in practice', () => {
+ // 60k compute units at (1 + index) microLamports is 0.06 * (1+index)
+ // lamports, so even the last call in a 60-batch costs a few lamports.
+ const worstCaseLamports = (60_000 * (1 + 59)) / 1_000_000;
+ expect(worstCaseLamports).toBeLessThan(5);
+ });
+
+ it('uses a real payTo account, not the fee payer', () => {
+ expect(ACCEPT.payTo).not.toBe(ACCEPT.extra.feePayer);
+ expect(() => new PublicKey(ACCEPT.payTo)).not.toThrow();
+ });
+});