An open API service indexing awesome lists of open source software.

https://github.com/dev-araujo/0g-insight


https://github.com/dev-araujo/0g-insight

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

          

# 0G Insight: AI-Powered Smart Contract Auditor

> **Empowering decentralized security with AI-driven audits and 0G's modular infrastructure.**

0G Insight is a modular, AI-native platform designed to provide instant, high-quality smart contract security audits. By combining advanced Large Language Models (LLMs) with 0G's decentralized storage and compute layers, we offer a scalable, transparent, and verifiable way to secure the Web3 ecosystem.

---

## πŸš€ Overview

**0G Insight** allows developers and users to analyze smart contracts by simply providing their on-chain address. The platform fetches the source code, performs a deep security analysis using AI, and stores the results on a decentralized registry.

### The Problem
Traditional smart contract audits are expensive, time-consuming, and often centralized. In the fast-moving world of DeFi and AI-native applications, developers need immediate feedback, and users need a way to verify the safety of the contracts they interact with.

### The Solution
0G Insight democratizes security by:
1. **Instant Analysis:** Leveraging Llama 3 models for comprehensive security reports.
2. **Decentralized Caching:** Using **0G Storage** to create a permanent, millisecond-retrievable registry of audited contracts.
3. **Verifiable Inference:** Integrating **0G Compute** to ensure the integrity of the AI-driven audit process.

---

## πŸ› οΈ 0G Integration

This project is built from the ground up to showcase the power of the 0G modular stack.

### πŸ—„οΈ 0G Storage (KV Layer)
We utilize the **0G Storage KV Layer** as a decentralized cache and registry.
- **Registry:** Every unique contract analysis is stored as a Key-Value pair, where the key is the hash of the network and address, and the value is the signed audit report.
- **Efficiency:** This prevents redundant AI processing and API costs for previously analyzed contracts, providing instant results for the community.

### πŸ–₯️ 0G Compute
0G Insight supports model inference through the **0G Compute Network**.
- **Execution:** Security analyses can be routed through 0G's decentralized GPU marketplace, ensuring that the computation is not dependent on centralized providers.
- **Future:** Moving towards "Sealed Inference" to protect proprietary audit logic and ensure the audit wasn't tampered with.

---

## ✨ Key Features

- **Multi-chain Support:** Analyze contracts across Ethereum, Base, Polygon, and more.
- **Security Reports:** Detailed JSON-formatted reports covering risk levels, red flags, and actionable suggestions.
- **High Performance:** Millisecond-level queries for cached audits via 0G KV nodes.
- **Clean UI:** Built with Next.js 15+, Shadcn UI, and Tailwind CSS for a modern, responsive experience.

---

## πŸ—ΊοΈ Roadmap & Future Vision

- **[ ] Bring Your Own Key (BYOK):** Allow users to select and add their own AI API keys (OpenAI, Anthropic, Groq, etc.) for personalized analysis.
- **[ ] 0G Persistent Memory:** Integrate long-context memory to "remember" previous vulnerabilities across different versions of the same contract.

---

## βš™οΈ Local Deployment

### Prerequisites
- Node.js 20+
- A 0G Testnet Private Key (for storage operations)
- API Keys for Etherscan and Groq (or 0G Compute)

### Setup
1. **Clone the repository:**
```bash
git clone https://github.com/your-repo/0g-insight.git
cd 0g-insight
```

2. **Install dependencies:**
```bash
npm install
```

3. **Environment Variables:**
Create a `.env.local` file:
```env
# 0G Configuration
PRIVATE_KEY=your_0g_testnet_private_key
NEXT_PUBLIC_0G_KV_NODE=https://kv-rpc-testnet.0g.ai
NEXT_PUBLIC_0G_STORAGE_INDEXER=https://indexer-storage-testnet-turbo.0g.ai

# AI Providers
GROQ_API_KEY=your_groq_key
ZERO_G_COMPUTE_API_KEY=your_0g_compute_key
ZERO_G_COMPUTE_BASE_URL=https://router-api.0g.ai/v1

# Network Explorers
ETHERSCAN_API_KEY=your_etherscan_key
```

4. **Run the development server:**
```bash
npm run dev
```

---

## πŸ”— 0G Integration Proof

- **0G Storage Contract (Flow):** `0x22E03a6A89B950F1c82ec5e74F8eCa321a105296`
- **0G Insight Registry Stream ID:** `0x960f4886616428751502422530132b9845353596702336336430346261313035` (keccak256 of "0g-insight-registry-v1")
- **Demo Video:** [Link to Video]
- **Public X Post:** [Link to X Post]

---

## πŸ“„ License
This project is licensed under the MIT License.