Docs

VeriMatChain AI Docs

Technical reference for the verification pipeline, blockchain integration, and API endpoints.

Overview

VeriMatChain AI is a multimodal information integrity system that combines AI analysis with blockchain immutability. Every verification runs through a deterministic pipeline that produces a tamper-proof audit trail anchored on Solana Devnet.

Input
>
Hash
>
Fact-Check RAG
>
Claude AI
>
IPFS
>
Solana

Verification Pipeline

Each verification request goes through six sequential stages. Every stage is implemented as a LangGraph node with a single responsibility following the SRP principle.

1

Content ingestion

Raw text or URL is received. URLs are fetched and cleaned with BeautifulSoup, stripping scripts, nav, footer and ads.

utils/content_extractor.py

2

SHA-256 hashing

Content is normalized (lowercased, stripped) and hashed to produce a deterministic 64-char content fingerprint.

utils/hashing.py -> compute_content_hash()

3

Fact-Check RAG

Google Fact Check Tools API is queried with the first 300 chars of content to retrieve real-world claim ratings as context.

services/fact_check_service.py -> search_claims()

4

Claude analysis

Claude receives content plus fact-check evidence and returns structured JSON with risk score, bias indicators, missing sources, and explainability.

services/claude_service.py -> analyze_content()

5

IPFS pinning

Full evidence JSON is pinned to IPFS via Pinata with CID v1. Returns a content identifier that cannot be deleted by any third party.

services/pinata_service.py -> pin_verification_evidence()

6

Solana attestation

Anchor hash combining verification_id, risk_score, and ipfs_cid is anchored on-chain via a PDA account on Solana Devnet.

services/solana_service.py -> anchor_attestation()

API Reference

The backend exposes a REST API at http://localhost:8000. Full interactive docs are available at /docs.

POST/api/v1/verify/text

Analyze raw text content. Runs the full pipeline: hashing, Fact-Check RAG, Claude, IPFS, and Solana.

{
  "content": "string (20-50000 chars)",
  "include_fact_check": true,
  "language": "es"
}
POST/api/v1/verify/url

Fetch and analyze content from a URL. Optionally includes ElevenLabs audio classification.

{
  "url": "https://example.com/article",
  "include_fact_check": true,
  "include_audio_check": false
}
POST/api/v1/audio/classify

Submit an audio URL to ElevenLabs AI Speech Classifier. Returns TTS and voice cloning probability.

{
  "audio_url": "https://example.com/audio.mp3"
}
POST/api/v1/attestation/create

Anchor a verification result on-chain manually. Returns the Solana transaction signature and Devnet explorer URL.

{
  "verification_id": "string",
  "content_hash": "string (64 chars)",
  "risk_score": 0.72,
  "ipfs_cid": "string",
  "wallet_address": "string"
}
GET/api/v1/history/verifications

Returns all verifications stored in memory for the current session, ordered newest first.

GET/api/v1/history/stats

Returns aggregate stats: total verifications, high risk count, anchored count, and synthetic audio count.

Risk Levels

Claude assigns a risk score between 0.0 and 1.0 based on detected bias patterns, missing sources, and cross-referenced fact-check evidence. The score maps to four levels.

Low

0.0 - 0.29

Content appears reliable. Minor caveats may apply. Safe to share with appropriate context.

Medium

0.30 - 0.59

Potential biases detected. Verify primary sources independently before sharing.

High

0.60 - 0.79

Significant integrity issues. Missing sources, strong framing bias, or unverified claims.

Critical

0.80 - 1.0

Disinformation patterns detected. Content contradicts verified fact-check sources.

Blockchain Integration

Attestations are stored on-chain via a Solana Anchor program using Program Derived Addresses. Each attestation is seeded by the verification ID, making it deterministically retrievable without storing an index.

PDA seed derivation

seeds = [b"attestation", verification_id.encode("utf-8")[:32]]
pda, bump = Pubkey.find_program_address(seeds, program_id)

On-chain account fields

pub struct Attestation {
    pub verification_id: String,  // max 64 chars
    pub content_hash:    String,  // SHA-256 hex (64 chars)
    pub risk_score:      f64,     // 0.0 - 1.0
    pub ipfs_cid:        String,  // IPFS CID v1 (max 64 chars)
    pub wallet_address:  String,  // Solana pubkey (max 44 chars)
    pub authority:       Pubkey,  // backend agent wallet
    pub created_at:      i64,     // unix timestamp
    pub bump:            u8,      // PDA bump seed
}

Devnet explorer URL format

https://explorer.solana.com/tx/{signature}?cluster=devnet

Environment Variables

All secrets are loaded via pydantic-settings from the backend/.env file. None are exposed to the frontend.

ANTHROPIC_API_KEY

Anthropic Console API key for Claude analysis.

required
ELEVENLABS_API_KEY

ElevenLabs API key for the AI Speech Classifier endpoint.

required
PINATA_JWT

Pinata JWT bearer token used for pinJSONToIPFS requests.

required
PINATA_API_KEY

Pinata API key, used alongside the JWT for some endpoints.

required
PINATA_API_SECRET

Pinata API secret.

required
GOOGLE_FACT_CHECK_API_KEY

Google Cloud API key with the Fact Check Tools API enabled.

required
SOLANA_RPC_URL

Solana RPC endpoint. Defaults to https://api.devnet.solana.com.

optional
SOLANA_PROGRAM_ID

Deployed Anchor program public key on Solana Devnet.

required
AGENT_WALLET_PRIVATE_KEY

64-byte keypair array for the backend signing wallet. Must have SOL for transaction fees.

required
CORS_ORIGINS

Allowed origin for CORS. Defaults to http://localhost:3000.

optional

Tech Stack

The architecture follows a hybrid on-chain/off-chain model. Heavy AI processing runs off-chain while only the irreducible truth (hashes, certificates, verifier signatures) is stored on-chain to minimize transaction costs and latency.

Frontend

  • -Next.js 15 (App Router)
  • -React 19
  • -Tailwind CSS v3
  • -Solana Wallet Adapter
  • -Zod validation

Backend

  • -FastAPI + Uvicorn
  • -LangGraph orchestration
  • -Anthropic Claude
  • -ElevenLabs Classifier
  • -Pinata IPFS

Blockchain

  • -Solana Devnet
  • -Anchor framework
  • -Rust smart contract
  • -PDA attestations
  • -Solana Explorer