Skip to content

Repository files navigation

zkSentinel

An autonomous AI security agent for Web3 wallet protection that combines zero-knowledge proofs, AI-powered risk analysis, and onchain execution on X Layer.

Features

  • Zero-Knowledge Proofs: Private risk computation using Circom circuits and SnarkJS
  • AI-Powered Analysis: LLM-based risk analysis and action recommendations
  • Autonomous Execution: Onchain transaction execution via OKX Onchain OS plugin on X Layer
  • Continuous Protection Loop: Analyze → Prove (zk) → Decide → Act → Repeat

Tech Stack

  • Frontend: Next.js 14 (App Router), React 18, TypeScript, TailwindCSS
  • Web3: wagmi, viem, ethers
  • Zero-Knowledge: Circom, SnarkJS, circomlib
  • AI: OpenAI API
  • Execution: OKX Onchain OS SDK
  • Testing: Vitest, fast-check (property-based testing)

Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn/pnpm
  • MetaMask or compatible Web3 wallet
  • X Layer network access

Installation

  1. Clone the repository:
git clone https://github.com/sambitsargam/zkSentinel.git
cd zkSentinel
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables:
cp .env.example .env.local

Edit .env.local with your configuration:

  • X Layer RPC URL
  • OKX Onchain OS plugin credentials
  • OpenAI API key
  1. Run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Open http://localhost:3000 in your browser.

Development

Project Structure

zkSentinel/
├── app/                    # Next.js App Router
│   ├── layout.tsx         # Root layout
│   ├── page.tsx           # Main dashboard
│   ├── components/        # React components
│   ├── hooks/             # Custom React hooks
│   └── api/               # API routes
├── lib/                   # Core engine modules
│   ├── risk-engine.ts     # Zero-knowledge risk computation
│   ├── ai-agent.ts        # AI-powered analysis
│   └── execution-engine.ts # Onchain execution
├── circuits/              # Circom circuits
├── test/                  # Test files
└── public/                # Static assets

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npm run test - Run tests
  • npm run test:watch - Run tests in watch mode

Testing

zkSentinel uses property-based testing with fast-check to validate correctness properties:

npm run test

License

ISC

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

An autonomous AI security agent for Web3 wallet protection that combines zero-knowledge proofs, AI-powered risk analysis, and onchain execution on X Layer.

Quick Start

  1. Clone and Install

    npm install
  2. Configure Environment

    cp .env.example .env.local

    Edit .env.local and add:

  3. Run Development Server

    npm run dev

Project Structure

  • /circuits - Circom circuits for zk risk computation
  • /lib - Core engines (Risk, AI, Execution)
  • /app - Next.js frontend and API routes
  • /app/components - React UI components

Tech Stack

  • Frontend: Next.js 14, TailwindCSS, wagmi, ethers
  • Backend: Next.js API Routes
  • AI: OpenAI GPT-4 with function calling
  • zk: Circom + SnarkJS
  • Blockchain: X Layer (zkEVM)
  • Execution: OKX Onchain OS plugin

License

MIT zkSentinel is an autonomous AI agent that continuously monitors wallet risk and executes private, zero-knowledge-powered protective actions onchain.

About

zkSentinel is an autonomous AI agent that continuously monitors wallet risk and executes private, zero-knowledge-powered protective actions onchain.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages