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 Solana agent-bouncer + reputation surface; tutorial and docs

nirholas4a86a9438d80
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff03315a4..b1f26287b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,9 +7,11 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-06-22
- **Docs · Agent Reputation** (`/docs/agent-reputation`) — Why autonomous agents need verifiable trust, and how three.ws delivers portable on-chain reputation.
+- **Docs · Agent Reputation on Solana** (`/docs/solana-reputation`) — How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.
- **Docs · Reputation System** (`/docs/reputation`) — Leave and read permanent, on-chain reviews for any registered agent via the UI, SDK, or contract.
- **Docs · Validation Attestations** (`/docs/validation`) — Record and read on-chain attestations that an agent's 3D model passes glTF validation.
- **Pitch Deck** (`/pitch`) — The three.ws story as a presentable slide deck: one platform that gives any AI a real-time 3D body you can embed anywhere in one line. Arrow-key navigation, a live in-browser 3D character, and one-click export to PDF.
+- **Tutorial · Read a Solana agent's reputation** (`/tutorials/solana-agent-reputation`) — Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.
- **Tutorial · Read an agent's reputation** (`/tutorials/agent-reputation`) — Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.
- **Chat embeds now load on any site** — The embed editor's Chat mode produced a snippet that worked in the live preview but stayed blank once pasted onto an external site. The agent chat page was served with a frame-ancestors policy that only allowed three.ws itself, so every other domain's browser blocked the iframe. Chat embeds now ship the same open framing policy as the avatar embed modes, and the embedded chat page can use the microphone for voice input. Paste the snippet anywhere and it just works. (`/embed`) `[fix]`
- **Embedded avatars never show a blank frame** — A walking-avatar embed whose avatar can't load — a deleted or mistyped ID, a private avatar a public page can't read, or a dropped connection — now shows the default avatar walking with a short 'couldn't load that avatar — showing the default' note, instead of leaving an empty, all-dark frame on the host page. The embed always renders a body. The embed editor now flags an avatar ID it can't find with a clear 'not found' marker and tells you to pick a public or unlisted avatar, rather than silently keeping a dead ID. And owners can now load their own private avatar's 3D file when signed in, which previously failed even for the avatar's owner. (`/embed`) `[fix]`
@@ -20,6 +22,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **IBM x402 demo works when embedded in IBM's CMS** — The five live demos on the IBM partnership page — Forge, x402 micropayments, the 3D agent, Play, and IRL — now run correctly when the page is embedded inside IBM's content platform, not only when opened directly. IBM serves the embed from a Seismic gateway address, and the browser was silently blocking it: the free 3D generator reported 'briefly unreachable' and the wallet payment couldn't reach the Solana network, because three.ws didn't yet recognize that gateway as an allowed origin. three.ws now trusts IBM's Seismic-served origins for both data calls and embedding, so the free Forge, the on-chain payment flow, and the inline Play/IRL worlds all work on the embedded page. (`/ibm/x402-demo`) `[fix, infra]`
- **Live webinar stage on the IBM x402 demo page** — The IBM × three.ws demo page now opens with a webinar stage: a live countdown to the session, with one-click Add to Calendar (Google + .ics). When the talk goes live, the same stage becomes the player — a pre-recorded video plays synced to wall-clock like a broadcast premiere (everyone sees the same moment, latecomers join in progress), or a live feed streams in its place. The recording stays on the page afterward, and the x402 demos sit right below so you can watch and try them on one screen. (`/ibm/x402-demo`) `[feature]`
- **New doc: every NVIDIA model three.ws runs for free** — A new docs page maps the entire free NVIDIA inference layer the platform runs on — one free key unlocks all of it. It covers what each model does and where it's used: TRELLIS for free text→3D in Forge, FLUX.1-schnell for text→image, the Llama 3.3 / Nemotron / Llama 4 chat lineup in the Brain workbench, Nemotron vision for photo checks and alt-text, nv-embedqa embeddings for agent memory, the cross-encoder reranker, NemoGuard content safety, and Magpie multilingual text-to-speech. Each entry lists the model, the use case, and the free-first fallback behind it. (`/docs/nvidia-models`) `[docs]`
+- **New docs: agent reputation on Solana** — A new guide explains how an agent earns a trust record on Solana, where there's no single on-chain reputation registry like the EVM side has. It covers the two systems three.ws uses together: attestation reputation — anyone can leave a permanent, on-chain vouch for an agent with a tiny signed memo (optionally backed by SOL stake), which the Agent Passport renders as an at-a-glance A–D trust grade weighted toward the most trustworthy reviews; and AgenC, a Solana program where agents earn reputation by completing real paid work, with stake that gets slashed for misbehavior. It also explains the identity bridge that lets one agent hold both a Solana and an Ethereum (ERC-8004) identity. A companion tutorial walks through reading a Solana agent's grade from the Passport and the API, then leaving your own on-chain vouch. New glossary entries: AgenC, trust grade, and memo attestation. (`/docs/solana-reputation`) `[docs]`
- **New docs: how agent reputation works, and how to read it** — A new guide explains agent reputation end to end — why an autonomous agent needs a verifiable, on-chain track record before it trusts (or pays) another agent, how the three ERC-8004 registries (identity, reputation, validation) fit together, and how reputation and x402 payments interlock. It comes with a hands-on tutorial that reads any registered agent's score five ways — from the Reputation Explorer, one REST call, the paid MCP tool, the SDK, or straight off the contract — including a copy-paste trust gate that refuses to transact below a bar. The existing Reputation System and Validation Attestation references are now reachable from the docs sidebar, and the glossary gained plain-language entries for reputation registry, identity registry, attestation, vouch, stake, and Sybil attack. (`/docs/agent-reputation`) `[docs]`
- **Safer, clearer credit deposits** — Three improvements to depositing SOL or $THREE for credits. (1) Clearer copy: the manual 'verify by signature' option now spells out that we check on-chain that the transaction was signed by a wallet linked to your account — so only you can claim your deposit and pasting someone else's signature can never credit your balance. The old wording ('Sent from another wallet?') made the safe, server-verified flow look like anyone could claim any transfer; it never could. (2) Reorg-safe crediting: credits now apply only once your deposit is finalized on-chain, not just confirmed, so a rare chain reorg can never credit a deposit that later disappears. The page shows a brief 'finalizing on-chain' status and credits you automatically — no resubmitting. (3) A single transaction that sends both SOL and $THREE to the deposit wallet now credits both assets instead of just the first. (`/credits`) `[improvement, security, fix]`
- **Sharper selfie → avatar: your subject, isolated and reframed** — Selfie to Avatar now cleans up your photo before building. The moment you add a shot it checks for a clear face and warns you on the spot if it's a drawing, blurry, or too far away — so you can swap it before waiting on a build instead of after. Then it cuts you out from the background, drops you onto a neutral studio backdrop, and reframes to a centred head-and-shoulders crop. That's the composition the 3D engine reconstructs best, so results come back as a real, rounded avatar instead of the flat 'photo on a card' that busy backgrounds and tight face crops used to produce. It all runs in your browser — your raw photo isn't uploaded as-is. (`/create/selfie`) `[improvement]`
diff --git a/api/_lib/a2a/reputation-gate.js b/api/_lib/a2a/reputation-gate.js
index f894572f5..cc2ff1e72 100644
--- a/api/_lib/a2a/reputation-gate.js
+++ b/api/_lib/a2a/reputation-gate.js
@@ -17,7 +17,11 @@
// (`read` option) so tests run without RPC. The gate is a no-op when no
// threshold is set; when a threshold IS set and the read fails, it fails closed.
-import { readAgentReputation } from '../trust/agent-bouncer.js';
+import { Contract } from 'ethers';
+
+import { env } from '../env.js';
+import { evmFallbackProvider } from '../evm/rpc.js';
+import { REGISTRY_DEPLOYMENTS, REPUTATION_REGISTRY_ABI } from '../../../src/erc8004/abi.js';
export class ReputationError extends Error {
constructor(code, message, status = 403) {
@@ -29,11 +33,11 @@ export class ReputationError extends Error {
}
/**
- * Read aggregated ERC-8004 reputation for an agent. Delegates to the shared
- * bouncer read, which decodes getReputation's (int256 avgX100, uint256 count)
- * correctly — average = avgX100 / 100, sign-preserving. (The earlier local read
- * here divided the already-averaged value by count again, understating every
- * score by a factor of count and mis-decoding negatives as huge positives.)
+ * Read aggregated ERC-8004 reputation for an agent. getReputation returns
+ * (int256 avgX100, uint256 count): the average ALREADY multiplied by 100, signed
+ * so reputation can be negative. average = avgX100 / 100 — never divided by count
+ * again (the prior bug here divided the already-averaged value, understating
+ * every score by a factor of count and mis-decoding negatives as huge positives).
*
* @param {object} opts
* @param {number|bigint|string} opts.agentId
@@ -42,8 +46,21 @@ export class ReputationError extends Error {
* @returns {Promise<{ average: number, count: number }>}
*/
export async function readReputationOnchain({ agentId, chainId, rpcUrl }) {
- const rep = await readAgentReputation({ agentId, chainId, rpcUrl });
- return { average: rep.average, count: rep.count };
+ const deployment = REGISTRY_DEPLOYMENTS[chainId];
+ if (!deployment?.reputationRegistry) {
+ throw new ReputationError(
+ 'reputation_registry_missing',
+ `no Reputation Registry deployed on chain ${chainId}`,
+ 500,
+ );
+ }
+ const provider = await evmFallbackProvider(chainId, {
+ primaryUrl: rpcUrl || env.A2A_REPUTATION_RPC_URL || null,
+ });
+ const contract = new Contract(deployment.reputationRegistry, REPUTATION_REGISTRY_ABI, provider);
+ const [avgX100, count] = await contract.getReputation(agentId);
+ const n = Number(count);
+ return { average: n === 0 ? 0 : Number(avgX100) / 100, count: n };
}
/**
diff --git a/api/_lib/trust/agent-bouncer.js b/api/_lib/trust/agent-bouncer.js
deleted file mode 100644
index cd4088cd1..000000000
--- a/api/_lib/trust/agent-bouncer.js
+++ /dev/null
@@ -1,265 +0,0 @@
-// Agent Bouncer — the Pole Club's door bouncer, generalized to the open agent
-// internet.
-//
-// The Club bouncer (api/_lib/club/cover-pass.js) answers "do I let this wallet
-// in?" by reading a Postgres table only three.ws can see: club_bans for
-// exclusion, club_tips for a door tier (newcomer / regular / vip). That trust
-// is real but local — a VIP at our door is a stranger at every other venue on
-// the internet.
-//
-// This module answers the SAME question from the open, portable, on-chain
-// signal instead: ERC-8004's Reputation Registry. The "ban list" is the chain's
-// own negative scores; the "tier" is earned across every platform that reads
-// and writes the same registries at the same address on 12 chains. A verdict
-// here travels with the agent everywhere.
-//
-// Club (local) Agent Bouncer (open)
-// ───────────────────────────── ─────────────────────────────────────────
-// identity paying wallet ERC-8004 agent NFT (Identity Registry)
-// history club_tips count append-only feedback count
-// tier newcomer/regular/vip newcomer/regular/trusted/vip (avg+count+stake)
-// exclusion club_bans negative on-chain average (+ optional denylist)
-//
-// The on-chain read is injectable (`read` option) so callers can swap an
-// indexer and tests run without RPC. `vetAgent` never throws on a low score —
-// it returns `admitted:false` with reasons (like the Club turning a wallet away
-// after the cover already settled). It throws only on bad input or infra error.
-
-import { Contract } from 'ethers';
-
-import { env } from '../env.js';
-import { evmFallbackProvider } from '../evm/rpc.js';
-import { CHAIN_BY_ID } from '../erc8004-chains.js';
-import {
- REGISTRY_DEPLOYMENTS,
- REPUTATION_REGISTRY_ABI,
- IDENTITY_REGISTRY_ABI,
- agentRegistryId,
-} from '../../../src/erc8004/abi.js';
-
-export const DEFAULT_CHAIN_ID = 8453; // Base
-
-// Tier thresholds. Deliberately scale-agnostic on the score itself (ERC-8004
-// scores are int8 in [-100,100], but star UIs submit 1-5) — tiers key off the
-// SIGN of the average, the review COUNT, and whether anyone has put ETH stake
-// (skin in the game) behind a vouch. Admission thresholds that DO compare the
-// average against a number are caller-supplied policy, never baked in here.
-export const TRUSTED_MIN_COUNT = 5;
-export const VIP_MIN_COUNT = 10;
-
-/**
- * Door tier from open-network reputation. Mirrors club/cover-pass.tierFor but
- * reads the chain instead of club_tips. Never returns 'banned' — exclusion is
- * decided by vetAgent (denylist / negative average) which overrides the tier.
- *
- * @param {{ average: number, count: number, totalStakeWei?: string|bigint }} rep
- * @returns {'newcomer'|'regular'|'trusted'|'vip'}
- */
-export function tierForReputation({ average, count, totalStakeWei = '0' }) {
- const n = Number(count) || 0;
- if (n <= 0) return 'newcomer'; // cold start — no history yet
- let stake = 0n;
- try {
- stake = BigInt(totalStakeWei || '0');
- } catch {
- stake = 0n;
- }
- if (average < 0) return 'regular'; // has history but net-negative; banNegative handles exclusion
- if (n >= VIP_MIN_COUNT && stake > 0n) return 'vip';
- if (n >= TRUSTED_MIN_COUNT) return 'trusted';
- return 'regular';
-}
-
-function normalizeKey(v) {
- return String(v || '').trim().toLowerCase();
-}
-
-/**
- * Read aggregated ERC-8004 reputation for an agent directly from the canonical
- * Reputation Registry. Resolves an agentId from a wallet via the Identity
- * Registry when only a wallet is given. A wallet with no registered agent is
- * NOT an error — it's a newcomer (registered:false, zeroed aggregate).
- *
- * getReputation returns (int256 avgX100, uint256 count): the average ALREADY
- * multiplied by 100. We divide by 100 — never by count (that is the bug this
- * module exists to avoid) — and Number() preserves the sign so a net-negative
- * agent reads as negative, not as a huge unsigned value.
- *
- * @param {object} opts
- * @param {number|bigint|string} [opts.agentId]
- * @param {string} [opts.wallet]
- * @param {number} [opts.chainId=8453]
- * @param {string} [opts.rpcUrl] Pinned first; otherwise env + curated public failover.
- * @returns {Promise<{agentId:string|null, wallet:string|null, average:number, count:number, totalStakeWei:string, registered:boolean}>}
- */
-export async function readAgentReputation({ agentId, wallet, chainId = DEFAULT_CHAIN_ID, rpcUrl }) {
- const deployment = REGISTRY_DEPLOYMENTS[chainId];
- if (!deployment?.reputationRegistry) {
- throw new Error(`no ERC-8004 Reputation Registry deployed on chain ${chainId}`);
- }
- const provider = await evmFallbackProvider(chainId, {
- primaryUrl: rpcUrl || env.A2A_REPUTATION_RPC_URL || null,
- });
-
- let resolvedAgentId =
- agentId !== undefined && agentId !== null && String(agentId) !== '' ? BigInt(agentId) : null;
- const resolvedWallet = wallet ? String(wallet) : null;
-
- if (resolvedAgentId === null) {
- if (!resolvedWallet) throw new Error('agentId or wallet is required');
- const identity = new Contract(deployment.identityRegistry, IDENTITY_REGISTRY_ABI, provider);
- const bal = await identity.balanceOf(resolvedWallet);
- if (bal === 0n) {
- // No ERC-8004 identity for this wallet anywhere on this chain. Honest
- // answer: an unknown newcomer, not a failure.
- return {
- agentId: null,
- wallet: resolvedWallet,
- average: 0,
- count: 0,
- totalStakeWei: '0',
- registered: false,
- };
- }
- resolvedAgentId = BigInt(await identity.tokenOfOwnerByIndex(resolvedWallet, 0n));
- }
-
- const reputation = new Contract(deployment.reputationRegistry, REPUTATION_REGISTRY_ABI, provider);
- const [agg, totalStake] = await Promise.all([
- reputation.getReputation(resolvedAgentId),
- reputation.getTotalStake(resolvedAgentId),
- ]);
- const [avgX100, count] = agg;
- const n = Number(count);
-
- return {
- agentId: resolvedAgentId.toString(),
- wallet: resolvedWallet,
- average: n === 0 ? 0 : Number(avgX100) / 100,
- count: n,
- totalStakeWei: totalStake.toString(),
- registered: true,
- };
-}
-
-/**
- * Run the open-network bouncer over an agent and return an admission verdict.
- * Mirrors the Club door's contract — { admitted, banned, tier, reason } — but
- * the inputs come from 12 chains, not our private table.
- *
- * @param {object} opts
- * @param {number|bigint|string} [opts.agentId]
- * @param {string} [opts.wallet]
- * @param {number} [opts.chainId=8453]
- * @param {object} [opts.policy] Admission policy (all optional).
- * @param {number} [opts.policy.minAverage=0] Required average score (caller's scale).
- * @param {number} [opts.policy.minCount=0] Required number of on-chain reviews.
- * @param {bigint|string|number} [opts.policy.minStakeWei=0] Required total ETH stake (wei).
- * @param {boolean} [opts.policy.allowNewcomers=true] Admit agents with zero history.
- * @param {boolean} [opts.policy.banNegative=true] Refuse net-negative agents.
- * @param {Array<string>} [opts.denylist=[]] Extra wallets/agentIds to refuse outright.
- * @param {(o:object)=>Promise<object>} [opts.read] Injectable reputation reader.
- * @returns {Promise<object>} verdict
- */
-export async function vetAgent({
- agentId,
- wallet,
- chainId = DEFAULT_CHAIN_ID,
- policy = {},
- denylist = [],
- read = readAgentReputation,
-}) {
- const {
- minAverage = 0,
- minCount = 0,
- minStakeWei = 0,
- allowNewcomers = true,
- banNegative = true,
- } = policy;
-
- const rep = await read({ agentId, wallet, chainId });
- const reasons = [];
- let banned = false;
-
- const denyKeys = new Set((denylist || []).map(normalizeKey).filter(Boolean));
- if (rep.wallet && denyKeys.has(normalizeKey(rep.wallet))) {
- banned = true;
- reasons.push('wallet is on the denylist');
- }
- if (rep.agentId && denyKeys.has(normalizeKey(rep.agentId))) {
- banned = true;
- reasons.push('agentId is on the denylist');
- }
- if (banNegative && rep.average < 0) {
- banned = true;
- reasons.push(`negative on-chain reputation (average ${rep.average.toFixed(2)})`);
- }
-
- if (!allowNewcomers && rep.count === 0) {
- reasons.push('no on-chain reviews yet — newcomers not admitted by this policy');
- }
- if (minCount > 0 && rep.count < minCount) {
- reasons.push(`only ${rep.count} review(s) on-chain; ${minCount} required`);
- }
- if (minAverage > 0 && rep.average < minAverage) {
- reasons.push(`average ${rep.average.toFixed(2)} is below the required ${minAverage}`);
- }
- let stake = 0n;
- try {
- stake = BigInt(rep.totalStakeWei || '0');
- } catch {
- stake = 0n;
- }
- const minStake = BigInt(String(minStakeWei || 0));
- if (minStake > 0n && stake < minStake) {
- reasons.push(`staked ${stake} wei; ${minStake} wei required`);
- }
-
- const admitted = !banned && reasons.length === 0;
- const tier = banned ? 'banned' : tierForReputation(rep);
-
- return {
- admitted,
- banned,
- tier,
- reason: reasons[0] || null,
- reasons,
- registered: rep.registered !== false,
- agentId: rep.agentId,
- wallet: rep.wallet,
- chainId,
- registry: deploymentRegistryId(chainId),
- reputation: {
- average: rep.average,
- count: rep.count,
- totalStakeWei: rep.totalStakeWei || '0',
- totalStakeEth: weiToEth(rep.totalStakeWei),
- },
- };
-}
-
-function deploymentRegistryId(chainId) {
- const reg = REGISTRY_DEPLOYMENTS[chainId]?.reputationRegistry;
- return reg ? agentRegistryId(chainId, reg) : null;
-}
-
-function weiToEth(wei) {
- let v = 0n;
- try {
- v = BigInt(wei || '0');
- } catch {
- return 0;
- }
- // Six significant decimals is plenty for a stake display; avoids BigInt→float
- // overflow for large balances while keeping sub-milli-ETH legible.
- return Number((v * 1_000_000n) / 1_000_000_000_000_000_000n) / 1_000_000;
-}
-
-/**
- * Human/agent name for a chain id, for verdict display + error messages.
- * @param {number} chainId
- * @returns {string}
- */
-export function chainNameFor(chainId) {
- return CHAIN_BY_ID[chainId]?.name || `chain ${chainId}`;
-}
diff --git a/api/_lib/trust/solana-bouncer.js b/api/_lib/trust/solana-bouncer.js
new file mode 100644
index 000000000..1db168c45
--- /dev/null
+++ b/api/_lib/trust/solana-bouncer.js
@@ -0,0 +1,304 @@
+// Agent Bouncer (Solana) — the Pole Club's door bouncer, generalized to the
+// whole platform's Solana reputation.
+//
+// The Club bouncer (api/_lib/club/cover-pass.js) admits a wallet from its club
+// history alone: club_tips for a tier, club_bans for exclusion. That trust is
+// real but narrow — it only knows what happened at our door.
+//
+// This module answers the SAME question — "should I engage this agent?" — from
+// every Solana signal three.ws indexes about it:
+// • pump_agent_payments — confirmed on-chain payments accepted, distinct
+// payers, failure rate (did people actually pay it,
+// and did those payments succeed?)
+// • pump_distribute_runs — did it honor its distribute/buyback obligations?
+// • pump_buyback_runs
+// • solana_attestations — signed Solana memo attestations about it
+// (threews.feedback / threews.validation)
+// • club_bans / club_tips — the Club's own denylist + door history, folded in
+//
+// It is behavioral reputation, not a star rating: every input is a real,
+// already-settled Solana action, not a claim. `vetSolanaAgent` never throws on a
+// weak record — it returns admitted:false with reasons (like the Club turning a
+// wallet away). The reads are injectable so the verdict logic is unit-testable
+// without a database.
+
+import { sql } from '../db.js';
+import { findBan, visitsFor, normalizeWallet } from '../club/cover-pass.js';
+
+// Tier thresholds, keyed off real activity volume + integrity, not a score.
+export const TRUSTED_MIN_PAYMENTS = 10;
+export const TRUSTED_MIN_PAYERS = 3;
+export const TRUSTED_MAX_FAILURE_RATE = 0.2;
+export const VIP_MIN_PAYMENTS = 50;
+export const VIP_MIN_PAYERS = 10;
+
+/**
+ * Load the Solana reputation snapshot for a three.ws agent, synthesized from the
+ * on-chain payment / distribution / buyback index and signed Solana memo
+ * attestations three.ws maintains. Shared by /api/x402/agent-reputation (which
+ * returns the raw snapshot) and the bouncer below (which returns a verdict).
+ *
+ * @param {string} agentId three.ws agent_id (UUID)
+ * @returns {Promise<object>} reputation snapshot
+ */
+export async function loadAgentReputation(agentId) {
+ // Resolve the agent's Metaplex Core asset pubkey (the column attestations are
+ // indexed by). Canonical write path is meta.onchain.sol_asset; legacy rows
+ // wrote meta.sol_mint_address.
+ const [agentRow] = await sql`
+ select
+ id,
+ name,
+ wallet_address,
+ coalesce(meta->'onchain'->>'sol_asset', meta->>'sol_mint_address') as agent_asset
+ from agent_identities
+ where id = ${agentId} and deleted_at is null
+ limit 1
+ `;
+ if (!agentRow) {
+ const err = new Error('agent_id not found');
+ err.status = 404;
+ err.code = 'agent_not_found';
+ throw err;
+ }
+
+ const mints = await sql`
+ select id, mint, network, symbol
+ from pump_agent_mints
+ where agent_id = ${agentId}
+ order by created_at asc
+ `;
+ const mintIds = mints.map((m) => m.id);
+
+ if (mintIds.length === 0) {
+ return {
+ agent_id: agentId,
+ name: agentRow.name,
+ wallet_address: agentRow.wallet_address || null,
+ deployed_mints: 0,
+ mints: [],
+ payments: {
+ confirmed_count: 0,
+ confirmed_amount_atomics: '0',
+ distinct_payers: 0,
+ failed_count: 0,
+ failure_rate: 0,
+ },
+ distributions: { confirmed: 0, failed: 0, success_rate: 0 },
+ buybacks: { confirmed: 0, failed: 0, total_burn_atomics: '0' },
+ attestations: { feedback_count: 0, validation_count: 0, latest_attested_at: null },
+ indexed_at: new Date().toISOString(),
+ };
+ }
+
+ const [payRow] = await sql`
+ select
+ coalesce(sum(case when status = 'confirmed' then amount_atomics else 0 end), 0)::text
+ as confirmed_amount,
+ count(*) filter (where status = 'confirmed')::int as confirmed_count,
+ count(*) filter (where status = 'failed')::int as failed_count,
+ count(distinct case when status = 'confirmed' then payer_wallet end)::int
+ as distinct_payers
+ from pump_agent_payments
+ where mint_id = any(${mintIds})
+ `;
+
+ const [distRow] = await sql`
+ select
+ count(*) filter (where status = 'confirmed')::int as confirmed,
+ count(*) filter (where status = 'failed')::int as failed
+ from pump_distribute_runs
+ where mint_id = any(${mintIds})
+ `;
+
+ const [buyRow] = await sql`
+ select
+ count(*) filter (where status = 'confirmed')::int as confirmed,
+ count(*) filter (where status = 'failed')::int as failed,
+ coalesce(sum(case when status = 'confirmed' then burn_amount else 0 end), 0)::text
+ as total_burn
+ from pump_buyback_runs
+ where mint_id = any(${mintIds})
+ `;
+
+ const [attRow] = agentRow.agent_asset
+ ? await sql`
+ select
+ count(*) filter (where kind like 'threews.feedback%')::int as feedback_count,
+ count(*) filter (where kind like 'threews.validation%')::int as validation_count,
+ max(block_time) as latest_attested_at
+ from solana_attestations
+ where agent_asset = ${agentRow.agent_asset}
+ and revoked = false
+ `
+ : [{ feedback_count: 0, validation_count: 0, latest_attested_at: null }];
+
+ const totalPayments = payRow.confirmed_count + payRow.failed_count;
+ const totalDistribs = distRow.confirmed + distRow.failed;
+
+ return {
+ agent_id: agentId,
+ name: agentRow.name,
+ wallet_address: agentRow.wallet_address || null,
+ deployed_mints: mints.length,
+ mints: mints.map((m) => ({ mint: m.mint, network: m.network, symbol: m.symbol })),
+ payments: {
+ confirmed_count: payRow.confirmed_count,
+ confirmed_amount_atomics: payRow.confirmed_amount,
+ distinct_payers: payRow.distinct_payers,
+ failed_count: payRow.failed_count,
+ failure_rate: totalPayments ? payRow.failed_count / totalPayments : 0,
+ },
+ distributions: {
+ confirmed: distRow.confirmed,
+ failed: distRow.failed,
+ success_rate: totalDistribs ? distRow.confirmed / totalDistribs : 0,
+ },
+ buybacks: {
+ confirmed: buyRow.confirmed,
+ failed: buyRow.failed,
+ total_burn_atomics: buyRow.total_burn,
+ },
+ attestations: {
+ feedback_count: attRow.feedback_count,
+ validation_count: attRow.validation_count,
+ latest_attested_at: attRow.latest_attested_at
+ ? new Date(attRow.latest_attested_at).toISOString()
+ : null,
+ },
+ indexed_at: new Date().toISOString(),
+ };
+}
+
+function attestationTotal(rep) {
+ const a = rep.attestations || {};
+ return (a.feedback_count || 0) + (a.validation_count || 0);
+}
+
+/**
+ * Door tier from Solana behavioral reputation. Mirrors club/cover-pass.tierFor
+ * but reads the whole platform's record instead of club_tips alone. Never
+ * returns 'banned' — exclusion is decided by vetSolanaAgent (club_bans).
+ *
+ * @param {object} rep snapshot from loadAgentReputation
+ * @param {number} visits prior settled club tips by this agent's wallet
+ * @returns {'newcomer'|'regular'|'trusted'|'vip'}
+ */
+export function tierForSolanaReputation(rep, visits = 0) {
+ const p = rep.payments || {};
+ const b = rep.buybacks || {};
+ const att = attestationTotal(rep);
+ const known = (p.confirmed_count || 0) + att + (visits || 0) + (rep.deployed_mints || 0);
+ if (known === 0) return 'newcomer'; // no history anywhere yet — cold start
+
+ if (
+ (p.confirmed_count || 0) >= VIP_MIN_PAYMENTS &&
+ (p.distinct_payers || 0) >= VIP_MIN_PAYERS &&
+ ((rep.attestations?.validation_count || 0) > 0 || (b.confirmed || 0) > 0)
+ ) {
+ return 'vip';
+ }
+ if (
+ (p.confirmed_count || 0) >= TRUSTED_MIN_PAYMENTS &&
+ (p.distinct_payers || 0) >= TRUSTED_MIN_PAYERS &&
+ (p.failure_rate || 0) <= TRUSTED_MAX_FAILURE_RATE
+ ) {
+ return 'trusted';
+ }
+ return 'regular';
+}
+
+/**
+ * Run the Solana door bouncer over a three.ws agent and return an admission
+ * verdict. Mirrors the Club door's contract — { admitted, banned, tier, reason }
+ * — but the inputs are the agent's whole Solana track record, not just our door.
+ *
+ * @param {object} opts
+ * @param {string} opts.agentId three.ws agent_id (UUID)
+ * @param {object} [opts.policy] Admission policy (all optional).
+ * @param {number} [opts.policy.minPayments=0] Required confirmed payments.
+ * @param {number} [opts.policy.minDistinctPayers=0] Required distinct payers.
+ * @param {number} [opts.policy.maxFailureRate=1] Max tolerated payment failure rate (0..1).
+ * @param {number} [opts.policy.minAttestations=0] Required signed Solana attestations.
+ * @param {boolean} [opts.policy.allowNewcomers=true] Admit agents with no history.
+ * @param {(id:string)=>Promise<object>} [opts.read] Injectable reputation reader.
+ * @param {(w:string)=>Promise<object|null>} [opts.banCheck] Injectable club-ban lookup.
+ * @param {(w:string)=>Promise<number>} [opts.visitsCheck] Injectable club-visit count.
+ * @returns {Promise<object>} verdict
+ */
+export async function vetSolanaAgent({
+ agentId,
+ policy = {},
+ read = loadAgentReputation,
+ banCheck = findBan,
+ visitsCheck = visitsFor,
+}) {
+ const {
+ minPayments = 0,
+ minDistinctPayers = 0,
+ maxFailureRate = 1,
+ minAttestations = 0,
+ allowNewcomers = true,
+ } = policy;
+
+ const rep = await read(agentId);
+ const wallet = rep.wallet_address ? normalizeWallet(rep.wallet_address) : '';
+ const [ban, visits] = await Promise.all([
+ wallet ? banCheck(wallet) : Promise.resolve(null),
+ wallet ? visitsCheck(wallet) : Promise.resolve(0),
+ ]);
+
+ const p = rep.payments || {};
+ const att = attestationTotal(rep);
+ const totalActivity = (p.confirmed_count || 0) + att + (visits || 0) + (rep.deployed_mints || 0);
+ const isNewcomer = totalActivity === 0;
+
+ const reasons = [];
+ let banned = false;
+ if (ban) {
+ banned = true;
+ reasons.push(ban.reason || 'wallet is on the club ban list');
+ }
+
+ if (!allowNewcomers && isNewcomer) {
+ reasons.push('no Solana track record yet — newcomers not admitted by this policy');
+ }
+ if (minPayments > 0 && (p.confirmed_count || 0) < minPayments) {
+ reasons.push(`only ${p.confirmed_count || 0} confirmed payment(s); ${minPayments} required`);
+ }
+ if (minDistinctPayers > 0 && (p.distinct_payers || 0) < minDistinctPayers) {
+ reasons.push(`only ${p.distinct_payers || 0} distinct payer(s); ${minDistinctPayers} required`);
+ }
+ const settledPayments = (p.confirmed_count || 0) + (p.failed_count || 0);
+ if (maxFailureRate < 1 && settledPayments > 0 && (p.failure_rate || 0) > maxFailureRate) {
+ reasons.push(
+ `payment failure rate ${(p.failure_rate * 100).toFixed(1)}% exceeds the ${(maxFailureRate * 100).toFixed(0)}% limit`,
+ );
+ }
+ if (minAttestations > 0 && att < minAttestations) {
+ reasons.push(`only ${att} signed attestation(s); ${minAttestations} required`);
+ }
+
+ const admitted = !banned && reasons.length === 0;
+ const tier = banned ? 'banned' : tierForSolanaReputation(rep, visits);
+
+ return {
+ admitted,
+ banned,
+ tier,
+ reason: reasons[0] || null,
+ reasons,
+ newcomer: isNewcomer,
+ agent_id: rep.agent_id,
+ name: rep.name,
+ wallet_address: rep.wallet_address || null,
+ visits,
+ reputation: {
+ deployed_mints: rep.deployed_mints,
+ payments: rep.payments,
+ distributions: rep.distributions,
+ buybacks: rep.buybacks,
+ attestations: rep.attestations,
+ },
+ };
+}
diff --git a/api/wk.js b/api/wk.js
index 2fb98f9c7..d775494da 100644
--- a/api/wk.js
+++ b/api/wk.js
@@ -622,7 +622,7 @@ async function handleX402Discovery(req, res) {
}),
agentBouncer: withService({
serviceName: 'three.ws Agent Bouncer',
- tags: ['reputation', 'erc8004', 'trust', 'gate', 'agent'],
+ tags: ['reputation', 'trust', 'gate', 'agent', 'solana'],
}),
onchainIdentity: withService({
serviceName: 'three.ws Identity Verify',
@@ -936,7 +936,7 @@ async function handleX402Discovery(req, res) {
url,
method: 'GET',
description:
- 'Agent Bouncer — the Pole Club door check, opened to the open agent internet. Given an ERC-8004 agent (agentId, EVM wallet, or eip155:<chain>:<wallet>) and an optional trust policy, read the canonical on-chain Reputation Registry and return an admit/refuse verdict with a door tier (newcomer / regular / trusted / vip). The denylist is the chain’s own negative scores — no private table. Vet a counterparty before paying, hiring, or delegating.',
+ 'Agent Bouncer — the Pole Club door check, opened to the whole platform’s Solana reputation. Given a three.ws agent_id and an optional trust policy, read the agent’s Solana track record (confirmed on-chain payments, distinct payers, payment failure rate, distribute/buyback follow-through, signed Solana attestations, Club ban/tip ledger) and return an admit/refuse verdict with a door tier (newcomer / regular / trusted / vip). Vet a counterparty before paying, hiring, or delegating.',
mimeType: 'application/json',
serviceName: routeMeta.agentBouncer.serviceName,
tags: routeMeta.agentBouncer.tags,
@@ -945,16 +945,21 @@ async function handleX402Discovery(req, res) {
extensions: extensionsForAccepts(accepts, {
method: 'GET',
discoverable: true,
- input: { agent: '1', chain: 'base', min_average: 4, min_count: 3 },
+ input: {
+ agent_id: '7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55',
+ min_payments: 10,
+ min_distinct_payers: 3,
+ max_failure_rate: 0.2,
+ },
inputSchema: {
type: 'object',
- required: ['agent'],
+ required: ['agent_id'],
properties: {
- agent: { type: 'string' },
- chain: { type: 'string' },
- min_average: { type: 'number' },
- min_count: { type: 'integer' },
- min_stake_eth: { type: 'number' },
+ agent_id: { type: 'string', format: 'uuid' },
+ min_payments: { type: 'integer' },
+ min_distinct_payers: { type: 'integer' },
+ max_failure_rate: { type: 'number' },
+ min_attestations: { type: 'integer' },
allow_newcomers: { type: 'boolean' },
},
},
diff --git a/api/x402/agent-bouncer.js b/api/x402/agent-bouncer.js
index 41f00eaa0..be02e93b4 100644
--- a/api/x402/agent-bouncer.js
+++ b/api/x402/agent-bouncer.js
@@ -1,79 +1,83 @@
-// GET /api/x402/agent-bouncer?agent=<id|wallet|caip10>&chain=base&min_average=&min_count=
+// GET /api/x402/agent-bouncer?agent_id=<uuid>&min_payments=&min_distinct_payers=&max_failure_rate=
//
-// The Pole Club's door bouncer, opened up to the whole agent internet.
+// The Pole Club's door bouncer, opened up to the whole platform's Solana
+// reputation.
//
-// The Club's bouncer (/api/x402/club-cover) decides admission from a Postgres
-// table only three.ws can see — so a VIP at our door is a stranger everywhere
-// else. This endpoint answers the SAME question — "should I engage this agent?"
-// — from the open, portable signal instead: ERC-8004 on-chain reputation,
-// readable at one address on 12 chains. The denylist is the chain's own
-// negative scores; the door tier (newcomer/regular/trusted/vip) is earned
-// across every platform that writes the same registries. A verdict here is
-// useful to an agent that has never heard of three.ws.
+// The Club's door (/api/x402/club-cover) decides admission from a wallet's club
+// history alone — so it only knows what happened at our venue. This endpoint
+// answers the SAME question — "should I engage this agent?" — from every Solana
+// signal three.ws indexes about a three.ws agent: confirmed on-chain payments
+// and distinct payers (pump_agent_payments), distribute/buyback follow-through,
+// signed Solana memo attestations (solana_attestations), and the Club's own
+// ban/tip ledger. It returns an admit/refuse verdict with a door tier
+// (newcomer / regular / trusted / vip).
//
-// This is the DECISION, not the data: /api/x402/agent-reputation and the
-// agent_reputation MCP tool return the raw reputation; this returns an
-// admit/refuse verdict + tier against a caller-supplied policy. "x402 handles
-// how agents pay; ERC-8004 handles whether they should" — this is the second
-// half, as a service any agent can call before paying a counterparty.
+// This is the DECISION, not the data: /api/x402/agent-reputation returns the raw
+// snapshot; this returns a policy verdict over it. "x402 handles how agents pay;
+// reputation handles whether they should" — this is the second half, as a
+// service any agent can call before paying, hiring, or delegating to a peer.
import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
import { buildBazaarSchema } from '../_lib/x402-spec.js';
import { installAccessControl } from '../_lib/x402/access-control.js';
import { withService } from '../_lib/x402/bazaar-helpers.js';
import { priceFor } from '../_lib/x402-prices.js';
-import { isAddress } from 'ethers';
-import { vetAgent, chainNameFor, DEFAULT_CHAIN_ID } from '../_lib/trust/agent-bouncer.js';
+import { isUuid } from '../_lib/validate.js';
+import { vetSolanaAgent } from '../_lib/trust/solana-bouncer.js';
const ROUTE = '/api/x402/agent-bouncer';
const DESCRIPTION =
- 'three.ws Agent Bouncer — the open-network door check. Given an ERC-8004 ' +
- 'agent (agentId, EVM wallet, or eip155:<chain>:<wallet> CAIP-10) and an ' +
- 'optional trust policy, read the canonical on-chain Reputation Registry and ' +
- 'return an admit/refuse verdict with a door tier (newcomer / regular / ' +
- 'trusted / vip). The denylist is the chain’s own negative scores — no ' +
- 'private table. Use it to vet a counterparty before paying, hiring, or ' +
- 'delegating to it. Pay-per-call in USDC on Base or Solana mainnet.';
-
-// Friendly chain names → chainId. Mirrors the agent_reputation MCP tool so an
-// agent can pass the same `chain` either place. CAIP-10 input overrides this.
-const CHAIN_IDS = {
- base: 8453,
- ethereum: 1,
- arbitrum: 42161,
- optimism: 10,
- polygon: 137,
- bsc: 56,
- avalanche: 43114,
- celo: 42220,
- linea: 59144,
- scroll: 534352,
+ 'three.ws Agent Bouncer — the platform door check. Given a three.ws agent_id ' +
+ 'and an optional trust policy, read the agent’s whole Solana track record ' +
+ '(confirmed on-chain payments, distinct payers, payment failure rate, ' +
+ 'distribute/buyback follow-through, signed Solana attestations, and the Club ' +
+ 'ban/tip ledger) and return an admit/refuse verdict with a door tier ' +
+ '(newcomer / regular / trusted / vip). Behavioral reputation from real ' +
+ 'settled Solana actions — not a star rating. Use it to vet a counterparty ' +
+ 'before paying, hiring, or delegating. Pay-per-call in USDC on Solana or Base.';
+
+const INPUT_EXAMPLE = {
+ agent_id: '7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55',
+ min_payments: 10,
+ min_distinct_payers: 3,
+ max_failure_rate: 0.2,
};
-const INPUT_EXAMPLE = { agent: '1', chain: 'base', min_average: 4, min_count: 3 };
-
const INPUT_SCHEMA = {
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: 'object',
- required: ['agent'],
+ required: ['agent_id'],
properties: {
- agent: {
+ agent_id: {
type: 'string',
- description:
- 'ERC-8004 agentId (uint), EVM wallet (0x…), or CAIP-10 "eip155:<chainId>:<wallet>".',
+ format: 'uuid',
+ description: 'three.ws agent_id (UUID). Returned by /api/agents and /api/agent-page.',
},
- chain: {
- type: 'string',
- description:
- 'Chain to read (default base). Name (base, ethereum, arbitrum, optimism, polygon, bsc, avalanche, celo, linea, scroll) or numeric chainId. Overridden by a CAIP-10 agent value.',
+ min_payments: {
+ type: 'integer',
+ minimum: 0,
+ description: 'Required confirmed on-chain payments to admit (default 0).',
+ },
+ min_distinct_payers: {
+ type: 'integer',
+ minimum: 0,
+ description: 'Required distinct paying wallets (default 0).',
+ },
+ max_failure_rate: {
+ type: 'number',
+ minimum: 0,
+ maximum: 1,
+ description: 'Maximum tolerated payment failure rate, 0–1 (default 1 = no cap).',
+ },
+ min_attestations: {
+ type: 'integer',
+ minimum: 0,
+ description: 'Required signed Solana attestations (feedback + validation; default 0).',
},
- min_average: { type: 'number', description: 'Required average score to admit (default 0 = no minimum).' },
- min_count: { type: 'integer', minimum: 0, description: 'Required number of on-chain reviews (default 0).' },
- min_stake_eth: { type: 'number', minimum: 0, description: 'Required total ETH staked on vouches (default 0).' },
allow_newcomers: {
type: 'boolean',
- description: 'Admit agents with zero on-chain history (default true).',
+ description: 'Admit agents with no Solana track record (default true).',
},
},
};
@@ -84,47 +88,55 @@ const OUTPUT_EXAMPLE = {
banned: false,
tier: 'trusted',
reason: null,
- registered: true,
- agentId: '1',
- wallet: null,
- chain: 'Base',
- chainId: 8453,
- registry: 'eip155:8453:0x8004BAa17C55a88189AE136b182e5fdA19dE9b63',
- reputation: { average: 4.6, count: 7, totalStakeWei: '2000000000000000', totalStakeEth: 0.002 },
- policy: { minAverage: 4, minCount: 3, minStakeWei: '0', allowNewcomers: true, banNegative: true },
+ newcomer: false,
+ agent_id: '7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55',
+ name: 'Helios',
+ wallet_address: 'wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU',
+ visits: 4,
+ reputation: {
+ deployed_mints: 2,
+ payments: {
+ confirmed_count: 142,
+ confirmed_amount_atomics: '142000000',
+ distinct_payers: 87,
+ failed_count: 3,
+ failure_rate: 0.021,
+ },
+ distributions: { confirmed: 12, failed: 1, success_rate: 0.923 },
+ buybacks: { confirmed: 5, failed: 0, total_burn_atomics: '500000000' },
+ attestations: { feedback_count: 14, validation_count: 8, latest_attested_at: '2026-05-12T08:21:00Z' },
+ },
+ policy: {
+ minPayments: 10,
+ minDistinctPayers: 3,
+ maxFailureRate: 0.2,
+ minAttestations: 0,
+ allowNewcomers: true,
+ },
fetchedAt: '2026-06-22T17:00:00.000Z',
};
const OUTPUT_SCHEMA = {
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: 'object',
- required: ['ok', 'admitted', 'banned', 'tier', 'reputation', 'chainId'],
+ required: ['ok', 'admitted', 'banned', 'tier', 'agent_id', 'reputation'],
properties: {
ok: { type: 'boolean', const: true },
admitted: { type: 'boolean', description: 'true when the agent clears the policy and is not banned.' },
- banned: { type: 'boolean', description: 'true when on a denylist or net-negative on-chain.' },
+ banned: { type: 'boolean', description: 'true when the agent’s wallet is on the Club ban list.' },
tier: {
type: 'string',
enum: ['newcomer', 'regular', 'trusted', 'vip', 'banned'],
- description: 'Door tier earned from open-network reputation.',
+ description: 'Door tier earned from the agent’s Solana track record.',
},
reason: { type: ['string', 'null'], description: 'Primary reason when refused; null when admitted.' },
reasons: { type: 'array', items: { type: 'string' } },
- registered: { type: 'boolean', description: 'false when the wallet has no ERC-8004 identity (a newcomer).' },
- agentId: { type: ['string', 'null'] },
- wallet: { type: ['string', 'null'] },
- chain: { type: 'string' },
- chainId: { type: 'integer' },
- registry: { type: ['string', 'null'], description: 'CAIP-10 id of the Reputation Registry read.' },
- reputation: {
- type: 'object',
- properties: {
- average: { type: 'number' },
- count: { type: 'integer', minimum: 0 },
- totalStakeWei: { type: 'string' },
- totalStakeEth: { type: 'number' },
- },
- },
+ newcomer: { type: 'boolean', description: 'true when the agent has no Solana history yet.' },
+ agent_id: { type: 'string', format: 'uuid' },
+ name: { type: ['string', 'null'] },
+ wallet_address: { type: ['string', 'null'] },
+ visits: { type: 'integer', minimum: 0, description: 'Prior settled club tips by this agent’s wallet.' },
+ reputation: { type: 'object' },
policy: { type: 'object' },
fetchedAt: { type: 'string', format: 'date-time' },
},
@@ -152,39 +164,19 @@ function badRequest(message, code) {
return err;
}
-function resolveChainId(input) {
- if (input === undefined || input === null || input === '') return DEFAULT_CHAIN_ID;
- const key = String(input).trim().toLowerCase();
- if (CHAIN_IDS[key]) return CHAIN_IDS[key];
- const id = Number(key);
- if (Number.isInteger(id) && id > 0) return id;
- throw badRequest(`unsupported chain "${input}"`, 'invalid_chain');
-}
-
-// Parse the `agent` param into { agentId|wallet, chainId }. A CAIP-10 value
-// carries its own chain and overrides the `chain` param.
-function parseAgent(raw, defaultChainId) {
- const value = String(raw || '').trim();
- if (!value) throw badRequest('query param "agent" is required', 'missing_agent');
- if (/^\d+$/.test(value)) return { agentId: value, chainId: defaultChainId };
- if (value.toLowerCase().startsWith('eip155:')) {
- const parts = value.split(':');
- if (parts.length !== 3) throw badRequest(`invalid CAIP-10 id "${value}"`, 'invalid_caip10');
- const chainId = resolveChainId(parts[1]);
- if (!isAddress(parts[2])) throw badRequest(`invalid wallet in "${value}"`, 'invalid_wallet');
- return { wallet: parts[2], chainId };
+function parseRate(raw, field) {
+ if (raw === undefined || raw === null || raw === '') return null;
+ const n = Number(raw);
+ if (!Number.isFinite(n) || n < 0 || n > 1) {
+ throw badRequest(`${field} must be a number between 0 and 1`, 'invalid_policy');
}
- if (isAddress(value)) return { wallet: value, chainId: defaultChainId };
- throw badRequest(
- `could not parse "${value}" — expected an agentId, 0x wallet, or eip155:<chain>:<wallet>`,
- 'invalid_agent',
- );
+ return n;
}
-function parseNonNegativeNumber(raw, field) {
+function parseCount(raw, field) {
if (raw === undefined || raw === null || raw === '') return 0;
const n = Number(raw);
- if (!Number.isFinite(n) || n < 0) throw badRequest(`${field} must be a non-negative number`, 'invalid_policy');
+ if (!Number.isInteger(n) || n < 0) throw badRequest(`${field} must be a non-negative integer`, 'invalid_policy');
return n;
}
@@ -197,7 +189,7 @@ export default paidEndpoint({
bazaar: BAZAAR,
service: withService({
serviceName: 'three.ws Agent Bouncer',
- tags: ['reputation', 'erc8004', 'trust', 'gate', 'agent'],
+ tags: ['reputation', 'trust', 'gate', 'agent', 'solana'],
}),
requiredScope: 'x402:bypass',
accessControl: installAccessControl({ requiredScope: 'x402:bypass' }),
@@ -209,34 +201,20 @@ export default paidEndpoint({
},
async handler({ req }) {
const q = req.query || {};
- const defaultChainId = resolveChainId(q.chain);
- const { agentId, wallet, chainId } = parseAgent(q.agent, defaultChainId);
-
- const minAverage = parseNonNegativeNumber(q.min_average, 'min_average');
- const minCount = Math.floor(parseNonNegativeNumber(q.min_count, 'min_count'));
- const minStakeEth = parseNonNegativeNumber(q.min_stake_eth, 'min_stake_eth');
- const minStakeWei = BigInt(Math.round(minStakeEth * 1e9)) * 1_000_000_000n; // eth → wei, 9-digit precision
- const allowNewcomers = q.allow_newcomers === undefined ? true : q.allow_newcomers !== 'false';
+ const agentId = String(q.agent_id || '').trim().toLowerCase();
+ if (!agentId) throw badRequest('query param "agent_id" is required', 'missing_agent_id');
+ if (!isUuid(agentId)) throw badRequest('agent_id must be a UUID', 'invalid_agent_id');
+ const maxFailureRate = parseRate(q.max_failure_rate, 'max_failure_rate');
const policy = {
- minAverage,
- minCount,
- minStakeWei,
- allowNewcomers,
- banNegative: true,
+ minPayments: parseCount(q.min_payments, 'min_payments'),
+ minDistinctPayers: parseCount(q.min_distinct_payers, 'min_distinct_payers'),
+ maxFailureRate: maxFailureRate === null ? 1 : maxFailureRate,
+ minAttestations: parseCount(q.min_attestations, 'min_attestations'),
+ allowNewcomers: q.allow_newcomers === undefined ? true : q.allow_newcomers !== 'false',
};
- let verdict;
- try {
- verdict = await vetAgent({ agentId, wallet, chainId, policy });
- } catch (err) {
- // An on-chain read failure must not masquerade as "refused" — surface it
- // as an upstream error so the caller knows the verdict is unknown, not no.
- const e = new Error(`reputation read failed: ${err.message}`);
- e.status = 502;
- e.code = 'reputation_unavailable';
- throw e;
- }
+ const verdict = await vetSolanaAgent({ agentId, policy });
return {
ok: true,
@@ -245,20 +223,13 @@ export default paidEndpoint({
tier: verdict.tier,
reason: verdict.reason,
reasons: verdict.reasons,
- registered: verdict.registered,
- agentId: verdict.agentId,
- wallet: verdict.wallet,
- chain: chainNameFor(chainId),
- chainId,
- registry: verdict.registry,
+ newcomer: verdict.newcomer,
+ agent_id: verdict.agent_id,
+ name: verdict.name,
+ wallet_address: verdict.wallet_address,
+ visits: verdict.visits,
reputation: verdict.reputation,
- policy: {
- minAverage,
- minCount,
- minStakeWei: minStakeWei.toString(),
- allowNewcomers,
- banNegative: true,
- },
+ policy,
fetchedAt: new Date().toISOString(),
};
},
diff --git a/api/x402/agent-reputation.js b/api/x402/agent-reputation.js
index dc4616a0f..bb7791495 100644
--- a/api/x402/agent-reputation.js
+++ b/api/x402/agent-reputation.js
@@ -16,9 +16,11 @@ import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
import { buildBazaarSchema } from '../_lib/x402-spec.js';
import { installAccessControl } from '../_lib/x402/access-control.js';
import { withService } from '../_lib/x402/bazaar-helpers.js';
-import { sql } from '../_lib/db.js';
import { priceFor } from '../_lib/x402-prices.js';
import { isUuid } from '../_lib/validate.js';
+// Shared with /api/x402/agent-bouncer so the raw reputation snapshot and the
+// admit/refuse verdict are computed from one source of truth.
+import { loadAgentReputation } from '../_lib/trust/solana-bouncer.js';
const ROUTE = '/api/x402/agent-reputation';
@@ -154,137 +156,6 @@ const BAZAAR = {
}),
};
-async function loadReputation(agentId) {
- // Resolve the agent's Metaplex Core asset pubkey (the column attestations
- // are indexed by). Canonical write path is meta.onchain.sol_asset; legacy
- // rows wrote meta.sol_mint_address. Without this, the attestation counts
- // would silently return 0 for any agent whose asset pubkey isn't equal to
- // their wallet — which is the typical case.
- const [agentRow] = await sql`
- select
- id,
- name,
- wallet_address,
- coalesce(meta->'onchain'->>'sol_asset', meta->>'sol_mint_address') as agent_asset
- from agent_identities
- where id = ${agentId} and deleted_at is null
- limit 1
- `;
- if (!agentRow) {
- const err = new Error('agent_id not found');
- err.status = 404;
- err.code = 'agent_not_found';
- throw err;
- }
-
- const mints = await sql`
- select id, mint, network, symbol
- from pump_agent_mints
- where agent_id = ${agentId}
- order by created_at asc
- `;
- const mintIds = mints.map((m) => m.id);
-
- if (mintIds.length === 0) {
- return {
- agent_id: agentId,
- name: agentRow.name,
- wallet_address: agentRow.wallet_address || null,
- deployed_mints: 0,
- mints: [],
- payments: {
- confirmed_count: 0,
- confirmed_amount_atomics: '0',
- distinct_payers: 0,
- failed_count: 0,
- failure_rate: 0,
- },
- distributions: { confirmed: 0, failed: 0, success_rate: 0 },
- buybacks: { confirmed: 0, failed: 0, total_burn_atomics: '0' },
- attestations: { feedback_count: 0, validation_count: 0, latest_attested_at: null },
- indexed_at: new Date().toISOString(),
- };
- }
-
- const [payRow] = await sql`
- select
- coalesce(sum(case when status = 'confirmed' then amount_atomics else 0 end), 0)::text
- as confirmed_amount,
- count(*) filter (where status = 'confirmed')::int as confirmed_count,
- count(*) filter (where status = 'failed')::int as failed_count,
- count(distinct case when status = 'confirmed' then payer_wallet end)::int
- as distinct_payers
- from pump_agent_payments
- where mint_id = any(${mintIds})
- `;
-
- const [distRow] = await sql`
- select
- count(*) filter (where status = 'confirmed')::int as confirmed,
- count(*) filter (where status = 'failed')::int as failed
- from pump_distribute_runs
- where mint_id = any(${mintIds})
- `;
-
- const [buyRow] = await sql`
- select
- count(*) filter (where status = 'confirmed')::int as confirmed,
- count(*) filter (where status = 'failed')::int as failed,
- coalesce(sum(case when status = 'confirmed' then burn_amount else 0 end), 0)::text
- as total_burn
- from pump_buyback_runs
- where mint_id = any(${mintIds})
- `;
-
- const [attRow] = agentRow.agent_asset
- ? await sql`
- select
- count(*) filter (where kind like 'threews.feedback%')::int as feedback_count,
- count(*) filter (where kind like 'threews.validation%')::int as validation_count,
- max(block_time) as latest_attested_at
- from solana_attestations
- where agent_asset = ${agentRow.agent_asset}
- and revoked = false
- `
- : [{ feedback_count: 0, validation_count: 0, latest_attested_at: null }];
-
- const totalPayments = payRow.confirmed_count + payRow.failed_count;
- const totalDistribs = distRow.confirmed + distRow.failed;
-
- return {
- agent_id: agentId,
- name: agentRow.name,
- wallet_address: agentRow.wallet_address || null,
- deployed_mints: mints.length,
- mints: mints.map((m) => ({ mint: m.mint, network: m.network, symbol: m.symbol })),
- payments: {
- confirmed_count: payRow.confirmed_count,
- confirmed_amount_atomics: payRow.confirmed_amount,
- distinct_payers: payRow.distinct_payers,
- failed_count: payRow.failed_count,
- failure_rate: totalPayments ? payRow.failed_count / totalPayments : 0,
- },
- distributions: {
- confirmed: distRow.confirmed,
- failed: distRow.failed,
- success_rate: totalDistribs ? distRow.confirmed / totalDistribs : 0,
- },
- buybacks: {
- confirmed: buyRow.confirmed,
- failed: buyRow.failed,
- total_burn_atomics: buyRow.total_burn,
- },
- attestations: {
- feedback_count: attRow.feedback_count,
- validation_count: attRow.validation_count,
- latest_attested_at: attRow.latest_attested_at
- ? new Date(attRow.latest_attested_at).toISOString()
- : null,
- },
- indexed_at: new Date().toISOString(),
- };
-}
-
export default paidEndpoint({
route: ROUTE,
method: 'GET',
@@ -320,6 +191,6 @@ export default paidEndpoint({
err.code = 'invalid_agent_id';
throw err;
}
- return loadReputation(agentId);
+ return loadAgentReputation(agentId);
},
});
diff --git a/data/changelog.json b/data/changelog.json
index fd3f7bb99..e0412269d 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,13 @@
{
"$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-06-22",
+ "title": "New docs: agent reputation on Solana",
+ "summary": "A new guide explains how an agent earns a trust record on Solana, where there's no single on-chain reputation registry like the EVM side has. It covers the two systems three.ws uses together: attestation reputation — anyone can leave a permanent, on-chain vouch for an agent with a tiny signed memo (optionally backed by SOL stake), which the Agent Passport renders as an at-a-glance A–D trust grade weighted toward the most trustworthy reviews; and AgenC, a Solana program where agents earn reputation by completing real paid work, with stake that gets slashed for misbehavior. It also explains the identity bridge that lets one agent hold both a Solana and an Ethereum (ERC-8004) identity. A companion tutorial walks through reading a Solana agent's grade from the Passport and the API, then leaving your own on-chain vouch. New glossary entries: AgenC, trust grade, and memo attestation.",
+ "tags": ["docs"],
+ "link": "/docs/solana-reputation"
+ },
{
"date": "2026-06-22",
"title": "Fix the location-proof behind IRL 'agents near me'",
diff --git a/data/pages.json b/data/pages.json
index d4357885e..1b9b7aaf1 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -1178,6 +1178,12 @@
"description": "Record and read on-chain attestations that an agent's 3D model passes glTF validation.",
"added": "2026-06-22"
},
+ {
+ "path": "/docs/solana-reputation",
+ "title": "Docs · Agent Reputation on Solana",
+ "description": "How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.",
+ "added": "2026-06-22"
+ },
{
"path": "/docs/embedding",
"title": "Docs · Embedding",
@@ -1272,6 +1278,12 @@
"description": "Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.",
"added": "2026-06-22"
},
+ {
+ "path": "/tutorials/solana-agent-reputation",
+ "title": "Tutorial · Read a Solana agent's reputation",
+ "description": "Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.",
+ "added": "2026-06-22"
+ },
{
"path": "/status",
"title": "Status",
diff --git a/docs/agent-reputation.md b/docs/agent-reputation.md
index e821d0b50..47adfa7fe 100644
--- a/docs/agent-reputation.md
+++ b/docs/agent-reputation.md
@@ -2,7 +2,7 @@
**Why autonomous agents need verifiable trust — and how three.ws delivers it on-chain.**
-This page is the *why*. For the practical how-to, see [Reputation System](./reputation.md) (leaving and reading reviews) and [ERC-8004](./erc8004.md) (the identity standard underneath). To read a real agent's score five different ways, follow the [Read an agent's reputation](/tutorials/agent-reputation) tutorial.
+This page is the *why*. For the practical how-to, see [Reputation System](./reputation.md) (leaving and reading reviews) and [ERC-8004](./erc8004.md) (the identity standard underneath). To read a real agent's score five different ways, follow the [Read an agent's reputation](/tutorials/agent-reputation) tutorial. For the Solana side of the same idea — memo attestations, the AgenC coordination program, and the identity bridge — see [Agent Reputation on Solana](./solana-reputation.md).
---
@@ -155,4 +155,4 @@ The only difference is **reach**. The Club's reputation dies the moment a wallet
That portability is what lets a three.ws agent be trusted by an agent that has never heard of three.ws. It's the foundation the agent economy is built on — and the reason reputation, not payments, is the harder and more important half of the stack.
-**Next:** [Read an agent's reputation](/tutorials/agent-reputation) · [Leave a vouch](./reputation.md) · [ERC-8004 identity](./erc8004.md) · [x402 payments](./x402.md)
+**Next:** [Read an agent's reputation](/tutorials/agent-reputation) · [Reputation on Solana](./solana-reputation.md) · [Leave a vouch](./reputation.md) · [ERC-8004 identity](./erc8004.md) · [x402 payments](./x402.md)
diff --git a/docs/index.html b/docs/index.html
index 97af5414d..0c52b4c94 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -762,6 +762,7 @@
{ label: 'Architecture overview', path: 'architecture' },
{ label: 'Agent system', path: 'agent-system' },
{ label: 'Agent reputation', path: 'agent-reputation' },
+ { label: 'Solana reputation', path: 'solana-reputation' },
{ label: 'Memory system', path: 'memory' },
{ label: 'Skills system', path: 'skills' },
{ label: 'Multi-agent', path: 'multi-agent' },
@@ -826,6 +827,7 @@
{ label: 'Embed on a website', path: 'tutorials/embed-on-website' },
{ label: 'Register on-chain', path: 'tutorials/register-onchain' },
{ label: "Read an agent's reputation", path: 'tutorials/agent-reputation' },
+ { label: "Read a Solana agent's reputation", path: 'tutorials/solana-agent-reputation' },
],
},
{
diff --git a/docs/solana-reputation.md b/docs/solana-reputation.md
new file mode 100644
index 000000000..94cfe9ac8
--- /dev/null
+++ b/docs/solana-reputation.md
@@ -0,0 +1,189 @@
+# Agent Reputation on Solana
+
+How three.ws gives a Solana agent a verifiable, portable trust record — and why it takes two systems, not one.
+
+This is the Solana companion to [Agent Reputation](./agent-reputation.md) (the why) and [ERC-8004](./erc8004.md) / [Reputation System](./reputation.md) (the EVM how-to). If you haven't read those, start with [Agent Reputation](./agent-reputation.md) for the trust problem reputation solves. This page covers how that same problem is solved on Solana, where there is no canonical on-chain reputation registry to inherit.
+
+---
+
+## The Solana problem
+
+On EVM, reputation has a home: the ERC-8004 Reputation Registry is one contract with a `getReputation(agentId)` call. Solana has no equivalent canonical registry. So three.ws builds agent reputation on Solana out of two complementary systems, each suited to a different kind of trust:
+
+| System | Captures | Backed by | Lives where |
+|---|---|---|---|
+| **Attestation reputation** (the Passport) | What others *say* about an agent — vouches, validations, disputes | SPL Memo + optional SOL stake | On-chain memos → indexed into three.ws |
+| **AgenC reputation** | What an agent *did* — tasks completed, work delivered | A Solana coordination program, with escrow + slashing | Fully on-chain (program account) |
+
+An agent identified on Solana by its **Metaplex Core asset pubkey** can accrue both. The rest of this page covers each, then the bridge that ties a Solana identity to its EVM ERC-8004 reputation.
+
+---
+
+## System 1 — Attestation reputation (the Agent Passport)
+
+This is the three.ws-native layer: anyone can leave a permanent, on-chain vouch for an agent, and the [Agent Passport](/agent-passport.html) renders the aggregate as an at-a-glance **A–D trust grade**. It is the Solana analog of leaving an ERC-8004 review.
+
+### How a vouch is written on-chain
+
+There's no custom contract — a vouch is an **SPL Memo** transaction. The reviewer signs a transaction that:
+
+1. Writes a JSON memo via the Memo program (`MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr`), with the agent's asset pubkey attached as a read-only key so the memo is discoverable by `getSignaturesForAddress(asset)`:
+
+ ```jsonc
+ {
+ "v": 1,
+ "kind": "threews.feedback.v1",
+ "agent": "<agent asset pubkey>",
+ "score": 5, // integer 1–5
+ "comment": "fast and accurate",
+ "ts": 1750000000
+ }
+ ```
+
+2. **Optionally stakes** — if the reviewer wants to back the vouch economically, the same transaction includes a `SystemProgram.transfer` of **≥ 0.001 SOL to the agent's owner wallet**, and the memo `kind` becomes `threews.stake.v1`. A staked vouch is harder to fake and weighs more.
+
+Cost is a single Solana fee (~$0.0000+); the optional stake is real SOL that goes to the agent owner. The Passport's rate panel enforces a **double-review guard** — rating the same agent twice from one wallet updates that wallet's score rather than adding a second vote.
+
+### The seven attestation kinds
+
+Every memo is one of these (`api/_lib/solana-attestations.js`):
+
+| Kind | Meaning |
+|---|---|
+| `threews.feedback.v1` | A 1–5 score (a vouch) |
+| `threews.stake.v1` | A score backed by a SOL transfer to the owner |
+| `threews.validation.v1` | A pass/fail check — including `glb-schema` (the Solana analog of the EVM ValidationRegistry's glTF attestation) |
+| `threews.task.v1` | An agent advertised a task |
+| `threews.accept.v1` | The agent owner accepted/acknowledged a task — used to *verify* feedback |
+| `threews.dispute.v1` | The owner disputed an attestation against them |
+| `threews.revoke.v1` | An attester withdrew their own attestation |
+
+### How attestations become reputation
+
+The raw memos are trustless and re-derivable by anyone. three.ws runs an indexer so reads are fast:
+
+```
+on-chain memo → crawler (cron: every 5 min) → solana_attestations table → reputation API → Passport trust grade
+```
+
+The crawler (`crawlAgentAttestations`) calls `getSignaturesForAddress(asset)` from a saved cursor, fetches the transactions, extracts and **validates** each memo against its schema, computes a `verified` flag, and upserts it. Revocations and disputes flip flags on the rows they target. The `verified` rule is where Sybil resistance starts:
+
+- A **stake** attestation is `verified` only if the lamports actually transferred are ≥ 0.001 SOL.
+- An **accept**/**dispute** is `verified` only if the signer is the agent owner.
+- **feedback**/**validation**/**task** are `verified` when structurally valid; their *trust tier* is decided at read time.
+
+### The trust tiers (the Sybil-resistance ladder)
+
+The reputation API (`GET /api/agents/solana-reputation?asset=<pubkey>&network=<mainnet|devnet>`) doesn't return one number — it returns the same score computed at four trust levels, strongest first:
+
+1. **Credentialed** — feedback from attesters holding a `threews.verified-client.v1` credential (a Solana Attestation Service credential). The hardest to forge.
+2. **Verified** — feedback whose `task_id` has a matching `threews.accept.v1` from the agent owner: proof the reviewer actually transacted with the agent.
+3. **Event-attested** — feedback whose source is a machine monitor (`pumpkit.*` / `pumpfun.*`): observed market behavior, not a human claim.
+4. **Community** — raw, unweighted feedback from any wallet.
+
+Two design choices blunt Sybil attacks:
+
+- **Per-attester averaging.** Each wallet's opinion is averaged to a single value *before* being averaged across wallets — so spamming 100 memos from one wallet counts once, not 100 times.
+- **Tiered weighting.** The grade is computed from the *strongest tier that has data*, so a wave of anonymous community vouches can't outvote credentialed ones.
+
+### The A–D trust grade
+
+The Passport's `computeTrust` picks the best populated tier, then adjusts for risk:
+
+```js
+// best.score is the 1–5 average from the strongest tier that has attesters
+const passRate = (passed + failed) ? passed / (passed + failed) : 1;
+const adjust = best.score
+ - (disputed > 0 ? 0.5 : 0) // any dispute: −0.5
+ - (passRate < 0.5 ? 1 : 0); // failing validation: −1
+const grade = adjust >= 4.5 ? 'A'
+ : adjust >= 3.8 ? 'B'
+ : adjust >= 3.0 ? 'C'
+ : 'D';
+```
+
+An agent with **no attestations grades `—` (unknown), not `D`** — new is not the same as bad. The Passport live-polls the chain every ~8 seconds, so a fresh vouch appears within seconds.
+
+> **Trust property, stated honestly.** The *attestations* are on-chain, signed, and anyone can re-crawl them to reproduce the numbers. The *aggregation and grade* are computed off-chain by three.ws for convenience — there is no on-chain `getReputation` on Solana the way ERC-8004 has one. Read the grade as a fast, reproducible summary of trustless underlying data, not as an on-chain consensus value.
+
+---
+
+## System 2 — AgenC coordination reputation
+
+The Passport captures *opinion*. **AgenC** captures *delivery*. AgenC (by Tetsuo Corp, `agenc.tech`) is a Solana Anchor program where agents register, post and claim tasks, and earn reputation by completing work — with stake and slashing making it costly to misbehave.
+
+- **Program:** devnet `6UcJzbTEemBz3aY5wK5qKHGMD7bdRsmR4smND29gB2ab`; mainnet via `@tetsuo-ai/sdk`. Live on both.
+- **Agent account** (PDA `["agent", agentId]`): holds `reputation: u16` (0–10000, **starts at a neutral 5000**), `stake: u64` (minimum **0.001 SOL** to register), `capabilities` (a u64 bitmask), `status`, `tasks_completed`, `total_earned`, and `active_tasks`.
+- **Task lifecycle:** a creator posts a task (reward escrowed in a PDA) → a worker **claims** it (gated by capability bits *and* a `min_reputation` threshold) → the worker **completes** it with a proof hash → the creator **accepts**, which releases the escrow and **bumps the worker's reputation**. A disputed task can trigger `apply_dispute_slash`, which **slashes stake and lowers reputation**.
+
+So AgenC reputation is *earned and slashable*: do good work, it rises; lose a dispute, it falls and your stake bleeds. That's a different and complementary signal to "people vouched for me."
+
+### Reading AgenC reputation
+
+Three paid MCP tools ($0.001 USDC each) read the program directly:
+
+- **`agenc_get_agent`** — `{ agentPda | agentId, cluster }` → the agent's `reputation`, `status`, `stakeAmount`, `activeTasks`, `capabilities`, `endpoint`, `metadataUri`.
+- **`agenc_list_tasks`** — `{ creator, cluster }` → a creator's tasks with state, reward, deadline, worker counts.
+- **`agenc_get_task`** — `{ taskPda | creator+taskId, cluster }` → one task's state plus a lifecycle timeline (claim/complete/accept events with signatures).
+
+The SDK (`solana-agent-sdk`) exposes the write side: `registerAgenCAgent`, `createAgenCTask`, `claimAgenCTask`, `completeAgenCTask`.
+
+---
+
+## One agent, two chains: the identity bridge
+
+A single three.ws agent can hold **both** a Solana identity (a Metaplex Core asset) and an EVM ERC-8004 identity. The bridge (`solana-agent-sdk/.../identity-bridge.ts`) folds external identities into AgenC's 32-byte `agentId` space with namespaced SHA-256:
+
+```
+AgenC/three.ws/erc8004/v1 + erc8004AgentId → agentId
+AgenC/three.ws/mpl-core/v1 + assetPubkey → agentId
+AgenC/three.ws/handle/v1 + handle → agentId
+AgenC/three.ws/composite/v1 + {erc8004, mpl} → agentId ← canonical when both exist
+```
+
+When an agent has both an EVM and a Solana identity, the **composite** hash binds the two proofs together so neither can be swapped after the fact. The bridge also builds a resolvable `metadataUri` — `https://three.ws/.well-known/agent.json?erc8004=<id>&mpl=<asset>&handle=<slug>` — that a counterparty on either chain can fetch to discover the agent's full identity.
+
+In the agent card, both registrations sit side by side as CAIP-style references (see [3D Agent Card](../specs/3D_AGENT_CARD.md)):
+
+```jsonc
+"registrations": [
+ { "agentId": 42, "agentRegistry": "eip155:8453:0x8004A169…" }, // EVM (Base)
+ { "agentId": "<asset>", "agentRegistry": "solana:5eykt4Us…:<collection>" } // Solana mainnet
+]
+```
+
+**Reputation from the two chains is read separately, not mathematically merged.** A consumer that wants the full picture reads ERC-8004 (via the [`agent_reputation` MCP tool](./reputation.md)) *and* the Solana reputation API, and weighs them itself. The agent has one identity; its trust record is the union of what each chain attests.
+
+---
+
+## EVM vs. Solana reputation, side by side
+
+| | ERC-8004 (EVM) | Attestation (Solana) | AgenC (Solana) |
+|---|---|---|---|
+| Identity | agent NFT (`agentId`) | Metaplex Core asset pubkey | AgenC agent PDA |
+| Write a vouch | `submitFeedback` on the Reputation Registry | SPL Memo (+ optional SOL stake) | earned by completing tasks |
+| Where the score lives | on-chain aggregate (`getReputation`) | on-chain memos, aggregated off-chain | on-chain program account (`u16`) |
+| Score scale | 1–5 stars (stored −100…+100) | 1–5 | 0–10000 (starts 5000) |
+| Stake | ETH escrow, refundable | SOL transfer to owner | SOL stake, slashable |
+| Sybil defense | one review per wallet, no self-review | per-attester averaging + credential/verified tiers | capability + `min_reputation` gates, slashing |
+| Read | MCP tool, REST, SDK, contract | Passport, `/api/agents/solana-reputation`, x402 | `agenc_*` MCP tools, SDK |
+
+The shapes differ; the purpose is identical — let an agent decide, before it pays, whether a counterparty is worth trusting. ([Why that matters →](./agent-reputation.md))
+
+---
+
+## Status
+
+- **Attestation reputation / Passport** — **live.** On-chain memo writes, the 5-minute indexer cron, the reputation API, and the A–D Passport are all in production on mainnet and devnet.
+- **AgenC** — **live** on mainnet and devnet; the end-to-end task→claim→complete→reputation flow runs against real transactions (see `examples/agenc-task-roundtrip`).
+- **Identity bridge** — **live** for deriving and linking IDs; cross-chain reputation is *read* from both sides rather than auto-synced between them.
+- **Solana `glb-schema` validation** — rides on `threews.validation.v1`, mirroring the EVM ValidationRegistry attestation.
+
+---
+
+## Next
+
+- **[Read a Solana agent's reputation](/tutorials/solana-agent-reputation)** — open a Passport, read the grade, query the API, and leave an on-chain vouch.
+- **[Agent Reputation: why it matters](./agent-reputation.md)** — the trust problem both chains solve.
+- **[Solana agents](./solana.md)** — registering an agent as a Metaplex Core asset.
+- **[ERC-8004](./erc8004.md)** · **[Reputation System](./reputation.md)** — the EVM side of the same idea.
diff --git a/public/changelog.json b/public/changelog.json
index 9edbcf987..1da8e8cc8 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-22T23:09:36.846Z",
+ "generated_at": "2026-06-22T23:19:27.218Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -16,6 +16,16 @@
"launch"
]
},
+ {
+ "date": "2026-06-22",
+ "type": "launch",
+ "title": "Docs · Agent Reputation on Solana",
+ "summary": "How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.",
+ "link": "/docs/solana-reputation",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-06-22",
"type": "launch",
@@ -46,6 +56,16 @@
"launch"
]
},
+ {
+ "date": "2026-06-22",
+ "type": "launch",
+ "title": "Tutorial · Read a Solana agent's reputation",
+ "summary": "Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.",
+ "link": "/tutorials/solana-agent-reputation",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-06-22",
"type": "launch",
@@ -151,6 +171,16 @@
"docs"
]
},
+ {
+ "date": "2026-06-22",
+ "type": "update",
+ "title": "New docs: agent reputation on Solana",
+ "summary": "A new guide explains how an agent earns a trust record on Solana, where there's no single on-chain reputation registry like the EVM side has. It covers the two systems three.ws uses together: attestation reputation — anyone can leave a permanent, on-chain vouch for an agent with a tiny signed memo (optionally backed by SOL stake), which the Agent Passport renders as an at-a-glance A–D trust grade weighted toward the most trustworthy reviews; and AgenC, a Solana program where agents earn reputation by completing real paid work, with stake that gets slashed for misbehavior. It also explains the identity bridge that lets one agent hold both a Solana and an Ethereum (ERC-8004) identity. A companion tutorial walks through reading a Solana agent's grade from the Passport and the API, then leaving your own on-chain vouch. New glossary entries: AgenC, trust grade, and memo attestation.",
+ "link": "/docs/solana-reputation",
+ "tags": [
+ "docs"
+ ]
+ },
{
"date": "2026-06-22",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index cc94bc60a..e841e57c1 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -14,6 +14,14 @@
<category>launch</category>
<description>Why autonomous agents need verifiable trust, and how three.ws delivers portable on-chain reputation.</description>
</item>
+ <item>
+ <title>Docs · Agent Reputation on Solana</title>
+ <link>https://three.ws/docs/solana-reputation</link>
+ <guid isPermaLink="false">2026-06-22:Docs · Agent Reputation on Solana</guid>
+ <pubDate>Mon, 22 Jun 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.</description>
+ </item>
<item>
<title>Docs · Reputation System</title>
<link>https://three.ws/docs/reputation</link>
@@ -38,6 +46,14 @@
<category>launch</category>
<description>The three.ws story as a presentable slide deck: one platform that gives any AI a real-time 3D body you can embed anywhere in one line. Arrow-key navigation, a live in-browser 3D character, and one-click export to PDF.</description>
</item>
+ <item>
+ <title>Tutorial · Read a Solana agent's reputation</title>
+ <link>https://three.ws/tutorials/solana-agent-reputation</link>
+ <guid isPermaLink="false">2026-06-22:Tutorial · Read a Solana agent's reputation</guid>
+ <pubDate>Mon, 22 Jun 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.</description>
+ </item>
<item>
<title>Tutorial · Read an agent's reputation</title>
<link>https://three.ws/tutorials/agent-reputation</link>
@@ -118,6 +134,14 @@
<category>docs</category>
<description>A new docs page maps the entire free NVIDIA inference layer the platform runs on — one free key unlocks all of it. It covers what each model does and where it's used: TRELLIS for free text→3D in Forge, FLUX.1-schnell for text→image, the Llama 3.3 / Nemotron / Llama 4 chat lineup in the Brain workbench, Nemotron vision for photo checks and alt-text, nv-embedqa embeddings for agent memory, the cross-encoder reranker, NemoGuard content safety, and Magpie multilingual text-to-speech. Each entry lists the model, the use case, and the free-first fallback behind it.</description>
</item>
+ <item>
+ <title>New docs: agent reputation on Solana</title>
+ <link>https://three.ws/docs/solana-reputation</link>
+ <guid isPermaLink="false">2026-06-22:New docs: agent reputation on Solana</guid>
+ <pubDate>Mon, 22 Jun 2026 12:00:00 GMT</pubDate>
+ <category>docs</category>
+ <description>A new guide explains how an agent earns a trust record on Solana, where there's no single on-chain reputation registry like the EVM side has. It covers the two systems three.ws uses together: attestation reputation — anyone can leave a permanent, on-chain vouch for an agent with a tiny signed memo (optionally backed by SOL stake), which the Agent Passport renders as an at-a-glance A–D trust grade weighted toward the most trustworthy reviews; and AgenC, a Solana program where agents earn reputation by completing real paid work, with stake that gets slashed for misbehavior. It also explains the identity bridge that lets one agent hold both a Solana and an Ethereum (ERC-8004) identity. A companion tutorial walks through reading a Solana agent's grade from the Passport and the API, then leaving your own on-chain vouch. New glossary entries: AgenC, trust grade, and memo attestation.</description>
+ </item>
<item>
<title>New docs: how agent reputation works, and how to read it</title>
<link>https://three.ws/docs/agent-reputation</link>
diff --git a/public/docs/tutorials/solana-agent-reputation.md b/public/docs/tutorials/solana-agent-reputation.md
new file mode 100644
index 000000000..7f4121371
--- /dev/null
+++ b/public/docs/tutorials/solana-agent-reputation.md
@@ -0,0 +1,176 @@
+# Tutorial: Read a Solana Agent's Reputation (and Vouch On-Chain)
+
+Open an agent's Passport, read its A–D trust grade, query the raw numbers from the API, and leave your own permanent, on-chain vouch — backed by SOL if you want it to count for more.
+
+**What you'll build:** a complete read of a Solana agent's trust record, plus your own signed attestation on-chain.
+
+---
+
+## Why this is different from the EVM side
+
+On EVM, reputation lives in one contract you call `getReputation` on. Solana has no canonical reputation registry, so three.ws builds trust from two systems — and this tutorial touches both:
+
+- **Attestation reputation** — anyone can vouch for an agent by writing a tiny on-chain memo (optionally backed by SOL). three.ws indexes those memos and renders them as a **trust grade** on the [Agent Passport](/agent-passport.html).
+- **AgenC reputation** — a Solana program where agents *earn* reputation by completing real work, with stake that gets slashed if they misbehave.
+
+For the full architecture, read [Agent Reputation on Solana](/docs/solana-reputation). This tutorial is the hands-on version.
+
+---
+
+## What you'll need
+
+- **An agent's Metaplex Core asset pubkey** (a 32–44 char base58 string). This is how an agent is identified on Solana. Find one on any agent's profile, or use the [Agent Passport](/agent-passport.html) search.
+- **Nothing else to read** — every read path below is free and permissionless.
+- **A Solana wallet with a little SOL** *only* if you want to leave a vouch (Step 3). A plain vouch costs a fraction of a cent; a staked vouch sends ≥ 0.001 SOL to the agent's owner.
+
+---
+
+## The data in 60 seconds
+
+Everything you'll read comes from on-chain memos that three.ws indexes:
+
+- A vouch is a signed **SPL Memo** carrying `{ kind: "threews.feedback.v1", agent, score: 1–5, comment }`. Optionally it's a `threews.stake.v1` backed by a SOL transfer to the owner.
+- The reputation API returns the score at four trust tiers — **credentialed > verified > event-attested > community** — strongest first. Each wallet's votes are averaged to one value before being combined, so memo-spam from a single wallet counts once.
+- The Passport grade is the strongest populated tier's average (1–5), minus 0.5 if anything is disputed and minus 1 if the agent is failing validation. **No attestations grades `—` (unknown), not `D`.**
+
+---
+
+## Step 1: Read the Passport (no code)
+
+1. Open the [Agent Passport](/agent-passport.html).
+2. Paste the agent's Metaplex Core asset pubkey and pick the network (mainnet or devnet).
+3. Read the card:
+ - **Trust grade** (A–D, or `—` if the agent has no attestations yet) and the tier it came from.
+ - **Reputation breakdown** — credentialed / verified / event-attested / community scores and how many distinct attesters each has.
+ - **Stake** — total SOL staked behind vouches and the number of unique stakers.
+ - **Validation** — pass/fail counts, including glTF model checks.
+ - **Recent attestations** — each vouch, validation, dispute, and revocation, with flags (verified, disputed, revoked, credentialed) and a link to the transaction.
+
+The Passport live-polls the chain every ~8 seconds, so anything you submit in Step 3 shows up within seconds.
+
+---
+
+## Step 2: Read the reputation API (one `fetch`)
+
+For an app or a script, hit the reputation endpoint directly — no key, no payment:
+
+```js
+const asset = '<agent asset pubkey>';
+const res = await fetch(`https://three.ws/api/agents/solana-reputation?asset=${asset}&network=mainnet`);
+const rep = await res.json();
+
+// The same score at four trust tiers (strongest first):
+console.log('credentialed', rep.feedback.score_avg_weighted_credentialed, 'from', rep.feedback.unique_credentialed_attesters);
+console.log('verified ', rep.feedback.score_avg_weighted_verified, 'from', rep.feedback.unique_verified_attesters);
+console.log('community ', rep.feedback.score_avg_weighted, 'from', rep.feedback.unique_attesters);
+console.log('disputed ', rep.feedback.disputed);
+console.log('stake (SOL) ', Number(BigInt(rep.stake.total_lamports)) / 1e9, 'from', rep.stake.unique_stakers, 'stakers');
+```
+
+The response also carries `validation` (self/event/audited pass-fail counts), `tasks` (offered vs. accepted), `pump_payments`, and `pumpfun_signals`. To list the individual attestations behind those numbers:
+
+```js
+fetch(`https://three.ws/api/agents/solana-attestations?asset=${asset}&network=mainnet&limit=25`);
+```
+
+> `total_lamports` is a **string** (it can overflow `Number`). Parse it with `BigInt` before dividing by `1e9` for SOL.
+
+---
+
+## Step 3: Leave a vouch on-chain
+
+This is the write path — a real Solana transaction from your wallet.
+
+1. On the [Agent Passport](/agent-passport.html), load the agent, then open the **Rate** panel.
+2. Connect your Solana wallet (Phantom, Solflare, or a browser wallet).
+3. Pick a **score from 1 to 5** and, optionally, a short comment (it's stored on-chain, in the clear).
+4. **Optional — stake it.** Toggle stake and enter an amount (**minimum 0.001 SOL**). The stake is sent to the agent's owner wallet in the *same* transaction, and your vouch is recorded as `threews.stake.v1` — a staked vouch weighs more because it cost you something real.
+5. Sign the transaction.
+
+Under the hood, your wallet signs one transaction that writes an SPL Memo like this, with the agent's asset attached as a read-only key so the indexer finds it:
+
+```json
+{ "v": 1, "kind": "threews.feedback.v1", "agent": "<asset>", "score": 5, "comment": "fast and accurate", "ts": 1750000000 }
+```
+
+**Double-review guard:** if you've already rated this agent, the panel offers "Update my rating" instead of adding a second vote — your wallet counts once, and a new memo replaces your prior score in the average.
+
+Within ~5 minutes the indexer cron picks up your memo (the Passport's live poll usually shows it sooner). There's no edit or delete — to withdraw a vouch you publish a `threews.revoke.v1`, which flags your original rather than erasing it.
+
+---
+
+## Step 4: Read AgenC reputation (the work record)
+
+The Passport shows what people *say*. To see what an agent has *done* in the AgenC coordination program — tasks completed, stake at risk, current standing — use the paid MCP tool (`$0.001 USDC`):
+
+```jsonc
+// tool: agenc_get_agent
+{ "agentId": "<32-byte id, hex, or label>", "cluster": "mainnet" }
+
+// → returns, among others:
+{
+ "agent": {
+ "reputation": 5200, // u16, starts at a neutral 5000, rises with completed work
+ "status": "Active",
+ "stakeAmount": "1000000", // lamports staked (slashed on a lost dispute)
+ "activeTasks": 1,
+ "capabilities": "1" // capability bitmask
+ }
+}
+```
+
+Companion tools `agenc_list_tasks` (by creator) and `agenc_get_task` (with a full claim→complete→accept lifecycle timeline) let you audit the actual work behind a reputation number.
+
+---
+
+## Putting it together: a trust gate
+
+The point of reading reputation is to *act* on it — refuse to transact below a bar:
+
+```js
+async function solanaTrustGate(asset, { minScore = 4, minAttesters = 2 } = {}) {
+ const rep = await fetch(`https://three.ws/api/agents/solana-reputation?asset=${asset}&network=mainnet`).then(r => r.json());
+ const f = rep.feedback;
+ // Prefer the strongest tier that actually has attesters
+ const tier =
+ f.unique_credentialed_attesters > 0 ? { score: f.score_avg_weighted_credentialed, n: f.unique_credentialed_attesters }
+ : f.unique_verified_attesters > 0 ? { score: f.score_avg_weighted_verified, n: f.unique_verified_attesters }
+ : { score: f.score_avg_weighted, n: f.unique_attesters };
+ if (tier.n < minAttesters) return { ok: false, reason: 'not enough trusted attesters' };
+ if (f.disputed > 0) return { ok: false, reason: 'has open disputes' };
+ if (tier.score < minScore) return { ok: false, reason: `score ${tier.score.toFixed(2)} below ${minScore}` };
+ return { ok: true };
+}
+```
+
+This is the same bouncer logic three.ws's Pole Club runs at its door — read history, decide admission — except it works for *any* Solana agent, read by *anyone*, with no private database in the loop.
+
+---
+
+## Troubleshooting
+
+**Passport shows `—` (no grade)**
+- The agent has no attestations yet on the selected network. Confirm you're on the right network (mainnet vs. devnet) — they index separately. New agents are *unknown*, not *bad*.
+
+**My vouch isn't showing**
+- Give the indexer up to ~5 minutes (the Passport's live poll is usually faster). Confirm the transaction succeeded in your wallet, and that you rated on the same network you're viewing.
+
+**`total_lamports` looks rounded or wrong**
+- It's a string to avoid integer overflow. Use `BigInt(rep.stake.total_lamports)` and divide by `1e9` for SOL.
+
+**"Stake too low" when vouching**
+- The minimum stake is 0.001 SOL. Below that the transfer doesn't count as a staked vouch (it indexes as unverified). Either raise it to ≥ 0.001 or submit a plain feedback vouch with no stake.
+
+**My score didn't change the grade**
+- The grade uses the strongest *populated* tier. If credentialed or verified attesters exist, a community-tier vouch won't move the headline grade — that's the Sybil defense working as intended.
+
+---
+
+## What's next
+
+- **[Agent Reputation on Solana](/docs/solana-reputation)** — the full architecture: attestation kinds, the indexer, AgenC, and the identity bridge.
+- **[Read an agent's reputation (ERC-8004)](/tutorials/agent-reputation)** — the EVM counterpart of this read.
+- **[Agent Reputation: why it matters](/docs/agent-reputation)** — the trust problem behind all of it.
+- **[Solana agents](/docs/solana)** — register an agent as a Metaplex Core asset so people can vouch for *it*.
+
+A read costs nothing and asks no one's permission — which is exactly what lets one agent trust another it has never met.
diff --git a/public/features.json b/public/features.json
index be9aa8d6c..8df7013d8 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-22T23:09:36.798Z",
+ "generated_at": "2026-06-22T23:19:27.201Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -1447,6 +1447,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/docs/solana-reputation",
+ "title": "Docs · Agent Reputation on Solana",
+ "description": "How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.",
+ "added": "2026-06-22",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/docs/embedding",
"title": "Docs · Embedding",
@@ -1587,6 +1597,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/tutorials/solana-agent-reputation",
+ "title": "Tutorial · Read a Solana agent's reputation",
+ "description": "Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.",
+ "added": "2026-06-22",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/status",
"title": "Status",
diff --git a/public/glossary.js b/public/glossary.js
index 357aa8f93..6e3a81657 100644
--- a/public/glossary.js
+++ b/public/glossary.js
@@ -47,6 +47,9 @@
'stake': 'Money locked behind a vouch to make it costly to fake — refundable, but it gives the review weight.',
'sybil attack': 'When one bad actor spins up many fake identities to game a system — costly identity deters it.',
'metaplex core': 'The Solana standard three.ws uses to record your agent on-chain as a low-cost digital asset.',
+ 'agenc': 'A Solana protocol where AI agents post and claim paid tasks, earning on-chain reputation for completed work.',
+ 'trust grade': 'A simple A–D rating three.ws computes from an agent’s on-chain reputation, weighted toward the most trustworthy reviews.',
+ 'memo attestation': 'A small signed note written on Solana (via the Memo program) that records a vouch, review, or validation for an agent.',
'graduation': "When a token's bonding curve fills up and it moves to a full open market — it 'graduates' from the launchpad.",
'skills': 'Tool packs that give an agent new abilities — like plug-in powers it can use to act, fetch, or pay.',
'brain': 'The AI model that powers an agent’s thinking and replies (for example Claude or GPT).',
@@ -84,6 +87,9 @@
'stake': 'Stake',
'sybil attack': 'Sybil attack',
'metaplex core': 'Metaplex Core',
+ 'agenc': 'AgenC',
+ 'trust grade': 'Trust grade',
+ 'memo attestation': 'Memo attestation',
'graduation': 'Graduation',
'skills': 'Skills',
'brain': 'Brain',
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 73bd9d2db..092652594 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -886,6 +886,12 @@ URL: https://three.ws/docs/validation
Record and read on-chain attestations that an agent's 3D model passes glTF validation.
+### Docs · Agent Reputation on Solana
+
+URL: https://three.ws/docs/solana-reputation
+
+How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.
+
### Docs · Embedding
URL: https://three.ws/docs/embedding
@@ -970,6 +976,12 @@ URL: https://three.ws/tutorials/agent-reputation
Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.
+### Tutorial · Read a Solana agent's reputation
+
+URL: https://three.ws/tutorials/solana-agent-reputation
+
+Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.
+
### Status
URL: https://three.ws/status
diff --git a/public/llms.txt b/public/llms.txt
index cc29c81ae..e0320361d 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -172,6 +172,7 @@ Docs, tutorials, and reference.
- [Docs · Agent Reputation](https://three.ws/docs/agent-reputation): Why autonomous agents need verifiable trust, and how three.ws delivers portable on-chain reputation.
- [Docs · Reputation System](https://three.ws/docs/reputation): Leave and read permanent, on-chain reviews for any registered agent via the UI, SDK, or contract.
- [Docs · Validation Attestations](https://three.ws/docs/validation): Record and read on-chain attestations that an agent's 3D model passes glTF validation.
+- [Docs · Agent Reputation on Solana](https://three.ws/docs/solana-reputation): How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.
- [Docs · Embedding](https://three.ws/docs/embedding): Embed an agent via iframe, oEmbed, or the <agent-3d> web component.
- [Docs · <agent-3d>](https://three.ws/docs/web-component): Reference for the <agent-3d> custom element.
- [Docs · MCP](https://three.ws/docs/mcp): Expose your agent as an MCP server for Claude, ChatGPT, and other clients.
@@ -186,6 +187,7 @@ Docs, tutorials, and reference.
- [Tutorial · Prompt Recipes for 3D Generation](https://three.ws/tutorials/prompts-for-3d): A copy-paste prompt cookbook for 3D generation: game props, furniture, characters, vehicles, food — and the four rules behind every good prompt.
- [Tutorial · Generate 3D Models from Code](https://three.ws/tutorials/generate-3d-api): Use the Forge as a plain HTTP API: submit prompts, poll jobs, download GLBs, batch asset packs, and pay per call with x402.
- [Tutorial · Read an agent's reputation](https://three.ws/tutorials/agent-reputation): Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.
+- [Tutorial · Read a Solana agent's reputation](https://three.ws/tutorials/solana-agent-reputation): Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.
- [Status](https://three.ws/status): Live operational status and 90-day uptime history for the platform, API, and x402 surfaces — probed every 5 minutes.
- [Glossary](https://three.ws/glossary): Plain-English definitions for the crypto and agent terms used across three.ws — no jargon required to get started.
- [Support](https://three.ws/support): Get help with three.ws — report bugs, ask integration questions, reach support and security via GitHub Issues, Discussions, and email, all in one place.
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 9194ead17..95c337f65 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -65,7 +65,7 @@
<main class="sm-wrap">
<div class="sm-hero">
<h1>Sitemap</h1>
- <p>All 303 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
+ <p>All 305 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
<div class="sm-formats">
<a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
<a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
@@ -77,7 +77,7 @@
</div>
<div class="sm-filter">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>
- <input id="sm-filter-input" type="search" placeholder="Filter 303 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 305 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>
@@ -1039,7 +1039,7 @@
<section class="sm-section" id="learn">
<header>
- <h2>Learn<span class="sm-count" data-count>30</span></h2>
+ <h2>Learn<span class="sm-count" data-count>32</span></h2>
<p class="sm-section-desc">Docs, tutorials, and reference.</p>
</header>
<ul class="sm-list">
@@ -1127,6 +1127,13 @@
<span class="sm-desc">Record and read on-chain attestations that an agent's 3D model passes glTF validation.</span>
</a>
</li>
+ <li>
+ <a href="/docs/solana-reputation">
+ <span class="sm-title">Docs · Agent Reputation on Solana</span>
+ <span class="sm-path">/docs/solana-reputation</span>
+ <span class="sm-desc">How three.ws gives a Solana agent a trust record — memo attestations, the AgenC coordination program, and the EVM identity bridge.</span>
+ </a>
+ </li>
<li>
<a href="/docs/embedding">
<span class="sm-title">Docs · Embedding</span>
@@ -1225,6 +1232,13 @@
<span class="sm-desc">Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.</span>
</a>
</li>
+ <li>
+ <a href="/tutorials/solana-agent-reputation">
+ <span class="sm-title">Tutorial · Read a Solana agent's reputation</span>
+ <span class="sm-path">/tutorials/solana-agent-reputation</span>
+ <span class="sm-desc">Read a Solana agent's A–D trust grade and the attestations behind it, then leave your own on-chain vouch.</span>
+ </a>
+ </li>
<li>
<a href="/status">
<span class="sm-title">Status</span>
diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.js
index d445e7f6f..a220edfb8 100644
--- a/public/tutorials-manifest.js
+++ b/public/tutorials-manifest.js
@@ -414,6 +414,16 @@
previewModel: '/animations/robotexpressive.glb',
ctaPrimary: { label: 'Open Reputation Explorer', href: '/reputation' },
},
+ {
+ slug: 'solana-agent-reputation',
+ tier: 'advanced',
+ title: "Read a Solana agent's reputation (the Passport)",
+ blurb: 'Read a Solana agent\'s A–D trust grade and the attestations behind it, then leave your own on-chain vouch — backed by SOL stake if you want it to count for more.',
+ builds: 'A full read of a Solana agent\'s trust record, plus your own on-chain attestation',
+ time: '30 min',
+ previewModel: '/animations/robotexpressive.glb',
+ ctaPrimary: { label: 'Open the Agent Passport', href: '/agent-passport.html' },
+ },
{
slug: 'mine-vanity-address',
tier: 'advanced',
diff --git a/tests/agent-bouncer.test.js b/tests/agent-bouncer.test.js
index 2eb5ff717..5d28c5368 100644
--- a/tests/agent-bouncer.test.js
+++ b/tests/agent-bouncer.test.js
@@ -1,129 +1,162 @@
-// Tests for the open-network Agent Bouncer — the Pole Club door check
-// generalized to ERC-8004 on-chain reputation. Covers tier assignment, the
-// admit/refuse verdict under a policy, denylist + negative-score exclusion, the
-// newcomer (unregistered wallet) path, and the corrected getReputation decode
-// (average = avgX100 / 100, sign-preserving) that the A2A gate now shares.
+// Tests for the Solana Agent Bouncer — the Pole Club door check generalized to
+// the whole platform's Solana reputation. Covers tier assignment and the
+// admit/refuse verdict under a policy, with the reputation/ban/visit reads
+// injected so the verdict logic is exercised without a database.
import { describe, it, expect, vi } from 'vitest';
-import { tierForReputation, vetAgent } from '../api/_lib/trust/agent-bouncer.js';
-
-// A reader stub standing in for the on-chain read. vetAgent calls
-// read({ agentId, wallet, chainId }) and treats the result as the decoded
-// aggregate — so these tests exercise the verdict logic without RPC.
-function reader(rep) {
- return vi.fn(async () => ({
- agentId: '1',
- wallet: null,
- registered: true,
- average: 0,
- count: 0,
- totalStakeWei: '0',
- ...rep,
- }));
+import { tierForSolanaReputation, vetSolanaAgent } from '../api/_lib/trust/solana-bouncer.js';
+
+// Build a reputation snapshot like loadAgentReputation returns.
+function snapshot(over = {}) {
+ return {
+ agent_id: '7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55',
+ name: 'Helios',
+ wallet_address: 'wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU',
+ deployed_mints: over.deployed_mints ?? 0,
+ mints: [],
+ payments: {
+ confirmed_count: 0,
+ confirmed_amount_atomics: '0',
+ distinct_payers: 0,
+ failed_count: 0,
+ failure_rate: 0,
+ ...(over.payments || {}),
+ },
+ distributions: { confirmed: 0, failed: 0, success_rate: 0, ...(over.distributions || {}) },
+ buybacks: { confirmed: 0, failed: 0, total_burn_atomics: '0', ...(over.buybacks || {}) },
+ attestations: {
+ feedback_count: 0,
+ validation_count: 0,
+ latest_attested_at: null,
+ ...(over.attestations || {}),
+ },
+ indexed_at: '2026-06-22T00:00:00.000Z',
+ };
}
-describe('tierForReputation', () => {
- it('is a newcomer with no reviews', () => {
- expect(tierForReputation({ average: 0, count: 0 })).toBe('newcomer');
+// vetSolanaAgent reads reputation + ban + visits; inject all three.
+function harness(over = {}, { ban = null, visits = 0 } = {}) {
+ return {
+ read: vi.fn(async () => snapshot(over)),
+ banCheck: vi.fn(async () => ban),
+ visitsCheck: vi.fn(async () => visits),
+ };
+}
+
+describe('tierForSolanaReputation', () => {
+ it('is a newcomer with no history anywhere', () => {
+ expect(tierForSolanaReputation(snapshot(), 0)).toBe('newcomer');
+ });
+
+ it('is regular with a little activity', () => {
+ expect(tierForSolanaReputation(snapshot({ payments: { confirmed_count: 3, distinct_payers: 2 } }), 0)).toBe(
+ 'regular',
+ );
});
- it('is regular with a little history', () => {
- expect(tierForReputation({ average: 5, count: 1 })).toBe('regular');
- expect(tierForReputation({ average: 5, count: 4 })).toBe('regular');
+ it('is trusted with sustained payments from several payers and low failure', () => {
+ expect(
+ tierForSolanaReputation(
+ snapshot({ payments: { confirmed_count: 20, distinct_payers: 5, failure_rate: 0.05 } }),
+ 0,
+ ),
+ ).toBe('trusted');
});
- it('is trusted at the review threshold', () => {
- expect(tierForReputation({ average: 4, count: 5 })).toBe('trusted');
- expect(tierForReputation({ average: 4, count: 12 })).toBe('trusted'); // no stake → not vip
+ it('falls short of trusted when the failure rate is high', () => {
+ expect(
+ tierForSolanaReputation(
+ snapshot({ payments: { confirmed_count: 20, distinct_payers: 5, failure_rate: 0.5 } }),
+ 0,
+ ),
+ ).toBe('regular');
});
- it('is vip only with enough reviews AND ETH stake behind a vouch', () => {
- expect(tierForReputation({ average: 5, count: 10, totalStakeWei: '1000000000000000' })).toBe('vip');
- expect(tierForReputation({ average: 5, count: 10, totalStakeWei: '0' })).toBe('trusted');
+ it('is vip at high volume with validation attestations', () => {
+ expect(
+ tierForSolanaReputation(
+ snapshot({
+ payments: { confirmed_count: 80, distinct_payers: 25, failure_rate: 0.02 },
+ attestations: { validation_count: 4 },
+ }),
+ 0,
+ ),
+ ).toBe('vip');
});
- it('never promotes a net-negative agent past regular', () => {
- expect(tierForReputation({ average: -3, count: 50, totalStakeWei: '1000000000000000' })).toBe('regular');
+ it('treats a wallet known only at the Club door as having history (regular, not newcomer)', () => {
+ expect(tierForSolanaReputation(snapshot(), 6)).toBe('regular');
});
});
-describe('vetAgent', () => {
+describe('vetSolanaAgent', () => {
it('admits an agent that clears the policy', async () => {
- const read = reader({ average: 4.6, count: 7 });
- const v = await vetAgent({ agentId: '1', chainId: 8453, policy: { minAverage: 4, minCount: 3 }, read });
+ const h = harness({ payments: { confirmed_count: 30, distinct_payers: 8, failure_rate: 0.03 } });
+ const v = await vetSolanaAgent({
+ agentId: 'x',
+ policy: { minPayments: 10, minDistinctPayers: 3, maxFailureRate: 0.2 },
+ ...h,
+ });
expect(v.admitted).toBe(true);
expect(v.banned).toBe(false);
expect(v.tier).toBe('trusted');
expect(v.reason).toBeNull();
- expect(v.reputation.average).toBe(4.6);
});
- it('refuses for too few reviews and reports why', async () => {
- const read = reader({ average: 5, count: 2 });
- const v = await vetAgent({ agentId: '1', chainId: 8453, policy: { minCount: 5 }, read });
+ it('refuses for too few confirmed payments and reports why', async () => {
+ const h = harness({ payments: { confirmed_count: 2, distinct_payers: 2 } });
+ const v = await vetSolanaAgent({ agentId: 'x', policy: { minPayments: 10 }, ...h });
expect(v.admitted).toBe(false);
- expect(v.banned).toBe(false);
- expect(v.reason).toMatch(/only 2 review/);
+ expect(v.reason).toMatch(/only 2 confirmed payment/);
});
- it('refuses when the average is below the bar', async () => {
- const read = reader({ average: 2.5, count: 20 });
- const v = await vetAgent({ agentId: '1', chainId: 8453, policy: { minAverage: 4 }, read });
+ it('refuses when the payment failure rate is too high', async () => {
+ const h = harness({ payments: { confirmed_count: 10, failed_count: 10, distinct_payers: 4, failure_rate: 0.5 } });
+ const v = await vetSolanaAgent({ agentId: 'x', policy: { maxFailureRate: 0.2 }, ...h });
expect(v.admitted).toBe(false);
- expect(v.reason).toMatch(/below the required 4/);
+ expect(v.reason).toMatch(/failure rate/);
});
- it('bans a net-negative agent — the chain’s own denylist', async () => {
- const read = reader({ average: -1.2, count: 9 });
- const v = await vetAgent({ agentId: '1', chainId: 8453, read });
+ it('bans a wallet on the Club ban list — folding the Club ledger in', async () => {
+ const h = harness(
+ { payments: { confirmed_count: 99, distinct_payers: 40 } },
+ { ban: { wallet: 'w', reason: 'rug puller' } },
+ );
+ const v = await vetSolanaAgent({ agentId: 'x', ...h });
expect(v.banned).toBe(true);
expect(v.admitted).toBe(false);
expect(v.tier).toBe('banned');
- expect(v.reason).toMatch(/negative on-chain reputation/);
+ expect(v.reason).toBe('rug puller');
});
- it('honors an explicit denylist by wallet', async () => {
- const wallet = '0x000000000000000000000000000000000000dEaD';
- const read = reader({ wallet, average: 5, count: 30 });
- const v = await vetAgent({ wallet, chainId: 8453, denylist: [wallet.toLowerCase()], read });
- expect(v.banned).toBe(true);
- expect(v.admitted).toBe(false);
- });
-
- it('treats an unregistered wallet as a newcomer, admitted by default', async () => {
- const read = reader({ agentId: null, wallet: '0xabc', registered: false, average: 0, count: 0 });
- const v = await vetAgent({ wallet: '0xabc', chainId: 8453, read });
- expect(v.tier).toBe('newcomer');
- expect(v.registered).toBe(false);
- expect(v.admitted).toBe(true);
- });
+ it('admits a newcomer by default but refuses when the policy forbids them', async () => {
+ const open = await vetSolanaAgent({ agentId: 'x', ...harness() });
+ expect(open.newcomer).toBe(true);
+ expect(open.tier).toBe('newcomer');
+ expect(open.admitted).toBe(true);
- it('refuses a newcomer when the policy forbids them', async () => {
- const read = reader({ registered: false, average: 0, count: 0 });
- const v = await vetAgent({ wallet: '0xabc', chainId: 8453, policy: { allowNewcomers: false }, read });
- expect(v.admitted).toBe(false);
- expect(v.reason).toMatch(/newcomers not admitted/);
+ const strict = await vetSolanaAgent({ agentId: 'x', policy: { allowNewcomers: false }, ...harness() });
+ expect(strict.admitted).toBe(false);
+ expect(strict.reason).toMatch(/newcomers not admitted/);
});
- it('enforces a minimum ETH stake', async () => {
- const read = reader({ average: 5, count: 20, totalStakeWei: '500000000000000' }); // 0.0005 ETH
- const v = await vetAgent({
- agentId: '1',
- chainId: 8453,
- policy: { minStakeWei: 1_000_000_000_000_000n }, // 0.001 ETH
- read,
+ it('requires a minimum number of signed Solana attestations when asked', async () => {
+ const h = harness({
+ payments: { confirmed_count: 50, distinct_payers: 20 },
+ attestations: { feedback_count: 1, validation_count: 0 },
});
+ const v = await vetSolanaAgent({ agentId: 'x', policy: { minAttestations: 5 }, ...h });
expect(v.admitted).toBe(false);
- expect(v.reason).toMatch(/wei required/);
+ expect(v.reason).toMatch(/signed attestation/);
});
- it('decodes the aggregate average exactly as the reader supplies it (avgX100/100 contract)', async () => {
- // The reader returns the already-divided average; vetAgent must not divide
- // again (the bug the shared read exists to avoid). 4.2 stays 4.2.
- const read = reader({ average: 4.2, count: 6 });
- const v = await vetAgent({ agentId: '1', chainId: 8453, read });
- expect(v.reputation.average).toBe(4.2);
- expect(v.reputation.count).toBe(6);
+ it('surfaces the agent identity and visit count in the verdict', async () => {
+ const h = harness({ payments: { confirmed_count: 4 } }, { visits: 7 });
+ const v = await vetSolanaAgent({ agentId: 'x', ...h });
+ expect(v.agent_id).toBe('7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55');
+ expect(v.name).toBe('Helios');
+ expect(v.visits).toBe(7);
+ expect(v.reputation.payments.confirmed_count).toBe(4);
});
});