Skip to content

Laegend14/FactChecker

Repository files navigation

GenLayer AI Proof 🛡️

An AI-powered subjective decision and fact-checking decentralized application (dApp) built on the GenLayer blockchain. This project demonstrates the power of Intelligent Contracts—smart contracts that can leverage Large Language Models (LLMs) to perform non-deterministic, subjective reasoning directly on-chain.

🌟 Overview

Traditional blockchains are limited to deterministic computation. GenLayer enables "Optimistic Democracy," where a network of AI-powered validators can reach consensus on subjective claims.

GenLayer AI Proof allows users to submit any factual or subjective claim. The network's AI validators then:

  1. Analyze the claim independently.
  2. Provide a verdict: TRUE, FALSE, or UNDETERMINED.
  3. Give detailed reasoning for their decision.
  4. Scale consensus via the Equivalence Principle to ensure security.

✨ Features

  • Intelligent Verification: Submit claims to the blockchain for AI-backed consensus.
  • Truth Ledger: A permanent, on-chain registry of verified claims and their analysis.
  • Multi-Validator Consensus: Uses GenVM's run_nondet_unsafe for robust AI decision-making.
  • Frosted Glass UI: A modern, glassmorphic interface built with React, Tailwind CSS, and Framer Motion.
  • LLM Resilience: Handles non-deterministic LLM variance through intelligent result normalization.

🛠️ Tech Stack

  • Blockchain: GenLayer (GenVM)
  • Smart Contract: Python (GenVM execution environment)
  • Frontend: React + TypeScript
  • Styling: Tailwind CSS
  • Animations: Framer Motion (motion/react)
  • Icons: Lucide React
  • Client Library: genlayer-js

📄 Project Structure

├── contracts/
│   └── FactChecker.py      # GenLayer Intelligent Contract (Python)
├── src/
│   ├── App.tsx             # Main React Application
│   ├── lib/
│   │   └── genlayer.ts     # GenLayer client configuration
├── metadata.json           # Applet metadata
└── README.md

🚀 Getting Started

Prerequisites

Installation

  1. Install dependencies:

    npm install
  2. Run the development server:

    npm run dev

Deployment

  1. Deploy Contract:

    • Open GenLayer Studio.
    • Upload /contracts/FactChecker.py.
    • Deploy the contract to your preferred network (e.g., Studionet).
    • Copy the resulting Contract Address.
  2. Configure App:

    • Open the app in your browser.
    • Paste the Contract Address into the input field in the header.
    • Set the RPC Endpoint (defaults to GenLayer Studionet).

🧠 Smart Contract Logic

The FactChecker contract uses the gl.nondet.exec_prompt method to call an LLM. It defines a validator_fn that ensures the majority of validators agree on the factual verdict (TRUE/FALSE) rather than the exact wording of the reasoning, allowing for the natural variance of AI models while preserving the integrity of the result.

📝 License

This project is licensed under the Apache-2.0 License.

About

Genlayer powered Fact checker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors