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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(x402): accept Phantom's Lighthouse guard instructions instead of telling buyers to disable protection
ni3a9e2f379d5458
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 11c87df9d..9c9686618 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,10 @@Public history for [three.ws](https://three.ws), newest first. New pages come from `added` dates in data/pages.json; everything else is curated in data/changelog.json. Also available as [JSON](https://three.ws/changelog.json) and [RSS](https://three.ws/changelog.xml), live at [three.ws/changelog](https://three.ws/changelog).+## 2026-09-21++- **Phantom users no longer have to switch off transaction protection to pay**: Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee. (`/club`) `[fix]`+## 2026-09-20- **$THREE Launchpad** (`/three-launchpad`): A bonding-curve launchpad priced in $THREE: every coin launched for a 3D agent is bought with $THREE, creators earn their fees in $THREE, and each graduation locks the $THREE it raised in a pool nobody can withdraw. Launch a coin or trade the live curves.diff --git a/api/_lib/x402/self-facilitator.js b/api/_lib/x402/self-facilitator.jsindex 776fb6e7d..8c961c022 100644--- a/api/_lib/x402/self-facilitator.js+++ b/api/_lib/x402/self-facilitator.js@@ -63,6 +63,21 @@ const MEMO_PROGRAM_IDS = [new PublicKey('Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo'),];+// Lighthouse, the on-chain assertion program. Phantom's transaction protection+// injects one or more Lighthouse instructions into a transaction before the+// user signs it: they assert the buyer's balances end up where the wallet's+// simulation said they would, and revert the transaction otherwise. They move+// nothing, and the reference x402 SVM facilitator (@x402/svm) accepts them for+// the same reason. Refusing them locked every Phantom buyer with protection on+// out of the rail, which is Phantom's default. One constraint is ours alone:+// Lighthouse also has a memory-write instruction that charges a payer account+// for a PDA, so in sponsor mode a Lighthouse instruction may never name the+// sponsor's fee-payer account. Enforced below, once the mode is known.+const LIGHTHOUSE_PROGRAM_ID = new PublicKey('L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95');+// Phantom injects one or two. The ceiling keeps a hostile client from padding+// a sponsored transaction with compute it does not pay for.+const MAX_LIGHTHOUSE_INSTRUCTIONS = 3;+// SPL Token instruction tag for TransferChecked. Plain Transfer (3) is rejected —// TransferChecked commits the mint + decimals, so we can trust the decoded mint.const SPL_TRANSFER_CHECKED = 12;@@ -245,6 +260,8 @@ export function validateRingTransaction({ txBase64, requirement, feePayerPubkey,let cuLimit = 200_000; // Solana default when unsetlet cuPrice = 0n;let ataCreatePresent = false;+ let lighthouseCount = 0;+ let lighthouseTouchesFeePayer = false;const ixs = msg.compiledInstructions;try {@@ -277,6 +294,19 @@ export function validateRingTransaction({ txBase64, requirement, feePayerPubkey,continue;}+ if (programId.equals(LIGHTHOUSE_PROGRAM_ID)) {+ // Wallet-injected assertions (see LIGHTHOUSE_PROGRAM_ID). Carries no+ // fund movement of its own; whether it may name the fee payer depends+ // on the mode, decided after the loop.+ if (!accts.every(idxInRange)) return { ok: false, reason: 'malformed_instruction' };+ lighthouseCount += 1;+ if (lighthouseCount > MAX_LIGHTHOUSE_INSTRUCTIONS) {+ return { ok: false, reason: `too_many_guard_instructions:${lighthouseCount}` };+ }+ if (accts.includes(0)) lighthouseTouchesFeePayer = true;+ continue;+ }+if (programId.equals(ASSOCIATED_TOKEN_PROGRAM_ID)) {// Only permit creating OUR recipient's ATA, funded by the sponsor.// Accounts: [funder, ata, owner, mint, systemProgram, tokenProgram].@@ -378,6 +408,12 @@ export function validateRingTransaction({ txBase64, requirement, feePayerPubkey,if (!feePayerPubkey || feePayer.toBase58() !== feePayerPubkey) {return { ok: false, reason: `fee_payer_not_sponsor:${feePayer.toBase58()}` };}+ // The sponsor signs the whole message, so an instruction that names its+ // account could charge it. A buyer's wallet guards the buyer's accounts+ // and has no reason to reference ours.+ if (lighthouseTouchesFeePayer) {+ return { ok: false, reason: 'guard_instruction_references_sponsor' };+ }}// Bound the priority fee the fee-paying wallet will pay.diff --git a/data/changelog.json b/data/changelog.jsonindex bbfd24151..8b2ae8d6a 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -28604,6 +28604,15 @@"improvement"],"link": "/club"+ },+ {+ "date": "2026-09-21",+ "title": "Phantom users no longer have to switch off transaction protection to pay",+ "summary": "Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee.",+ "tags": [+ "fix"+ ],+ "link": "/club"}]}diff --git a/docs/x402-ring-economy.md b/docs/x402-ring-economy.mdindex a94d829b8..7d226eed2 100644--- a/docs/x402-ring-economy.md+++ b/docs/x402-ring-economy.md@@ -312,6 +312,18 @@ then kept in a verified, watched, auto-fundable state:allowlisted payTo}`. No System instructions (no SOL transfer out), cappedpriority fee, recipient must be allowlisted. This blocks the "anyone drainsthe sponsor" attack **and** enforces "only our wallets settle here".+ - **Wallet guard instructions.** Phantom's transaction protection, on by+ default, injects Lighthouse assertion instructions (program+ `L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95`) before the buyer signs. They+ move nothing and only revert the transaction if the buyer's balances end up+ somewhere unexpected, so the facilitator accepts up to three of them, as the+ reference `@x402/svm` facilitator does. In sponsor mode a guard instruction+ that names the sponsor's fee-payer account is refused as+ `guard_instruction_references_sponsor`, because Lighthouse can also charge a+ payer for a memory account. The checkout modal+ ([public/x402.js](../public/x402.js), `classifyWalletTxMutation`) applies the+ same rule before it sends anything, so a buyer is never told to turn+ protection off for a payment that would have settled.- **Both token programs.** USDC is a classic SPL Token mint and `$THREE` is aToken-2022 mint, and the two derive different associated token accounts forthe same wallet. The facilitator pins the program from the mintdiff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 1ee7d8cc7..c19bee85f 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,14 +1,24 @@{- "generated_at": "2026-09-20T21:24:24.206Z",+ "generated_at": "2026-09-21T02:16:08.975Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3737,+ "total": 3738,"complete": false,"full_feed": "/changelog.json","entries": [+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Phantom users no longer have to switch off transaction protection to pay",+ "summary": "Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee.",+ "link": "/club",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-20","type": "launch",@@ -1607,17 +1617,6 @@"fix","improvement"]- },- {- "date": "2026-09-09",- "type": "update",- "title": "The sniper scoreboard now links out to the pages that explain what it is showing you",- "summary": "A full audit of /sniper/experiments, the live board comparing rule-driven sniper agents against LLM-judged ones on the same market. The board is dense with terms it could only gloss in a hover tooltip: earned autonomy tiers, moon bags, the reasoning ledger behind every verdict, the exit ladder. A reader who wanted the real explanation had nowhere to go. The page now ends with a row of links to the seven surfaces that write each of those up, from the live Sniper Arena floor to the earned-autonomy docs and the page where you arm your own agent. Four smaller fixes came with it. The Best arm tile printed its profit in plain white even when that number was a loss, so a losing leader read as a win at a glance; it is now coloured like every other figure on the board. An arm or a judge with no model recorded against it used to crash the whole render; it now reads as unattributed and the rest of the board keeps working. Both tables label their column headers properly, so a screen reader can pair a figure with the column it belongs to across nine columns. And the time-window buttons are declared as buttons rather than defaulting to form submits.",- "link": "/sniper/experiments",- "tags": [- "improvement",- "fix"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex fa547abc3..08a1bb7e3 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,11 +1,21 @@{- "generated_at": "2026-09-20T21:24:24.136Z",+ "generated_at": "2026-09-21T02:16:08.903Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},"entries": [+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Phantom users no longer have to switch off transaction protection to pay",+ "summary": "Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee.",+ "link": "/club",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-20","type": "launch",diff --git a/public/changelog.xml b/public/changelog.xmlindex 7a8fd2af2..caabb09bd 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -6,6 +6,14 @@<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/><description>What's new on three.ws: features, improvements, and releases, newest first.</description><language>en</language>+ <item>+ <title>Phantom users no longer have to switch off transaction protection to pay</title>+ <link>https://three.ws/club</link>+ <guid isPermaLink="false">2026-09-21:Phantom users no longer have to switch off transaction protection to pay</guid>+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee.</description>+ </item><item><title>$THREE Launchpad</title><link>https://three.ws/three-launchpad</link>diff --git a/public/features.json b/public/features.jsonindex 03b928c60..32b0efc94 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-20T21:13:00.621Z",+ "generated_at": "2026-09-21T02:16:08.867Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/x402.js b/public/x402.jsindex 79d9eb667..657f4ff5e 100644--- a/public/x402.js+++ b/public/x402.js@@ -2324,10 +2324,14 @@ function bytesEqual(a, b) {// accepts any ComputeBudget instruction set within its fee caps and never pins// the blockhash to what /prepare issued, so a wallet that only injects or// retunes priority-fee instructions (Phantom and Solflare both do) still-// produces a settleable payment. What it hard-rejects is any other change:-// foreign programs (e.g. wallet-guard instructions), a modified transfer, or a-// swapped fee payer. Mirror exactly that line here.+// produces a settleable payment. It also accepts Lighthouse guard instructions,+// the balance assertions Phantom's transaction protection injects by default,+// up to a small ceiling and only while they leave a sponsoring fee payer alone.+// What it hard-rejects is any other change: other foreign programs, a modified+// transfer, or a swapped fee payer. Mirror exactly that line here.const COMPUTE_BUDGET_PROGRAM = 'ComputeBudget111111111111111111111111111111';+const LIGHTHOUSE_PROGRAM = 'L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95';+const MAX_LIGHTHOUSE_INSTRUCTIONS = 3;// Resolve a v0 message's instructions to index-independent form so the// comparison survives the wallet reordering or appending account keys.@@ -2342,6 +2346,21 @@ function resolveNonBudgetInstructions(message) {.filter((ix) => ix.program !== COMPUTE_BUDGET_PROGRAM);}+// Why the facilitator would refuse the wallet's guard instructions, or null when+// it accepts them. A second required signature means a sponsor pays the fee, and+// a guard that names the sponsor's account could charge it.+function guardInstructionVeto(message, guardIxs) {+ if (guardIxs.length > MAX_LIGHTHOUSE_INSTRUCTIONS) {+ return `it added ${guardIxs.length} guard instructions, more than a payment may carry`;+ }+ const sponsored = message.header.numRequiredSignatures > 1;+ const feePayer = message.staticAccountKeys[0]?.toBase58();+ if (sponsored && guardIxs.some((ix) => ix.accounts.includes(feePayer))) {+ return 'it added a guard instruction that touches the fee sponsor account';+ }+ return null;+}+// Decide whether a wallet's pre-signing rewrite of the prepared transaction is// benign (ComputeBudget/blockhash only → returns null, proceed to settle) or// blocking (returns a short human-readable reason for the checkout error).@@ -2357,7 +2376,13 @@ export function classifyWalletTxMutation(preparedTx, signedTx) {return 'it changed the transaction fee payer';}const preparedIxs = resolveNonBudgetInstructions(prepared);- const signedIxs = resolveNonBudgetInstructions(signed);+ const signedAll = resolveNonBudgetInstructions(signed);+ const guardVeto = guardInstructionVeto(+ signed,+ signedAll.filter((ix) => ix.program === LIGHTHOUSE_PROGRAM),+ );+ if (guardVeto) return guardVeto;+ const signedIxs = signedAll.filter((ix) => ix.program !== LIGHTHOUSE_PROGRAM);if (signedIxs.length !== preparedIxs.length) {const preparedPrograms = new Set(preparedIxs.map((ix) => ix.program));const added = signedIxs.find((ix) => !preparedPrograms.has(ix.program));diff --git a/tests/x402-self-facilitator-settleable.test.js b/tests/x402-self-facilitator-settleable.test.jsindex a64fc0bff..06cd59da5 100644--- a/tests/x402-self-facilitator-settleable.test.js+++ b/tests/x402-self-facilitator-settleable.test.js@@ -14,6 +14,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest';import {Keypair,PublicKey,+ TransactionInstruction,TransactionMessage,VersionedTransaction,ComputeBudgetProgram,@@ -439,3 +440,77 @@ describe('Token-2022 mints settle on the same rail as classic ones', () => {expect(res.invalidReason).toMatch(/^token_program_unresolved:/);});});++// Phantom's transaction protection (on by default) injects Lighthouse assertion+// instructions before the user signs. The facilitator refused them as+// `program_not_allowed`, and the checkout modal, mirroring that, told the buyer+// to switch protection off. Live at the /club door on 2026-09-21 paying in USDC.+// The reference x402 SVM facilitator accepts them; so does this one, with the+// one guard a sponsored rail needs.+describe('wallet-injected Lighthouse guard instructions', () => {+ const LIGHTHOUSE = new PublicKey('L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95');++ function buildGuardedPayment({ sponsored, guardAccounts, guardCount = 1 }) {+ const buyer = Keypair.generate();+ const sponsor = Keypair.generate();+ const recipientOwner = Keypair.generate();+ const mint = Keypair.generate().publicKey;+ const sourceAta = getAssociatedTokenAddressSync(mint, buyer.publicKey);+ const destAta = getAssociatedTokenAddressSync(mint, recipientOwner.publicKey);+ const named = { buyer: buyer.publicKey, sponsor: sponsor.publicKey, source: sourceAta };+ const guards = Array.from({ length: guardCount }, () => new TransactionInstruction({+ programId: LIGHTHOUSE,+ keys: guardAccounts.map((k) => ({ pubkey: named[k], isSigner: false, isWritable: false })),+ data: Buffer.from([9, 0, 1]),+ }));+ process.env.X402_ASSET_MINT_SOLANA = mint.toBase58();+ process.env.X402_PAY_TO_SOLANA = recipientOwner.publicKey.toBase58();+ const message = new TransactionMessage({+ payerKey: sponsored ? sponsor.publicKey : buyer.publicKey,+ recentBlockhash: '11111111111111111111111111111111',+ instructions: [+ ComputeBudgetProgram.setComputeUnitLimit({ units: 120_000 }),+ createTransferCheckedInstruction(+ sourceAta, mint, destAta, buyer.publicKey, AMOUNT_ATOMIC, DECIMALS,+ ),+ ...guards,+ ],+ }).compileToV0Message();+ return validateRingTransaction({+ txBase64: Buffer.from(new VersionedTransaction(message).serialize()).toString('base64'),+ requirement: {+ network: 'solana',+ asset: mint.toBase58(),+ amount: String(AMOUNT_ATOMIC),+ payTo: recipientOwner.publicKey.toBase58(),+ },+ feePayerPubkey: sponsor.publicKey.toBase58(),+ allowlist: new Set([recipientOwner.publicKey.toBase58()]),+ });+ }++ it('settles a sponsored payment whose guards assert on the buyer', () => {+ const out = buildGuardedPayment({ sponsored: true, guardAccounts: ['buyer', 'source'], guardCount: 2 });+ expect(out.reason).toBeUndefined();+ expect(out.ok).toBe(true);+ expect(out.decoded.selfPay).toBe(false);+ });++ it('settles a self-pay payment whose guard names the buyer as fee payer', () => {+ const out = buildGuardedPayment({ sponsored: false, guardAccounts: ['buyer'] });+ expect(out.ok).toBe(true);+ expect(out.decoded.selfPay).toBe(true);+ });++ it('refuses a guard instruction that names the sponsor account', () => {+ const out = buildGuardedPayment({ sponsored: true, guardAccounts: ['buyer', 'sponsor'] });+ expect(out.ok).toBe(false);+ expect(out.reason).toBe('guard_instruction_references_sponsor');+ });++ it('refuses more guard instructions than the ceiling', () => {+ const out = buildGuardedPayment({ sponsored: true, guardAccounts: ['buyer'], guardCount: 4 });+ expect(out.ok).toBe(false);+ expect(out.reason).toBe('too_many_guard_instructions:4');+ });+});diff --git a/tests/x402-wallet-rewrite.test.js b/tests/x402-wallet-rewrite.test.jsindex 57615c3b1..a44cf29b4 100644--- a/tests/x402-wallet-rewrite.test.js+++ b/tests/x402-wallet-rewrite.test.js@@ -120,6 +120,58 @@ describe('classifyWalletTxMutation', () => {);});+ // Phantom's transaction protection injects Lighthouse balance assertions by+ // default. The facilitator settles them (as the reference x402 facilitator+ // does), so bouncing them here locked every protected Phantom buyer out of+ // the /club door with a "turn off transaction modification" message.+ describe('Lighthouse guard instructions', () => {+ const lighthouse = new PublicKey('L2TExMFKdjpN9kozasaurPirfHy9P8sbXoAN1qA3S95');+ const guardIx = (accounts) =>+ new TransactionInstruction({+ programId: lighthouse,+ keys: accounts.map((pubkey) => ({ pubkey, isSigner: false, isWritable: false })),+ data: Buffer.from([9, 0, 1]),+ });++ it('accepts assertions on the buyer in a sponsored payment', () => {+ const prepared = buildTx({ instructions: preparedIxs });+ const signed = buildTx({ instructions: [...preparedIxs, guardIx([buyer]), guardIx([buyer])] });+ expect(classifyWalletTxMutation(prepared, signed)).toBeNull();+ });++ it('accepts assertions on the fee payer when the buyer pays its own fee', () => {+ const prepared = buildTx({ payerKey: buyer, instructions: preparedIxs });+ const signed = buildTx({ payerKey: buyer, instructions: [...preparedIxs, guardIx([buyer])] });+ expect(classifyWalletTxMutation(prepared, signed)).toBeNull();+ });++ it('blocks a guard instruction that names the sponsor fee payer', () => {+ const prepared = buildTx({ instructions: preparedIxs });+ const signed = buildTx({ instructions: [...preparedIxs, guardIx([feePayer])] });+ expect(classifyWalletTxMutation(prepared, signed)).toBe(+ 'it added a guard instruction that touches the fee sponsor account',+ );+ });++ it('blocks more guard instructions than a payment may carry', () => {+ const prepared = buildTx({ instructions: preparedIxs });+ const signed = buildTx({+ instructions: [...preparedIxs, guardIx([buyer]), guardIx([buyer]), guardIx([buyer]), guardIx([buyer])],+ });+ expect(classifyWalletTxMutation(prepared, signed)).toBe(+ 'it added 4 guard instructions, more than a payment may carry',+ );+ });++ it('still blocks a changed transfer hidden next to a guard instruction', () => {+ const prepared = buildTx({ instructions: preparedIxs });+ const signed = buildTx({+ instructions: [preparedIxs[0], preparedIxs[1], transferIx({ amount: 255 }), guardIx([buyer])],+ });+ expect(classifyWalletTxMutation(prepared, signed)).toBe('it changed the payment instructions');+ });+ });+it('blocks a changed transfer amount', () => {const prepared = buildTx({ instructions: preparedIxs });const signed = buildTx({