Decentralized Underwriting Protocol for AI Agent Identities
KYA Protocol issues Bonded Identities for AI Agents using ERC-6551 Token Bound Accounts. Each agent license is an NFT that controls its own smart contract wallet, making agent identity a transferable asset.
The KYA Protocol enables AI agents to build verifiable reputation while providing merchants with economic security through an insurance layer. The protocol is production-ready for demonstration and testnet deployment.
- ✅ All Phases Complete - Core contracts, SDK, and documentation ready
- ✅ 95% Test Pass Rate - 127/134 tests passing
- ✅ Security Review Complete - 0 critical issues
- ✅ Deployment Ready - All scripts and tools prepared
- ✅ SDK Complete - Full JavaScript/TypeScript SDK available
- AgentLicense.sol: ERC-721 NFT representing agent licenses
- AgentRegistry.sol: Factory contract that creates agents (NFT + TBA atomically)
- SimpleAccountImplementation.sol: ERC-6551 Token Bound Account implementation
- ReputationScore.sol: Reputation scoring and badge system
- InsuranceVault.sol: Staking and slashing mechanism for economic security
- Paymaster.sol: ERC-4337 gas sponsorship for new agents
- MerchantSDK.sol: Merchant verification and integration contract
- Integration Adapters: ZKAdapter, OracleAdapter for external service integration
- User calls
AgentRegistry.mintAgent(name, description, category) - Registry mints an NFT (AgentLicense) to the user
- Registry creates a Token Bound Account (TBA) for that NFT via ERC-6551
- User owns the NFT, which controls the TBA wallet
- User can fund the TBA and execute transactions through it
- Transferring the NFT transfers ownership of the TBA automatically
- Agents can build reputation through ZK proofs and stake for insurance
- Merchants can verify agents and submit claims for violations
curl -L https://foundry.paradigm.xyz | bash
foundryup# Clone the repository
git clone https://github.com/RahilBhavan/KYA.git
cd KYA
# Install dependencies
forge install OpenZeppelin/openzeppelin-contracts
forge install erc6551/reference
forge install foundry-rs/forge-std
# Copy environment variables
cp .env.example .env
# Edit .env with your configuration
# Build contracts
forge build
# Run tests
forge test
# Run tests with coverage
forge coverage# Run all tests
forge test
# Run tests with gas reporting
forge test --gas-report
# Run tests with verbosity
forge test -vvv
# Run specific test file
forge test --match-path test/unit/AgentLicense.t.sol
# Run fuzz tests
forge test --fuzz-runs 10000# Deploy to Base Sepolia testnet
forge script script/DeployBaseSepolia.s.sol \
--rpc-url $BASE_SEPOLIA_RPC_URL \
--broadcast \
--verify \
--etherscan-api-key $BASESCAN_API_KEY
# Deploy to Base mainnet
forge script script/DeployBase.s.sol \
--rpc-url $BASE_RPC_URL \
--broadcast \
--verify \
--etherscan-api-key $BASESCAN_API_KEY- Comprehensive Learning Guide - Complete educational resource - Learn architecture, code, use cases, and best practices
- Project Status - Complete project status and phase completion
- Production Readiness - Production readiness checklist
- Deployment Guide - Complete deployment instructions
- Developer Guide - Integration guide for developers
- Phase 1 Complete - Testing & Quality Assurance
- Phase 2 SDK Complete - External Integrations & SDK
- Phase 3 Complete - Security Audit
- Phase 4 Complete - Testnet Deployment
- API Reference - Smart contract API documentation
- Security Documentation - Security features and considerations
- Testing Guide - Testing strategies and best practices
- Monitoring Guide - Production monitoring setup
- Troubleshooting - Common issues and solutions
- Multi-sig Setup - Multi-signature wallet administration
- Monitoring Setup - Production monitoring and alerting
- Community Setup - Community launch and onboarding
- Production Features Plan - Comprehensive implementation plan
- JavaScript SDK - SDK usage and examples
This protocol has completed internal security review and is ready for demonstration. For production deployment, external security audit is recommended.
- ✅ Reentrancy Protection - ReentrancyGuard on all external functions
- ✅ Access Control - Role-based permissions (Admin, ZK Prover, Oracle)
- ✅ Safe Token Transfers - SafeERC20 for all transfers
- ✅ Input Validation - Comprehensive validation on all inputs
- ✅ Emergency Controls - Pausable contracts
- ✅ Proof Replay Prevention - Proof tracking prevents replay
- ✅ Economic Security - Stake requirements, fee caps, slashing limits
- Critical Issues: 0 ✅
- High Issues: 0 ✅
- Medium Issues: 0 ✅
- Low Issues: 1
⚠️ (edge case, non-blocking)
- Phase 1 - Testing & Quality Assurance (93% test pass rate)
- Phase 2 - External Integrations & SDK (Complete SDK implementation)
- Phase 3 - Security Audit (Internal review complete)
- Phase 4 - Testnet Deployment (Ready for deployment)
- External security audit (recommended for production)
- Real external service integration testing
- Testnet deployment and validation
- Mainnet deployment
- Community launch
See PROJECT_STATUS.md for detailed status and future updates.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
MIT License - see LICENSE file for details
- Twitter: @KYAProtocol
- Discord: KYA Community
- Email: team@kya.protocol
Status: ✅ Production Ready (Demo)
Version: 1.0.0
Last Updated: 2026-01-06