OAuth-equivalent for AI agent spending on ERC-7715 MetaMask Delegation Framework.
AI agents need money but:
- Giving private keys = security risk
- Manual top-ups = breaks automation
- No OAuth equivalent exists for blockchain
Solution: Delegata uses ERC-7715 to create scoped, revocable, on-chain-enforced permissions.
- Next.js 14 + RainbowKit + Tailwind CSS
- MetaMask wallet connection with ERC-7715 support
- Delegation creation UI with permission scoping
- Real-time delegation status and revocation
- Google Gemini API (gemini-1.5-flash) for AI reasoning
- 4 delegation management tools:
validate_delegation- Check if delegation is valid and within limitsexecute_permitted_swap- Perform swaps within delegation boundscreate_sub_delegation- Delegate to other agents with stricter limitsget_delegation_status- Query all active delegations
- Agentic loop with tool use and iterative reasoning
- Permission enforcement at every step
- ✅ Scoped permissions - Agent can't exceed spending caps (enforced on-chain)
- ✅ Revocable - Humans revoke delegations anytime via MetaMask
- ✅ Sub-delegatable - Agents can create agent hierarchies with decreasing permissions
- ✅ On-chain enforced - MetaMask smart contracts validate every transaction
- ✅ No private key sharing - Safer than hot wallets or CEX withdrawal APIs
git clone https://github.com/Ayomisco/Delegata.git
cd Delegata
# Install all dependencies
npm install
cd frontend && npm install
cd ../agent && npm install
cd ..# Copy template
cp .env.example .env
# Update .env with your credentials:
# GOOGLE_API_KEY=your_gemini_key (get from Google Cloud Console)
# SYNTHESIS_API_KEY=your_synthesis_key (from hackathon registration)
# SYNTHESIS_TEAM_ID=your_team_id# Terminal 1: Frontend
cd frontend && npm run dev
# Open http://localhost:3000
# Terminal 2: Agent
cd ../agent && npm run devcd frontend
vercel --prodNote the URL: https://delegata-xxx.vercel.app
# Ensure Railway CLI is installed
# Connect your GitHub repo to Railway
# Set environment variables in Railway dashboard
# Deploy automatically or:
railway upNote the URL: https://delegata-agent-xxx.railway.app
User connects MetaMask wallet
→ Creates delegation: "Agent X can spend $50 USDC/day for 7 days"
→ Signs with MetaMask (ERC-7715 framework)
→ Gets delegation ID stored on Base blockchain
Agent receives delegation ID
→ Calls validate_delegation tool
→ Checks: Is it valid? Am I within cap? Has it expired?
→ If valid: Can execute swaps, create sub-delegations
→ If invalid: Refuses and explains why
Agent submits transaction with delegation proof
→ MetaMask DelegationManager validates caveats
→ Permitted transactions succeed
→ Denied transactions revert (on-chain)
Human delegates $50/day to Agent A
→ Agent A sub-delegates $25/day to Agent B (stricter)
→ Agent B sub-delegates $10/day to Agent C (even stricter)
→ Creates chain: Human → Agent A → Agent B → Agent C
→ Each agent can revoke the next level anytime
| Layer | Tech |
|---|---|
| Frontend | Next.js 14, RainbowKit, wagmi, viem, Tailwind CSS |
| Agent | Google Gemini API, TypeScript, ts-node |
| Blockchain | MetaMask ERC-7715, Base (Ethereum L2) |
| Deployment | Vercel (frontend), Railway (agent) |
| Auth | MetaMask wallet signatures |
Delegata/
├── frontend/ # Next.js frontend (Vercel)
│ ├── app/ # Page components + layouts
│ ├── components/ # React components
│ ├── lib/ # Utilities (wagmi, viem setup)
│ ├── public/ # Static assets
│ └── package.json
│
├── agent/ # Gemini agent (Railway)
│ ├── delegataAgent.ts # Main agent + tools
│ ├── agent.ts # Helper exports
│ ├── Dockerfile # Container config
│ ├── registerOpenServ.ts # OpenServ registration
│ └── package.json
│
├── README.md # This file
├── DELEGATA_CLAUDE.md # Full technical specification
├── .env # Credentials (don't commit)
├── .env.example # Template (commit this)
├── .gitignore
├── railway.json # Railway deployment config
├── vercel.json # Vercel deployment config
├── SUBMIT.sh # Synthesis submission script
└── .git # GitHub version control
Get these from:
| Key | Source | Free Tier |
|---|---|---|
GOOGLE_API_KEY |
Google Cloud Console | Yes (generous) |
SYNTHESIS_API_KEY |
Synthesis Hack Dashboard | Yes (hackathon) |
SYNTHESIS_TEAM_ID |
Synthesis Hack registration email | Yes (hackathon) |
# 1. User connects wallet on frontend
open https://delegata-xxx.vercel.app
# 2. Create delegation: $50 USDC/day, 7 days
# (MetaMask pops up, user signs)
# 3. Agent validates it
curl https://delegata-agent-xxx.railway.app/validate?delegationId=...
# 4. Try to swap (should succeed)
# Spend $30 USDC → Success (within $50 cap)
# 5. Try to exceed limit (should fail)
# Spend $30 more ($60 total) → Fails (exceeds $50 cap)
# 6. Create sub-delegation to another agent
# Sub-agent gets $25/day cap (stricter than parent)
# 7. Revoke delegation anytime
# Click "revoke" on frontend → Agent can no longer spend./SUBMIT.sh <vercel_url> <loom_video> <github_url>Example:
./SUBMIT.sh \
https://delegata-ayomisco.vercel.app \
https://loom.com/share/abcd1234 \
https://github.com/Ayomisco/Delegata┌─────────────────────────────────────────────────────────────┐
│ Human (EOA Wallet) │
└─────────────────────────────────────────────────────────────┘
│
(creates + signs delegation)
│
┌─────────────────────────────────────────────────────────────┐
│ Frontend (Vercel) │
│ Next.js → RainbowKit → MetaMask ERC-7715 Signing │
│ Delegation ID stored on Base blockchain │
└─────────────────────────────────────────────────────────────┘
│
(delegation ID + request)
│
┌─────────────────────────────────────────────────────────────┐
│ Agent (Railway) │
│ Gemini AI → validate → execute (if valid) │
│ Tools: validate, swap, sub-delegate, status │
└─────────────────────────────────────────────────────────────┘
│
(submit transaction with proof)
│
┌─────────────────────────────────────────────────────────────┐
│ Base Blockchain │
│ MetaMask DelegationManager validates caveats │
│ Transaction succeeds or reverts on-chain │
└─────────────────────────────────────────────────────────────┘
Web2 has OAuth. Any app can request your permission to access resources.
Web3 has no OAuth equivalent for agent spending. Until now.
Delegata proves:
- AI agents can be given financial access safely
- Through cryptographic permission boundaries
- No private keys
- No trust needed
- Just verified permissions on-chain
This is the OAuth of blockchain.
| Component | Status |
|---|---|
| Frontend | ✅ Production-ready (Vercel) |
| Agent | ✅ Production-ready (Railway + Gemini) |
| ERC-7715 Integration | ✅ Working |
| Tools (4x) | ✅ Fully functional |
| Deployment | ✅ Automated |
| Documentation | ✅ Complete |
- Sub-delegations are 1-level deep in this MVP (can extend to N-levels)
- Delegation revocation takes ~1 block (Base blockchain)
- Gemini rate limits: 60 requests/min (sufficient for this demo)
- Multi-signature sub-delegations
- Custom caveat types (time-of-day, IP-based, etc)
- Gas abstraction layer
- Delegation marketplace
- Mobile agent apps
MIT - Built for Synthesis Hack 2026
- GitHub Issues: github.com/Ayomisco/Delegata/issues
- Docs: See DELEGATA_CLAUDE.md for full specification
- Email: ayomide@example.com
Ayomide Francis-Akinlolu (@ayomisco_s)
Built with:
- Claude Code by Anthropic (design phase)
- Google Gemini API (agent execution)
- MetaMask ERC-7715 (blockchain delegation)
Ready to launch! Let's win Synthesis Hack 2026.