Seoul Bowl Hackathon 2025 | Track: Autonomous Finance & FinTech
An autonomous financial agent for group expense management built with AI + Web3. Aegis Pay acts as a decentralized treasurer that automates fund collection, expense verification, and settlement using SpoonOS and Neo N3 blockchain.
Traditional bill-splitting apps only calculate debt - they don't collect money or execute payments. Aegis Pay automates the entire flow:
- Platform-Independent Links: Share a vault link through any messenger (KakaoTalk, Discord, Slack, WhatsApp)
- Auto-Deduction: When participants accept, funds are automatically deposited to escrow smart contract
- AI-Powered Verification: Upload receipt β GPT-4o Vision extracts total amount
- HITL Approval: 60-second countdown for participants to reject expenses (auto-approve on timeout)
- Autonomous Settlement: Agent calculates optimal payouts and executes blockchain transfers
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 1: Directives (What to do) β
β - Natural language SOPs in directives/ β
β - Define goals, inputs, outputs for each workflow β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 2: Orchestration (Decision making) β
β - SpoonOS SCDF graph-based workflows β
β - ReAct agent pattern β
β - HITL interrupts for approval flows β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 3: Execution (Deterministic) β
β - Python scripts (execution/) β
β - Neo N3 smart contracts (contracts/) β
β - Express.js backend (backend/) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Agentic Runtime: SpoonOS (SCDF framework)
- AI: GPT-4o Vision (OCR only)
- Blockchain: Neo N3 TestNet (smart contracts)
- Backend: Express.js + Prisma + MySQL
- Frontend: Next.js 14 + Tailwind CSS
- State: MCP+ (Model Context Protocol)
- Docker & Docker Compose
- Node.js 18+
- Python 3.10+
- Neo N3 wallet with TestNet GAS
git clone <repo-url>
cd aegis-pay
# Run automated setup
chmod +x scripts/setup.sh
./scripts/setup.shThis will:
- Start MySQL via Docker
- Install backend dependencies
- Run Prisma migrations
cd backend
npm run devBackend API runs on http://localhost:4000
cd contracts
# Compile contract
neo3-boa compile vault.py
# Deploy to Neo N3 TestNet (see contracts/README.md)
# Update backend/.env with contract hashcd agent # If agent folder exists
python -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
pip install -r requirements.txt
python main.py # Start agent servercd frontend # If frontend folder exists
npm install
npm run devFrontend runs on http://localhost:3000
aegis-pay/
βββ backend/ # Express.js API + Prisma
β βββ src/
β β βββ server.js # Entry point
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ lib/ # Utilities
β βββ prisma/
β β βββ schema.prisma
β βββ package.json
β
βββ contracts/ # Neo N3 smart contracts
β βββ vault.py # Main escrow contract
β βββ README.md
β
βββ directives/ # Agent SOPs (Layer 1)
β βββ vault_creation.md
β βββ ocr_receipt.md
β βββ hitl_approval.md
β βββ settlement.md
β
βββ execution/ # Deterministic scripts (Layer 3)
β βββ ocr_extract.py
β βββ calculate_split.py
β βββ neo_deploy.py
β βββ neo_transfer.py
β
βββ src/ # Frontend components
β βββ components/
β βββ lib/
β βββ styles/
β
βββ docs/ # Documentation
β βββ PRD.md
β βββ ARCHITECTURE.md
β βββ SMART_CONTRACT.md
β βββ SPOONOS_WORKFLOW.md
β
βββ scripts/
β βββ setup.sh # Quick setup script
β
βββ docker-compose.yml # MySQL container
βββ CLAUDE.md # Agent instructions
βββ README.md # This file
cd backend
# Development with hot reload
npm run dev
# Database management
npm run prisma:studio # Visual DB editor
npm run prisma:migrate # Create new migration
# Testing
curl http://localhost:4000/healthcd contracts
# Compile
neo3-boa compile vault.py
# Deploy to TestNet
# See contracts/README.md for deployment options
# Test
python test_vault.pycd frontend
# Development server
npm run dev
# Build for production
npm run build
# Type checking
npm run type-checkGET /health
POST /api/vaults # Create vault
GET /api/vaults/:id # Get vault details
POST /api/vaults/:id/join # Join vault
POST /api/vaults/:id/expenses # Upload expense receipt
POST /api/vaults/:id/close # Close vault and settle
cd backend
curl -X POST http://localhost:4000/api/vaults \
-H "Content-Type: application/json" \
-d '{
"name": "Test Vault",
"target_participants": 3,
"amount_per_person": 10,
"created_by": "NQtest123..."
}'cd contracts
python test_vault.py
# Or use neo-express
neoxp contract invoke <hash> create_vault [params...]See backend/prisma/schema.prisma for full schema. Key models:
- Vault: Main vault entity
- Participant: Users who joined vault
- Expense: Receipt uploads with OCR data
- Transaction: Blockchain transaction records
DATABASE_URL="mysql://user:pass@localhost:3306/aegis_pay"
NEO_RPC_URL="https://testnet1.neo.org:20331"
VAULT_CONTRACT_HASH="0x..."
FRONTEND_URL="http://localhost:3000"OPENAI_API_KEY="sk-..."
NEO_PRIVATE_KEY="..."
DATABASE_URL="..."- Backend API with MySQL
- Neo N3 smart contract (create, join, settle)
- Frontend vault creation UI
- Shareable link generation
- Receipt OCR with GPT-4o Vision
- HITL approval flow
- Automated settlement
- SpoonOS agent integration
- WebSocket real-time updates
- Email notifications
- Receipt search with BeVec
- Mobile app
- Multi-vault management
- Mainnet deployment
- Advanced analytics
- PRD - Product Requirements
- Architecture - System Design
- Smart Contracts - Contract Specs
- SpoonOS Workflows - Agent Implementation
- UI Components - Frontend Design
- API Conventions - API Standards
# Check if container is running
docker ps
# View logs
docker logs aegis-pay-mysql
# Restart
docker-compose restart mysql# Regenerate client
cd backend
npm run prisma:generate
# Reset database (β οΈ deletes all data)
npx prisma migrate reset# Check TestNet GAS balance
# Get more from: https://neowish.ngd.network/
# Verify RPC endpoint
curl https://testnet1.neo.org:20331- MVP First: Ship working demo, polish later
- 3-Layer Separation: Directives β Orchestration β Execution
- Self-Annealing: When errors occur, fix + document + strengthen system
- Platform Independence: Work across any messenger via links
- HITL by Default: Human approval required, auto-timeout as fallback
This is a hackathon project. Contributions welcome after Seoul Bowl 2025!
MIT
Aegis Pay Team - Seoul Bowl Hackathon 2025
Built with: SpoonOS | Neo N3 | GPT-4o | Next.js | Express.js
Hackathon Deadline: December 21, 2025, 23:59 KST