Skip to content

0xValera/prooflearn

Repository files navigation

ProofLearn

A personalised AI tutor Mini App for the World ecosystem that verifies human learners and delivers adaptive lessons, feedback, and progress tracking.

Built for EthGlobal Cannes 2026 — World prize tracks.


Problem

Online learning is plagued by bots, duplicate accounts, and lack of accountability. AI tutoring tools have no way to verify that learners are real people, leading to abuse of free resources and meaningless progress tracking. There's no "one learner, one identity" guarantee.

Solution

ProofLearn is a Mini App inside World App that combines World ID 4.0 verification with an AI-powered adaptive tutor. Every learner proves they're a unique human before they can start learning, creating a trusted 1:1 relationship between person and learning profile.

Why World?

  • World ID 4.0 ensures one human = one learner identity with zero-knowledge proofs
  • MiniKit 2.0 provides native Mini App experience (walletAuth, haptics, share)
  • Mini App distribution reaches 23M+ World App users directly

World SDK Integrations

World ID 4.0 (@worldcoin/idkit v4.x)

  • IDKitRequestWidget with orbLegacy preset for human verification
  • RP signature generation via signRequest() from @worldcoin/idkit/signing
  • Backend verification against developer.world.org/api/v4/verify/{rp_id}
  • Nullifier-based one-human-one-learner enforcement
  • allow_legacy_proofs: true for backwards compatibility during migration

World ID 4.0 — Tiered Access

  • Orb verified: Unlimited lessons
  • Document verified: 20 lessons/day
  • Selfie verified: 5 lessons/day — verify with Orb for full access
  • Credential type extracted from IDKit response and stored per learner
  • Higher-tier re-verification upgrades access automatically

MiniKit 2.0 (@worldcoin/minikit-js v2.x)

  • MiniKitProvider wraps the entire app for SDK initialisation
  • MiniKit.isInstalled() detects World App environment
  • MiniKit.sendHapticFeedback() on lesson load, answer submission, correct/incorrect
  • MiniKit.shareContacts() invite friends from World App contacts
  • Web Share API for sharing progress (works in World App webview)

UI Kit

  • @worldcoin/mini-apps-ui-kit-react for native World App components

Features

AI Tutor

  • 3 subjects: Mathematics, Language Learning (English, French, Hungarian, Ukrainian, Spanish), Coding
  • 3 skill levels: Beginner, Intermediate, Advanced
  • Personalised micro-lessons with explanations and exercises
  • Multiple question types: open-ended, multiple choice, code
  • AI-powered answer evaluation with detailed feedback
  • Adaptive difficulty based on performance history
  • Confetti celebration on correct answers + milestone achievements

Quick Quiz

  • 5 multiple-choice questions, 60-second timer
  • All questions pre-generated in parallel (no loading between questions)
  • Instant answer feedback with auto-advance
  • Results screen with score, time, and answer review

AI Mentor Chat

  • Follow-up questions after each lesson for deeper understanding
  • General learning Q&A via dedicated Mentor tab
  • Strictly education-only — refuses off-topic questions

Leaderboard

  • Top 20 verified learners ranked by lessons completed
  • One person = one entry (World ID sybil resistance)
  • Shows credential badge, accuracy, and streak

Progress Dashboard

  • Completion count, accuracy rate, learning streak
  • Per-subject breakdown with visual progress bars
  • Strength and weakness identification
  • Recent lesson history with scores

Anti-Abuse

  • World ID nullifier-based deduplication
  • Tiered access based on credential strength
  • Server-side proof verification via v4 API
  • Rate limiting on all API endpoints
  • No sensitive data trusted from client

Architecture

┌─────────────────────────────────────────┐
│              World App                   │
│  ┌───────────────────────────────────┐  │
│  │         ProofLearn Mini App        │  │
│  │  ┌─────────┐  ┌──────────────┐   │  │
│  │  │  IDKit  │  │  MiniKit 2.0 │   │  │
│  │  │  4.0    │  │  WalletAuth  │   │  │
│  │  │ Verify  │  │  Haptics     │   │  │
│  │  └────┬────┘  └──────┬───────┘   │  │
│  └───────│──────────────│────────────┘  │
└──────────│──────────────│────────────────┘
           │              │
    ┌──────▼──────────────▼──────────┐
    │       Next.js API Routes        │
    │  /api/rp-signature              │
    │  /api/verify (→ v4 API)         │
    │  /api/tutor/* /api/learner      │
    ├─────────────┬──────────────────┤
    │  Session    │   Rate Limiter   │
    │  (JWT+DB)   │   (in-memory)    │
    ├─────────────┴──────────────────┤
    │         AI Tutor Service        │
    │          Claude API             │
    ├────────────────────────────────┤
    │      Prisma ORM + SQLite       │
    │   Learner │ Lesson │ Session   │
    └────────────────────────────────┘

Tech Stack

Layer Technology
Frontend Next.js 15, React 19, Tailwind CSS 4
Backend Next.js API Routes
Database Prisma ORM + SQLite
AI Anthropic Claude API
Verification World ID 4.0 (IDKit), RP signatures
Mini App MiniKit SDK 2.0 (provider, walletAuth, haptics)
Validation Zod
Testing Vitest

Getting Started

Prerequisites

Setup

  1. Clone and install:

    git clone https://github.com/valera-grinenko-ai/prooflearn.git
    cd prooflearn
    npm install
  2. Create your .env:

    cp .env.example .env
  3. Fill in your credentials:

    # From https://developer.world.org — create an app and copy these
    NEXT_PUBLIC_APP_ID=app_your_id
    NEXT_PUBLIC_RP_ID=rp_your_id
    RP_SIGNING_KEY=your_hex_signing_key
    
    # From https://console.anthropic.com
    ANTHROPIC_API_KEY=sk-ant-your_key
    
    # Generate with: openssl rand -hex 32
    SESSION_SECRET=your_random_secret_here
  4. Initialise the database and start:

    npx prisma db push
    npm run dev
  5. Open in World App — enter your dev URL in the Developer Portal (use ngrok or tunnelmole for HTTPS), scan the QR code with World App, and verify with your real World ID.

Seed data (optional)

npm run db:seed    # creates a learner with 5 completed lessons

Useful for testing the progress dashboard without completing lessons first.

Environment Variables

Variable Required What it does
NEXT_PUBLIC_APP_ID Yes World App ID (app_xxx) from Developer Portal
NEXT_PUBLIC_RP_ID Yes Relying Party ID (rp_xxx) from Developer Portal
RP_SIGNING_KEY Yes Hex signing key. Server-only — never expose client-side.
ANTHROPIC_API_KEY Yes Claude API key — powers all lesson generation and evaluation
DATABASE_URL Yes Default: file:./dev.db (SQLite). Swap to Postgres URL for prod.
SESSION_SECRET Yes JWT signing secret, 32+ chars. Generate with openssl rand -hex 32.
NEXT_PUBLIC_APP_URL No Default: http://localhost:3000. Used for share links.

API Endpoints

Method Path Description
GET /api/auth/nonce Generate SIWE nonce for walletAuth
POST /api/rp-signature Generate RP signature for IDKit 4.0
POST /api/verify Verify World ID proof via v4 API
GET /api/learner Get learner profile
PATCH /api/learner Update preferences
POST /api/tutor/lesson Generate a personalised lesson
POST /api/tutor/evaluate Evaluate an answer with AI feedback
POST /api/tutor/chat AI mentor chat
GET /api/progress Get progress stats and breakdown
POST /api/reset Reset learner progress

Testing

npm test           # run all tests
npm run test:watch # watch mode

Tests cover: verification logic, AI tutor (mocked Anthropic client), rate limiting, World ID 4.0 (RP signature generation).


Limitations

  • World ID: Real verification requires World App or Simulator. A skip button exists for local testing.
  • AI: Requires an Anthropic API key. No offline/mock mode.
  • Database: SQLite for local dev. Production should use PostgreSQL.

Future Work

  • On-chain credential storage for learning certificates
  • Spaced repetition algorithm for optimised review scheduling
  • Peer-to-peer study sessions between verified learners
  • MiniKit payments for premium content

License

MIT

Credits

Built with Claude AI assistance for EthGlobal Cannes 2026.

About

A personalised AI tutor Mini App for the World ecosystem with verified human learners

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors