Skip to content

Latest commit

 

History

History

README.md

Gnothi Documentation

AI-Oracle Powered Prediction Markets on GenLayer

Welcome to the Gnothi documentation. This guide covers everything from basic concepts to advanced deployment.


📚 Documentation Index

Getting Started

Document Description
Introduction What is Gnothi, the oracle problem, and how AI consensus solves it
Architecture Overview System design, component diagrams, and data flow
Core Components Smart contracts, bridge service, and frontend details

Deep Dives

Document Description
NEWS Market Flow Complete end-to-end walkthrough of market resolution
SCEM Payout Mechanism Mathematical foundation of fair payout distribution
AI Console Real-time validator transparency feature

Operations

Document Description
Deployment Guide Step-by-step deployment instructions
API Reference Complete bridge service HTTP API documentation
Troubleshooting Common issues and solutions

🚀 Quick Start

For Developers

# 1. Clone repository
git clone https://github.com/enliven17/gnothi.git
cd gnothi

# 2. Install dependencies
cd contracts && npm install
cd ../frontend && npm install
cd ../bridge/service && npm install

# 3. Configure environment
# See ./07-deployment.md for detailed setup

# 4. Start development
cd contracts && npm run compile
cd ../frontend && npm run dev
cd ../bridge/service && npm run dev

For Users

  1. Connect Wallet: Navigate to the app and connect your wallet
  2. Browse Markets: Explore active prediction markets
  3. Place Bets: Bet on outcomes with confidence levels (1-99%)
  4. Watch Resolution: Track AI validators resolving markets in real-time
  5. Claim Winnings: Receive SCEM-weighted payouts

🎯 Key Concepts

What is Gnothi?

Gnothi is a cross-chain prediction market protocol that uses AI consensus to resolve real-world events.

How It Works

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   Create     │────▶│    Trade     │────▶│   Resolve    │
│   Market     │     │   Bets       │     │  with AI     │
└──────────────┘     └──────────────┘     └──────────────┘
     │                    │                    │
     ▼                    ▼                    ▼
 Base Sepolia        Base Sepolia     GenLayer + Bridge
 (EVM)               (EVM)            (AI Consensus)

Core Innovations

  1. AI Oracle Resolution: 5 LLM agents reach consensus via Optimistic Democracy
  2. Cross-Chain Architecture: Base ↔ GenLayer communication via LayerZero
  3. SCEM-Weighted Payouts: Mathematically optimal incentive mechanism
  4. AI Transparency Console: Real-time visibility into validator decisions

📖 Reading Guide

First-Time Users

Start here:

  1. Introduction - Understand what Gnothi is
  2. NEWS Market Flow - See how a market works
  3. AI Console - Learn about the transparency feature

Developers

Start here:

  1. Architecture Overview - System design
  2. Core Components - Contract and service details
  3. Deployment Guide - Deploy your own instance

Integrators

Start here:

  1. API Reference - HTTP API documentation
  2. Core Components - Contract interfaces
  3. SDK Usage - TypeScript client examples

🏗️ System Architecture

High-Level Overview

┌─────────────────────────────────────────────────────────────────┐
│                        GNOTHI ECOSYSTEM                         │
└─────────────────────────────────────────────────────────────────┘

┌──────────────────────┐         ┌──────────────────────┐
│   BASE SEPOLIA       │         │   GENLAYER           │
│   (Trading Layer)    │         │   (Resolution Layer) │
│                      │         │                      │
│  • BetFactoryCOFI    │         │  • NewsOracle.py     │
│  • BetCOFI           │◄───────▶│  • AI Consensus      │
│  • SCEM Scoring      │  LZ V2  │  • Validator Network │
│  • USDC Payments     │         │  • Web Scraping      │
└──────────────────────┘         └──────────────────────┘
         │                               │
         └───────────┬───────────────────┘
                     │
         ┌───────────▼───────────┐
         │   Bridge Service      │
         │   (Node.js Relay)     │
         │   • Event Polling     │
         │   • Oracle Deployment │
         │   • HTTP API          │
         └───────────────────────┘
                     │
         ┌───────────▼───────────┐
         │   Frontend (Next.js)  │
         │   • Market UI         │
         │   • AI Console        │
         │   • Wallet Integration│
         └───────────────────────┘

Technology Stack

Layer Technology Purpose
Smart Contracts Solidity 0.8.22 EVM logic (Base Sepolia)
AI Oracle Python (GenLayer) Market resolution
Cross-Chain LayerZero V2 Base ↔ GenLayer messaging
Frontend Next.js 15 + TypeScript User interface
Scoring SCEM Library Fair payout calculation
Bridge Node.js + Express Event relay + HTTP API

🎓 Learning Resources

Videos

Tutorials

Examples


🔗 External Links


📊 Market Status

Network Status Contracts
Base Sepolia ✅ Active View
GenLayer Bradbury ✅ Active View
Base Mainnet 🔜 Coming Soon -

🤝 Contributing

We welcome contributions! See our Contributing Guide for details.

Quick Links


📜 License

MIT License - see LICENSE for details.


📞 Support


📝 Document Changelog

Date Version Changes
2025-04-01 1.0.0 Initial documentation release
2025-04-01 1.0.1 Added troubleshooting guide

Last Updated: April 1, 2026