Decentralized micro-credit infrastructure for AI agents using off-chain state channels, reputation scoring, and instant USDC settlements.
# Terminal 1: Start Backend
cd packages/backend && npm install && npm run dev
# Terminal 2: Start Frontend
cd packages/frontend && npm install && npm run dev
# Open browser
# Desktop: http://localhost:3000
# Mobile: http://your-ip:3000Then follow DEMO_WALKTHROUGH.md for complete flow (~5 min)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SoftSettle Platform β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Frontend (Next.js + RainbowKit) Backend (Express) β
β ββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββ β
β β Dashboard β β REST API β β
β β ββ Agent Registration β β ββ /register-agent β β
β β ββ Session Monitor β β ββ /init-session β β
β β ββ Micro-Auth Flow β β ββ /micro-auth β β
β β ββ Payout Modal β β ββ /close-session β β
β β ββ Integration Status β β ββ /integrations β β
β ββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββ β
β β¬οΈ β¬οΈ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Smart Contracts (Sepolia) ββ
β β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β β ReputationManagerβ β SoftSettleChannel β β
β β β ββ Score Updates β β (Nitrolite State Channel) β β
β β β ββ ENS Text Recordsβ β ββ Collateral Lock β β
β β ββββββββββββββββββββ β ββ Session Management β β
β β Updates: β ββ Fund Release β β
β β vnd.soft-settle β ββ Deficit Tracking β β
β β .score β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Partner Integrations (4οΈβ£ 3οΈβ£ 5οΈβ£) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β π¨ YELLOW NETWORK
β ββ Nitrolite Protocol β
β ββ State Channels β
β ββ Off-chain Micro-Tx β
β β
β π΅ CIRCLE/ARC β
β ββ USDC Payouts β
β ββ Wallet Management β
β ββ Deficit Handling β
β β
β π£ ENS β
β ββ Reputation Scoring β
β ββ Text Records β
β ββ Credit Management β
β
βββββββββββββββββββββββββββββββββββ
User Flow On-Chain Events Off-Chain State
1. Register Agent βββββββββ (ENS Record Created)
β
Wallet Connected
β
Agent ID assigned
β
Initial score: 500
2. Create Session βββββββββ (Collateral Locked)
β
Session ID generated (SoftSettleChannel)
β
$50 collateral held
β
Nitrolite channel ready
3. Open Nitrolite ββββββββ (Channel Initialized)
β
Yellow SDK active [Off-chain ready]
4. Micro-Auth (x4) βββββββ β
Balance updates
β
Sign EIP-712 [State tracking]
β
Verify signature [No gas cost]
β
Update balance [100ms/tx]
5. Close & Settle ββββββββ (Settlement Finalized)
β
Final state committed (SoftSettleChannel)
β
Calculate deficit (Circle ready)
β
Update reputation (ENS text record)
(ReputationManager)
Report Dashboard Updated
ββ Total transferred: $20 β
Score: 500 β 520
ββ Deficit: $0 β
Deals completed: 1
ββ Status: Successful β
Reputation: Rising
soft_settle/
βββ packages/
β βββ frontend/ # Next.js dashboard
β β βββ pages/
β β β βββ index.tsx # Landing page
β β β βββ dashboard.tsx # Main demo interface
β β β βββ register.tsx # Agent registration
β β β βββ monitor.tsx # Session monitor
β β βββ components/ # Reusable UI components
β β
β βββ backend/ # Express.js server
β β βββ src/
β β βββ index.ts # Main API server (8 endpoints)
β β βββ integrations/
β β βββ circle.ts # Circle API wrapper
β β βββ ens.ts # ENS resolver
β β βββ ipfs.ts # Logging (optional)
β β
β βββ contracts/ # Solidity smart contracts
β βββ contracts/
β β βββ SoftSettleChannel.sol # State channel
β β βββ ReputationManager.sol # ENS reputation
β β βββ NitroliteCore.sol # Base protocol
β βββ scripts/
β βββ deploy.ts # Sepolia deployment
β
βββ DEMO_WALKTHROUGH.md # Step-by-step demo (NEW)
βββ README.md # This file
| Component | Network | Status | Address |
|---|---|---|---|
| ReputationManager | Sepolia | β Deployed | 0x7C81049B93bc487a1ff4f3B00f98d3A990f84FBa |
| SoftSettleChannel | Sepolia | β Deployed | 0xB3A0E90884340019fFaA90e8Eb971E71396113e1 |
| Frontend | Localhost | β Running | http://localhost:3000 |
| Backend API | Localhost | β Running | http://localhost:4000 |
- Node.js 18+
- MetaMask or wallet (for frontend)
- Sepolia testnet tokens (optional; demo uses mock data)
- Start backend:
cd packages/backend && npm run dev - Start frontend:
cd packages/frontend && npm run dev - Open http://localhost:3000
- Follow DEMO_WALKTHROUGH.md
# Register agent
curl -X POST http://localhost:4000/api/register-agent \
-H "Content-Type: application/json" \
-d '{"agentId":"agent1","walletAddress":"0x123"}'
# Check integrations
curl http://localhost:4000/api/integrations
# Create session
curl -X POST http://localhost:4000/api/init-session \
-H "Content-Type: application/json" \
-d '{"consumerId":"agent1","providerId":"agent2","collateralAmount":50}'| Endpoint | Method | Purpose | Track |
|---|---|---|---|
/api/register-agent |
POST | Register agent + ENS | ENS |
/api/query-reputation/:id |
GET | Fetch credit score | ENS |
/api/init-session |
POST | Create session (collateral lock) | Yellow |
/api/yellow/open-channel |
POST | Open Nitrolite channel | Yellow |
/api/micro-auth |
POST | Off-chain payment signature | Yellow |
/api/close-session |
POST | Settle + trigger payout | Circle |
/api/monitor-session/:id |
GET | Live session tracking | - |
/api/integrations |
GET | Integration status | All |
MIT