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.
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.
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
SHA-256 hashing
Content is normalized (lowercased, stripped) and hashed to produce a deterministic 64-char content fingerprint.
utils/hashing.py -> compute_content_hash()
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()
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()
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()
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.
/api/v1/verify/textAnalyze 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"
}/api/v1/verify/urlFetch and analyze content from a URL. Optionally includes ElevenLabs audio classification.
{
"url": "https://example.com/article",
"include_fact_check": true,
"include_audio_check": false
}/api/v1/audio/classifySubmit an audio URL to ElevenLabs AI Speech Classifier. Returns TTS and voice cloning probability.
{
"audio_url": "https://example.com/audio.mp3"
}/api/v1/attestation/createAnchor 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"
}/api/v1/history/verificationsReturns all verifications stored in memory for the current session, ordered newest first.
/api/v1/history/statsReturns 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=devnetEnvironment Variables
All secrets are loaded via pydantic-settings from the backend/.env file. None are exposed to the frontend.
ANTHROPIC_API_KEYAnthropic Console API key for Claude analysis.
requiredELEVENLABS_API_KEYElevenLabs API key for the AI Speech Classifier endpoint.
requiredPINATA_JWTPinata JWT bearer token used for pinJSONToIPFS requests.
requiredPINATA_API_KEYPinata API key, used alongside the JWT for some endpoints.
requiredPINATA_API_SECRETPinata API secret.
requiredGOOGLE_FACT_CHECK_API_KEYGoogle Cloud API key with the Fact Check Tools API enabled.
requiredSOLANA_RPC_URLSolana RPC endpoint. Defaults to https://api.devnet.solana.com.
optionalSOLANA_PROGRAM_IDDeployed Anchor program public key on Solana Devnet.
requiredAGENT_WALLET_PRIVATE_KEY64-byte keypair array for the backend signing wallet. Must have SOL for transaction fees.
requiredCORS_ORIGINSAllowed origin for CORS. Defaults to http://localhost:3000.
optionalTech 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