Skip to content

Vishal4742/agentid-kya-solana

Repository files navigation

AgentID — Know Your Agent (KYA) Protocol

Devnet live · Tested and verified

Devnet Live Tests Audit License

AgentID is an open-source, on-chain identity and trust layer for AI agents on Solana. It enables autonomous agents to register verifiable identities (KYA — Know Your Agent), manage USDC treasuries, pay for services via the x402 payment protocol, and accumulate on-chain reputation scores.


✨ Features

Feature Status
🪪 On-chain agent identity (cNFT via Bubblegum) ✅ Implemented and tested
🔍 Agent verification & reputation scoring ✅ Implemented and tested
💰 USDC treasury with spending limits ✅ Implemented and tested
💸 Autonomous payments + x402 middleware ✅ Implemented in repo
🔔 Oracle webhooks (HMAC-secured, Helius) ✅ Implemented in repo
🌐 Metadata API (Vercel serverless) ✅ Live at agentid-kya-solana.vercel.app
🤖 ElizaOS plugin ✅ Implemented in packages/eliza-plugin
📦 TypeScript SDK ✅ Implemented in packages/sdk

🚀 Quick Start (5 minutes)

Prerequisites

1. Clone & install

git clone https://github.com/Vishal4742/agentid-kya-solana.git
cd agentid-kya-solana
cd frontend && npm install && cd ..
cd backend && yarn install && cd ..

2. Configure environment

cp backend/.env.example backend/.env
cp backend/api/.env.example backend/api/.env
cp backend/oracle/.env.example backend/oracle/.env
cp frontend/.env.example frontend/.env.local
# Edit each file and fill in your values

Run the deployment preflight before connecting Netlify, Vercel, and GitHub Actions:

node scripts/deployment-preflight.mjs

3. Register your first agent (devnet)

bash scripts/demo-devnet.sh

This script will:

  1. Check your wallet balance and Solana CLI config
  2. Derive your agent identity PDA from the program
  3. Check whether the config PDA and identity PDA exist on-chain
  4. Log the treasury PDA and spending limits from the program
  5. Fetch metadata from the Vercel metadata API

4. Run the frontend

cd frontend && npm run dev
# Open http://localhost:5173

🏗️ Architecture

graph TB
    subgraph Frontend["Frontend (Vite + React)"]
        UI["Dashboard / Register UI"]
        SDK["@agentid/sdk"]
    end

    subgraph Solana["Solana (Devnet)"]
        Program["agentid-program\nGv35ud..."]
        cNFT["cNFT Identity\n(Bubblegum)"]
        Treasury["USDC Treasury PDA"]
    end

    subgraph Backend["Backend (Node.js)"]
        Oracle["Oracle Service\n(HMAC-secured)"]
        MetaAPI["Metadata API\n(Vercel)"]
        X402["x402 Middleware\n(Redis replay guard)"]
    end

    subgraph Packages["Packages"]
        ElizaPlugin["eliza-plugin"]
        SDKPkg["sdk"]
    end

    UI --> SDK
    SDK --> Program
    Program --> cNFT
    Program --> Treasury
    Oracle -->|"updateReputation CPI"| Program
    MetaAPI -->|"reads"| Program
    X402 -->|"verifies payment"| Program
    ElizaPlugin --> SDK
    SDKPkg --> SDK
Loading

📁 Project Structure

agentid-kya-solana/
├── frontend/           # Vite + React + TypeScript UI
│   ├── src/
│   │   ├── pages/      # Dashboard, Register, AgentProfile
│   │   ├── components/ # Reusable UI components
│   │   ├── hooks/      # useAgents, useWallet, etc.
│   │   └── test/       # Vitest E2E + unit tests
├── backend/
│   ├── programs/       # Anchor / Rust program (12 instructions)
│   ├── tests/          # Anchor integration tests
│   ├── api/            # Metadata API (serverless)
│   ├── oracle/         # Oracle webhook service
│   └── x402/           # Payment middleware
├── packages/
│   ├── sdk/            # TypeScript SDK
│   └── eliza-plugin/   # ElizaOS plugin
└── scripts/            # Deploy, demo, and utility scripts

🧪 Running Tests

# Frontend (Vitest — 30 tests including devnet E2E)
cd frontend && npm test

# Anchor integration tests (local validator clones required devnet accounts)
cd backend && anchor test

# x402 middleware unit tests
cd backend/x402 && npm test

# x402 devnet integration (requires funded wallet)
cd backend/x402 && npm run test:integration

📖 Documentation

Doc Description
docs/overview/project.md Product overview, phase status, and verification checklist
docs/architecture.md Full technical architecture, PDA layout, data flows, and design decisions
docs/x402-architecture.md x402 payment middleware architecture and sequence diagrams
docs/security/audit.md Security audit summary and mitigations
docs/operations/deployment.md Step-by-step deployment guide
agent.md AI coding assistant guide (Codex / Claude Code)
CONTRIBUTING.md Contribution guidelines
SUPPORT.md Support and escalation paths

🛡️ Security

An internal security audit was completed on 2026-04-12. See docs/security/audit.md for findings and mitigations.

Report a vulnerability: Follow SECURITY.md. Do not disclose critical vulnerabilities publicly.


🌐 Live Endpoints

Service URL
Devnet Program Gv35udP7tnnVcNiCMLKYeyjx1rfkeos4e6cXsFGr4tcF
Metadata API https://agentid-kya-solana.vercel.app
Frontend (devnet) https://agentid.netlify.app

🤝 Contributing

See CONTRIBUTING.md. Follow Conventional Commits.


📄 License

MIT License. See LICENSE.

About

On-chain identity, reputation, treasury, and x402-gated API access for AI agents on Solana.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors