Certification Flow
Certification provides cryptographic proof that content has been verified and is trustworthy. Users can embed certificates in content, and readers can verify authenticity without trusting you—they trust the math.
Certification Process
Your Content ↓[Submit to TruthVouch] ↓[Fact-Check, Verify Citations] ↓[Generate Cryptographic Proof] ↓[Create Verifiable Badge/URL] ↓[Embed in Content] ↓User Reads → Scans Badge → Verifies AuthenticityCore Concepts
Truth Nugget: Individual claim or fact you want to certify Batch: Collection of nuggets submitted together Trust Score: Probability (0-100) that content is accurate Certificate: Signed proof valid for 1 year Badge: Shareable visual proof (HTML/QR code)
Step 1: Create a Batch
Organize content into batches for submission:
from truthvouch.certification import CertificationClient
client = CertificationClient(api_key="your-api-key")
# Create a new batchbatch = client.create_batch( title="March 2024 Market Analysis", description="Quarterly report on AI market trends", contact_email="reports@company.com")
print(f"Batch ID: {batch.id}")Step 2: Submit Content for Verification
Add truth nuggets to the batch:
# Add individual claimsbatch.add_nugget( claim="The global AI market was valued at $136.55 billion in 2022", source_url="https://www.grandviewresearch.com/press-release/global-artificial-intelligence-market", category="market_data")
batch.add_nugget( claim="AI adoption in enterprises increased by 71% year-over-year", source_url="https://www.mckinsey.com/capabilities/quantumblack/our-insights/ai-adoption-2023", category="adoption_trends")
# Or bulk import from CSVbatch.import_nuggets_from_csv("claims.csv")
# Submit for verificationbatch.submit()print(f"Submitted {batch.nugget_count} claims for verification")Step 3: Monitor Verification Progress
Check verification status:
import asyncioimport time
async def wait_for_certification(batch_id: str, timeout_seconds: int = 300): """Poll until certification completes."""
start_time = time.time() poll_interval = 5 # seconds
while True: batch = client.get_batch(batch_id)
print(f"Status: {batch.status}") print(f" Verified: {batch.verified_count}/{batch.nugget_count}") print(f" Confidence: {batch.average_confidence:.1%}")
if batch.status in ["certified", "rejected"]: return batch
if time.time() - start_time > timeout_seconds: raise TimeoutError(f"Certification did not complete within {timeout_seconds}s")
await asyncio.sleep(poll_interval)
# Wait for resultsbatch = asyncio.run(wait_for_certification(batch.id))
if batch.status == "certified": print(f"✓ Certified! Overall score: {batch.trust_score:.0f}/100")else: print(f"✗ Rejected. Review issues:") for issue in batch.issues: print(f" - {issue['claim']}: {issue['reason']}")Step 4: Generate Certificates
Once verified, generate cryptographic certificates:
# Get the certified batchbatch = client.get_batch(batch_id)
if batch.status != "certified": raise ValueError("Batch not certified yet")
# Generate certificatecert = batch.generate_certificate()
print(f"Certificate ID: {cert.id}")print(f"Valid until: {cert.expiry_date}")print(f"Signature: {cert.signature}")
# Generate shareable badgebadge_url = batch.get_badge_url( format="html", theme="light", size="medium")
print(f"Badge: {badge_url}")Step 5: Embed in Content
HTML Embedding
<article> <h1>AI Market Analysis 2024</h1> <p> The global AI market was valued at $136.55 billion in 2022. </p>
<!-- Embed verification badge --> <div id="truthvouch-cert-abc123"></div>
<script src="https://cdn.truthvouch.com/verify.js"></script> <script> TruthVouch.embed("truthvouch-cert-abc123", { certificateId: "cert_abc123", onVerified: (result) => { console.log("Content verified:", result.trustScore); } }); </script></article>React Component
import { TruthVouchBadge } from "@truthvouch/react";
export function ArticleWithCertification() { return ( <article> <h1>AI Market Analysis 2024</h1> <p> The global AI market was valued at $136.55 billion in 2022. </p>
<TruthVouchBadge certificateId="cert_abc123" theme="light" size="medium" onVerified={(result) => { console.log(`Verified with score: ${result.trustScore}`); }} /> </article> );}Markdown
# AI Market Analysis 2024
The global AI market was valued at $136.55 billion in 2022.
[Certified Badge](https://verify.truthvouch.com/cert_abc123)
### Citation- Source: Grand View Research- Verified: March 15, 2024- Certificate: cert_abc123Reader Verification Flow
When users encounter a badge, they can verify:
User Scans Badge / Clicks Link ↓[TruthVouch Verification Server] ↓[Check Signature Against Public Key] ↓[Verify Timestamp and Expiry] ↓[Display Trust Score and Sources] ↓[User Can Trust Content]Verification API
Readers don’t trust you—they trust the math:
# Reader-facing code: does NOT need API keyfrom truthvouch.verify import PublicVerificationClient
# Verify using certificate IDresult = PublicVerificationClient.verify_certificate( certificate_id="cert_abc123")
print(f"Content: {result.content_summary}")print(f"Trust Score: {result.trust_score}/100")print(f"Certified: {result.certified_date}")print(f"Valid Until: {result.expiry_date}")print(f"Sources: {result.sources}")Batch API Workflow
Python: Full End-to-End Example
from truthvouch.certification import CertificationClientimport asyncio
async def certify_market_report(): client = CertificationClient(api_key="your-api-key")
# 1. Create batch batch = client.create_batch( title="Q1 2024 Market Report", description="Verified market analysis", content_type="report" )
# 2. Add claims claims = [ ("AI market growing at 38% CAGR", "https://source1.com"), ("Enterprise AI adoption at 78%", "https://source2.com"), ("GenAI market expected to reach $1.3T by 2032", "https://source3.com") ]
for claim, source in claims: batch.add_nugget(claim=claim, source_url=source)
# 3. Submit batch.submit()
# 4. Wait for certification for attempt in range(60): # 5-minute timeout batch = client.get_batch(batch.id) if batch.status in ["certified", "rejected"]: break await asyncio.sleep(5)
# 5. Check results if batch.status == "rejected": print("Certification failed:") for issue in batch.issues: print(f" - {issue['claim']}: {issue['reason']}") return None
# 6. Generate certificate cert = batch.generate_certificate()
# 7. Generate badge for embedding badge = batch.get_badge_url(format="html")
return { "batch_id": batch.id, "certificate_id": cert.id, "trust_score": batch.trust_score, "badge_url": badge, "expiry_date": cert.expiry_date }
# Run the certificationresult = asyncio.run(certify_market_report())print(result)TypeScript: Embedding and Verification
import { CertificationClient, PublicVerificationClient } from "@truthvouch/sdk";
// Publisher: Create and embed certificateexport async function publishCertifiedContent() { const client = new CertificationClient({ apiKey: process.env.API_KEY });
// Create and certify const batch = await client.createBatch({ title: "Content Report", description: "Verified content", });
await batch.addNugget({ claim: "Sample claim", sourceUrl: "https://source.com" });
await batch.submit(); const certified = await batch.waitForCertification();
const certificate = await certified.generateCertificate(); const badgeUrl = await certified.getBadgeUrl({ format: "html" });
return { certificateId: certificate.id, badgeUrl, trustScore: certified.trustScore };}
// Reader: Verify without needing API keyexport async function verifyContent(certificateId: string) { const result = await PublicVerificationClient.verifyCertificate(certificateId);
return { content: result.contentSummary, trustScore: result.trustScore, certified: result.certifiedDate, sources: result.sources };}Batch Operations
Import Multiple Items from CSV
claim,source_url,category"AI market valued at $136.55B in 2022",https://grandviewresearch.com,market_data"Enterprise AI adoption increased 71% YoY",https://mckinsey.com,adoption"GenAI expected to reach $1.3T by 2032",https://marketsandmarkets.com,forecastbatch = client.create_batch(title="Market Data Q1 2024")batch.import_nuggets_from_csv("claims.csv")batch.submit()Cancel/Revoke Certification
batch = client.get_batch(batch_id)
# Before expiry, revoke if content becomes inaccuratebatch.revoke_certificate(reason="New information contradicts original claim")
# All badges will show as revoked# Readers see: "This content was revoked on [date] due to: [reason]"Best Practices
Quality Assurance
- Test verification on staging before production
- Get legal review before certifying sensitive claims
- Set appropriate expiry times (1-3 years)
- Archive source materials for audit trail
User Communication
- Explain what certification means to users
- Show certification date prominently
- Link to revocation policy
- Provide contact for disputes
Technical
- Use HTTPS for all embedding
- Validate certificate ID format client-side
- Implement fallback if verification server unreachable
- Cache verification results (5-min TTL)
Troubleshooting
Q: Certification rejected on high-confidence claims
- Review source URLs (must be accessible)
- Check for outdated information
- Verify claim wording matches sources exactly
- Submit individual claims instead of batches
Q: Badge not displaying in email
- Email clients strip JavaScript; use image badge instead
- Set
format="image"in badge URL - Test in email preview tools
Q: Readers see verification failures
- Check certificate hasn’t expired
- Verify certificate ID in badge URL
- Ensure reader has internet connectivity
- Check TruthVouch service status
Next Steps
- Review Embed Trust Badge for customization
- Explore Certification API for advanced options
- Check Trust Score to understand scoring