DEV Community

Cover image for MT Prediction: Verify AI Agent Track Records On-Chain with W3C Credentials
Lars
Lars

Posted on • Originally published at moltrust.ch

MT Prediction: Verify AI Agent Track Records On-Chain with W3C Credentials

AI prediction agents claim accuracy rates all the time. Anyone can edit a database.

MT Prediction links on-chain wallets to W3C Decentralized Identifiers (DIDs) and issues PredictionTrackCredentials — verifiable, tamper-evident proofs of prediction accuracy anchored on Base L2. It is part of MolTrust v0.7.0, available at moltrust.ch.

The free wallet-link endpoint requires no API key. Issuing a PredictionTrackCredential costs $2 USDC via the x402 protocol. No subscription required.


Step 1: Link a Wallet to a DID (Free)

The Wallet-to-DID bridge creates a cryptographic link between an on-chain address and a W3C DID.

import requests

response = requests.post(
    "https://api.moltrust.ch/guard/prediction/wallet-link",
    json={
        "wallet_address": "0xYourPolymarketWallet",
        "agent_name": "PredictBot-v2",
        "market_platform": "polymarket"
    }
)

data = response.json()
print(data["did"])
# did:web:api.moltrust.ch:prediction:0xYour...
print(data["base_anchor"])
# Base mainnet transaction hash
Enter fullscreen mode Exit fullscreen mode

The response includes a link_credential — a W3C Verifiable Credential proving the wallet-to-DID binding — and a base_anchor with the Base mainnet transaction hash.


Step 2: Check Any Agent's Track Record (Free)

Any platform can look up a linked wallet's verified prediction history:

curl https://api.moltrust.ch/guard/prediction/wallet/0xYourAddress
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "wallet_address": "0xYour...",
  "did": "did:web:api.moltrust.ch:prediction:0xYour...",
  "predictions_total": 142,
  "accuracy_rate": 0.74,
  "profit_loss_usdc": 2840.50,
  "credential_count": 3,
  "base_anchor": "0xabc123..."
}
Enter fullscreen mode Exit fullscreen mode

The accuracy_rate is derived from on-chain transaction history — not self-reported. A platform integrating MT Prediction displays this data with cryptographic backing.


Step 3: Issue a PredictionTrackCredential ($2 USDC)

When an agent's track record is strong enough, it can pay $2 USDC via x402 to receive a W3C Verifiable Credential:

response = requests.post(
    "https://api.moltrust.ch/guard/vc/prediction/issue",
    headers={"X-Payment": "<x402-payment-proof>"},
    json={
        "wallet_address": "0xYourAddress",
        "credential_type": "PredictionTrackCredential"
    }
)

vc = response.json()["credential"]
# W3C Verifiable Credential, JSON-LD format
# Ed25519 signed, anchored on Base mainnet
# Verifiable by any W3C-compliant resolver
Enter fullscreen mode Exit fullscreen mode

All 5 Endpoints

Method Endpoint Cost
POST /guard/prediction/wallet-link Free
GET /guard/prediction/wallet/:addr Free
GET /guard/prediction/integrity/:market_id Free
GET /guard/prediction/leaderboard Free
POST /guard/vc/prediction/issue $2 USDC

MCP Integration

MT Prediction ships 3 MCP tools, callable by any MCP-compatible AI agent:

{
  "tools": [
    "moltrust_link_prediction_wallet",
    "moltrust_get_prediction_profile",
    "moltrust_issue_prediction_vc"
  ]
}
Enter fullscreen mode Exit fullscreen mode

Install the full MolTrust MCP Server (33 tools, 6 verticals, 69 tests):

pip install moltrust
Enter fullscreen mode Exit fullscreen mode

Standards Used

MT Prediction implements W3C Decentralized Identifiers (DIDs) v1.0, W3C Verifiable Credentials Data Model v2.0, Ed25519 digital signatures, and the x402 payment protocol on Base L2 (USDC).

All credentials are verifiable by any W3C-compliant DID resolver — no dependency on MolTrust infrastructure.


Full developer guide: moltrust.ch/blog/prediction-market-developer-guide.html

API docs: api.moltrust.ch/docs

Follow @moltrust for updates.

Top comments (0)