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.

fix(validation): count a model-verified badge only when the platform attester signed the memo

nirholas54711cf3e55b
diff --git a/api/_lib/solana-validation-attest.js b/api/_lib/solana-validation-attest.js
index b193772ec..bafb0472f 100644
--- a/api/_lib/solana-validation-attest.js
+++ b/api/_lib/solana-validation-attest.js
@@ -97,6 +97,22 @@ async function pinReport(report, network, agentAsset, proofHash) {
* network: string, agentAsset: string, validator: string, report: object,
* }>}
*/
+/**
+ * The base58 address of the platform attester, or null when the key is not
+ * configured or undecodable. A glb-schema validation is a "model verified"
+ * badge only when THIS key signed it: the memo program accepts a memo from any
+ * wallet, so a read that does not filter on the attester hands the badge to
+ * anyone who posts `{ subkind: 'glb-schema', passed: true }` for an agent.
+ * Fails closed: with no key there is no badge, never everyone's.
+ */
+export function platformValidatorAddress() {
+ try {
+ return loadAttesterKeypair().publicKey.toBase58();
+ } catch {
+ return null;
+ }
+}
+
export async function attestValidationSolana({ network, agentAsset, glbUrl, validatedAt }) {
if (network !== 'mainnet' && network !== 'devnet') {
throw new SolanaAttestError('unsupported_network', `unsupported network ${network}`);
@@ -131,6 +147,7 @@ export async function attestValidationSolana({ network, agentAsset, glbUrl, vali
and kind = ${VALIDATION_KIND}
and payload->>'subkind' = ${SUBKIND_GLB_SCHEMA}
and payload->>'proof_hash' = ${proofHash}
+ and attester = ${validator}
limit 1
`;
if (existing) {
diff --git a/api/agents/solana/_handlers.js b/api/agents/solana/_handlers.js
index 2ef14f332..6189f7d34 100644
--- a/api/agents/solana/_handlers.js
+++ b/api/agents/solana/_handlers.js
@@ -169,7 +169,7 @@ export const handleAttestEvent = wrap(async (req, res) => {
// ── solana-validate (write: glTF/schema validation attestation) ────────────────
-import { attestValidationSolana, SolanaAttestError } from '../../_lib/solana-validation-attest.js';
+import { attestValidationSolana, platformValidatorAddress, SolanaAttestError } from '../../_lib/solana-validation-attest.js';
import { SUBKIND_GLB_SCHEMA } from '../../_lib/solana-attestations.js';
const SOLANA_ATTEST_ERROR_STATUS = {
@@ -281,16 +281,23 @@ export const handleValidation = wrap(async (req, res) => {
[cursor] = await sql`select last_indexed_at from solana_attestations_cursor where agent_asset = ${asset} limit 1`;
}
- const rows = await sql`
- select signature, slot, block_time, attester, payload, verified, revoked, disputed
- from solana_attestations
- where agent_asset = ${asset} and network = ${network}
- and kind = 'threews.validation.v1'
- and payload->>'subkind' = ${SUBKIND_GLB_SCHEMA}
- and revoked = false
- order by slot desc nulls first, block_time desc
- limit ${limit}
- `;
+ // Only the platform attester's memos are model validations; anyone can post a
+ // memo with the same shape, so an unfiltered read would let any wallet award
+ // any agent the badge. No configured attester means no rows, never all rows.
+ const validator = platformValidatorAddress();
+ const rows = validator
+ ? await sql`
+ select signature, slot, block_time, attester, payload, verified, revoked, disputed
+ from solana_attestations
+ where agent_asset = ${asset} and network = ${network}
+ and kind = 'threews.validation.v1'
+ and payload->>'subkind' = ${SUBKIND_GLB_SCHEMA}
+ and attester = ${validator}
+ and revoked = false
+ order by slot desc nulls first, block_time desc
+ limit ${limit}
+ `
+ : [];
const history = rows.map((r) => ({
signature: r.signature,
@@ -429,7 +436,11 @@ export const handleCard = wrap(async (req, res) => {
let validation = null;
try {
- const [v] = await sql`select signature, attester, payload, block_time from solana_attestations where agent_asset = ${asset} and network = ${network} and kind = 'threews.validation.v1' and payload->>'subkind' = ${SUBKIND_GLB_SCHEMA} and revoked = false order by slot desc nulls first, block_time desc limit 1`;
+ // Platform-signed only, for the same reason as handleValidation above.
+ const validator = platformValidatorAddress();
+ const [v] = validator
+ ? await sql`select signature, attester, payload, block_time from solana_attestations where agent_asset = ${asset} and network = ${network} and kind = 'threews.validation.v1' and payload->>'subkind' = ${SUBKIND_GLB_SCHEMA} and attester = ${validator} and revoked = false order by slot desc nulls first, block_time desc limit 1`
+ : [];
if (v) validation = { passed: v.payload?.passed === true, proof_hash: v.payload?.proof_hash || null, proof_uri: v.payload?.proof_uri || null, validator: v.attester, signature: v.signature, validated_at: v.block_time };
} catch (err) {
degraded.push('validation');
diff --git a/public/agent-passport.html b/public/agent-passport.html
index 1e1ed5d87..c4b979b55 100644
--- a/public/agent-passport.html
+++ b/public/agent-passport.html
@@ -819,7 +819,10 @@
const explorer = v.signature
? `https://explorer.solana.com/tx/${v.signature}${network === 'devnet' ? '?cluster=devnet' : ''}`
: null;
- const proof = v.proof_uri || explorer || '#';
+ // proof_uri rides in an on-chain memo any signer can write, so only an
+ // http(s) URL is ever linked; anything else falls back to the explorer.
+ const proofUri = typeof v.proof_uri === 'string' && /^https?:\/\//i.test(v.proof_uri) ? v.proof_uri : null;
+ const proof = proofUri || explorer || '#';
const label = v.passed ? '✓ model verified' : '✗ model failed';
const cls = v.passed ? 'ok' : 'warn';
const title = `glTF/schema validation by platform validator${v.proof_hash ? ` · proof ${String(v.proof_hash).slice(0, 12)}…` : ''}`;