Decentralized Milestone-Based Escrow Platform on Stellar Blockchain
A production-ready escrow platform built on Stellar's Soroban smart contracts with IPFS decentralized storage, dual review system, and role-agnostic architecture for seamless freelance payments.
Production-hardened dApp with smart contract security, IPFS integration, dual feedback system, and comprehensive user validation.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND (React + TypeScript) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Wallet β β Milestone β β Profile β β
β β Selector β β Manager β β Dashboard β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β ββββββββββββββββββ΄βββββββββββββββββ β
β β β
β βββββββββββββ΄βββββββββββββ β
β β Stellar SDK + IPFS β β
β βββββββββββββ¬βββββββββββββ β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β β HTTPS/REST API + Soroban RPC
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β BACKEND (Node.js + Express) β
β ββββββββββββββββββββββ β ββββββββββββββββββββββ β
β β API Routes βββββββ β Business Logic β β
β β β’ /escrow β β β’ Contract Service β β
β β β’ /milestone β β β’ IPFS Service β β
β β β’ /feedback β β β’ Auth Middleware β β
β β β’ /profile β β β’ Role Auth β β
β β β’ /users β ββββββββββ¬ββββββββββββ β
β ββββββββββ¬ββββββββββββ β β
β β βββββββββββββββββββ΄βββββββββ β
β ββββββββββ΄ββββββββββββ β Supabase Service β β
β β Stellar Service ββββ (PostgreSQL + Adapter) β β
β β (Soroban RPC) β ββββββββββββββββββββββββββββ β
β ββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β SMART CONTRACTS (Soroban) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β EscrowContract β β
β β β’ create_milestone β Create escrow agreement β β
β β β’ fund_milestone β Lock XLM in contract β β
β β β’ submit_milestone β Freelancer submits work β β
β β β’ approve_milestone β Release payment β β
β β β’ get_milestone β Query milestone state β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β SUPABASE (PostgreSQL) β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
β β User β β Escrow β β Milestone β β
β β Feedback β β AgentLog β β TxLog β β
β ββββββββββββββ ββββββββββββββ ββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β IPFS (Pinata) β
β β’ Decentralized file storage β
β β’ Content addressing (CID) β
β β’ Permanent work submissions β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Live Demo Link
π Deployed Application: https://stellar-escrow-flow.vercel.app
π₯ Demo Video: Watch on YouTube
Smart Contract ID:
CBJNQEIZ2CGPI4TRGVGMGKA7UYWNMUB2WJ3JVXW4IFHVHOW3Y4KV6JWL
π Verify on Stellar Explorer
All users verified on Stellar Testnet with real transactions:
- GCUP...AI7L β Client & Freelancer β 5 projects β 209.98 XLM earned, 99.99 XLM spent β 5.0β
- GDYC...EYSL β Client & Freelancer β 5 projects β 99.99 XLM earned, 209.99 XLM spent β 5.0β
- GDYE...AYLO β Freelancer β 2 projects β 49.98 XLM earned β 5.0β
- GAF4...WBER β Client & Freelancer β 2 projects β 10.00 XLM earned, 40.00 XLM spent β 4.5β
- GCEH...NACY β Client β 1 project β 9.99 XLM spent
- GBAJ...G2LM β Client β 1 project β 10.00 XLM spent
Network Statistics:
- Total Active Users: 6
- Total Completed Projects: 16
- Total XLM Transacted: 370 XLM
- Average Rating: 4.9/5.0
- Dual Role Users: 3 (50%)
π View Complete User Feedback Documentation
Click to view all 12 screenshots

Modern landing page with active users and latest reviews

User profile with statistics and reputation

Active users with dynamic role computation

Milestone successfully created with XLM

Milestone successfully funded with XLM locked in contract

Three upload options: file, text, or existing CID

Freelancer submitting work with IPFS integration

Dual review system for mutual feedback

Public reviews displayed on landing page

Smart contract deployed on Stellar Testnet
π Smart Contract Security
- Trustless Escrow β Funds locked in Soroban smart contracts
- Milestone-Based Payments β Release funds incrementally as work progresses
- Automatic Fallback β Graceful degradation when contract unavailable
- On-Chain Verification β All transactions verifiable on Stellar Explorer
π¦ IPFS Integration
- Decentralized Storage β Work submissions stored permanently on IPFS
- Content Addressing β Immutable CID-based file identification
- Multiple Upload Options β File upload, text content, or existing CID
- Gateway Access β Easy viewing through Pinata gateway
- Metadata Storage β Filename, size, and URL tracked in database
π₯ Role-Agnostic Architecture
- Dual Roles β Users can be both clients and freelancers
- Dynamic Role Computation β Roles determined by transaction history
- Flexible Switching β Easy mode switching between buying and selling
- Unified Profile β Single profile for all activities
- No Static Roles β Roles computed from milestone activity
β Dual Review System
- Mutual Feedback β Both parties review each other after completion
- 5-Star Rating β Industry-standard rating system
- Public Reputation β Reviews displayed on profiles and landing page
- Fraud Prevention β One review per role per milestone
- Average Rating β Automatically calculated from all reviews
π¨ Modern User Experience
- Wallet Integration β Support for Freighter, xBull, and Lobstr wallets
- Real-Time Updates β Live status tracking and notifications
- Responsive Design β Works seamlessly on desktop and mobile
- Dark Mode β Eye-friendly interface with modern aesthetics
- Toast Notifications β User-friendly feedback for all actions
π Comprehensive Dashboard
- Activity Overview β All milestones in one place
- Earnings Tracking β Total earned and spent
- Completion Rates β Track your success metrics
- Rating Display β See your reputation score
- Mode Switching β Toggle between buying and selling views
- Node.js v18+
- npm or yarn
- Stellar wallet browser extension (Freighter, xBull, or Lobstr)
- Testnet XLM (Get free XLM)
git clone https://github.com/yourusername/stellar-escrow-flow.git
cd stellar-escrow-flow
# Frontend
npm install
# Backend
cd backend
npm install
cd ..Backend .env:
cp backend/.env.example backend/.env
# Edit backend/.env with your valuesRequired variables:
| Variable | Description | Default |
|---|---|---|
PORT |
Backend server port | 3001 |
STELLAR_NETWORK |
Stellar network | testnet |
STELLAR_HORIZON_URL |
Horizon API URL | https://horizon-testnet.stellar.org |
CONTRACT_ID |
Escrow contract ID | Pre-configured |
SUPABASE_URL |
Supabase project URL | Optional |
SUPABASE_SERVICE_ROLE_KEY |
Supabase service key | Optional |
PINATA_JWT |
Pinata IPFS JWT | Required for IPFS |
Frontend .env:
cp frontend/.env.example frontend/.envVITE_API_URL=http://localhost:3001
VITE_STELLAR_NETWORK=testnetRun the SQL schema in Supabase SQL Editor:
# Copy contents from backend/supabase-schema.sql
# Paste into Supabase SQL Editor
# Click "Run"See backend/DATABASE_SETUP.md for detailed instructions.
# Terminal 1: Frontend
npm run dev
# Terminal 2: Backend
cd backend
npm start- Frontend: http://localhost:8080
- Backend API: http://localhost:3001
- Health Check: http://localhost:3001/health
Located in contract/src/lib.rs
| Function | Description |
|---|---|
create_escrow(client, freelancer, milestones, deadline) |
Creates a new escrow agreement |
fund_milestone(escrow_id, milestone_index) |
Locks XLM in contract |
submit_milestone(escrow_id, milestone_index, proof) |
Freelancer submits work |
approve_milestone(escrow_id, milestone_index) |
Client approves & releases payment |
reject_milestone(escrow_id, milestone_index, reason) |
Client rejects for revision |
get_escrow(escrow_id) |
Query escrow state |
get_milestone(escrow_id, milestone_index) |
Query milestone details |
# Build
cd contract
cargo build --target wasm32-unknown-unknown --release
# Deploy (Stellar CLI required)
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/escrow_contract.wasm \
--source YOUR_SECRET_KEY \
--network testnet
# Initialize
stellar contract invoke \
--id CONTRACT_ID \
--source YOUR_SECRET_KEY \
--network testnet \
-- initialize \
--admin YOUR_PUBLIC_KEYcd contract
cargo testTest Coverage: 10+ passing tests including:
- Escrow creation and lifecycle
- Milestone funding and submission
- Payment release and rejection
- Authorization checks
- Deadline enforcement
| Method | Endpoint | Description |
|---|---|---|
POST |
/escrow/create |
Create new escrow with milestones |
GET |
/escrow/list |
List escrows (filtered by address & mode) |
GET |
/escrow/:id |
Get escrow details |
Example: Create Escrow
curl -X POST http://localhost:3001/escrow/create \
-H "Content-Type: application/json" \
-d '{
"clientWallet": "GABC...",
"freelancerWallet": "GDEF...",
"milestones": [
{
"description": "Design mockups",
"amount": 100,
"milestoneIndex": 0
}
],
"deadline": "2024-12-31T23:59:59Z"
}'| Method | Endpoint | Description |
|---|---|---|
POST |
/milestone/fund |
Fund milestone (lock XLM) |
POST |
/milestone/submit |
Submit work with IPFS data |
POST |
/milestone/approve |
Approve and release payment |
POST |
/milestone/complete-submission |
Complete submission after blockchain confirmation |
POST |
/milestone/complete-approval |
Complete approval after blockchain confirmation |
GET |
/milestone/:id |
Get milestone details |
Example: Submit Work
curl -X POST http://localhost:3001/milestone/submit \
-H "Content-Type: application/json" \
-d '{
"milestoneId": "uuid",
"freelancerWallet": "GDEF...",
"submissionCid": "Qm...",
"submissionUrl": "https://gateway.pinata.cloud/ipfs/Qm...",
"submissionFilename": "work.pdf",
"submissionSize": 1024000
}'| Method | Endpoint | Description |
|---|---|---|
POST |
/feedback/create |
Submit review after milestone completion |
GET |
/feedback/latest |
Get latest 10 reviews (landing page) |
GET |
/feedback/user/:walletAddress |
Get all reviews for a user |
GET |
/feedback/milestone/:id/:roleType |
Check if feedback exists |
Example: Submit Review
curl -X POST http://localhost:3001/feedback/create \
-H "Content-Type: application/json" \
-d '{
"milestoneId": "uuid",
"reviewerWallet": "GABC...",
"reviewedWallet": "GDEF...",
"rating": 5,
"comment": "Excellent work, delivered on time!",
"roleType": "CLIENT_REVIEW"
}'| Method | Endpoint | Description |
|---|---|---|
GET |
/profile/:walletAddress |
Get user profile with stats |
POST |
/profile/update |
Update user profile |
| Method | Endpoint | Description |
|---|---|---|
GET |
/users/active |
Get active users with computed roles |
GET |
/users/stats |
Get network-wide statistics |
| Method | Endpoint | Description |
|---|---|---|
POST |
/ipfs/upload |
Upload file to IPFS |
POST |
/ipfs/upload-text |
Upload text content to IPFS |
GET |
/ipfs/validate/:cid |
Validate IPFS CID |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Server health check |
Example Response:
{
"status": "healthy",
"timestamp": "2026-02-24T07:49:36.898Z",
"service": "stellar-milestone-escrow",
"network": "testnet",
"environment": "development"
}stellar-escrow-flow/
βββ contract/ # Soroban Smart Contract
β βββ src/
β β βββ lib.rs # Escrow contract logic
β βββ Cargo.toml
β βββ build.sh
β βββ deploy.sh
β
βββ backend/ # Node.js Backend Server
β βββ src/
β β βββ routes/ # API endpoints
β β β βββ escrow.js # Escrow management
β β β βββ milestone.js # Milestone operations
β β β βββ feedback.js # Review system
β β β βββ profile.js # User profiles
β β β βββ users-active.js # Active users stats
β β βββ services/ # Business logic
β β β βββ contract.js # Smart contract interaction
β β β βββ ipfs.js # IPFS operations
β β βββ middleware/ # Express middleware
β β β βββ auth.js # Authentication
β β β βββ role-auth.js # Role authorization
β β βββ config/ # Configuration
β β β βββ database.js # Supabase adapter
β β β βββ stellar.js # Stellar SDK config
β β β βββ prisma.js # Database client
β β βββ utils/ # Utilities
β β β βββ sanitize.js # Input sanitization
β β βββ server.js # Entry point
β βββ supabase-schema.sql # Database schema
β βββ DATABASE_SETUP.md # Setup guide
β βββ package.json
β βββ .env
β
βββ frontend/ # React Frontend Application
β βββ src/
β β βββ pages/ # Page components
β β β βββ Index.tsx # Landing page
β β β βββ Dashboard.tsx # User dashboard
β β β βββ CreateMilestone.tsx
β β β βββ MilestoneDetail.tsx
β β β βββ Profile.tsx
β β βββ components/ # Reusable components
β β β βββ Navbar.tsx
β β β βββ WalletSelector.tsx
β β β βββ IPFSUpload.tsx
β β β βββ ActiveUsers.tsx
β β β βββ OrbitReviews.tsx
β β β βββ EscrowCard.tsx
β β β βββ DeadlineCountdown.tsx
β β β βββ ui/ # shadcn/ui components
β β βββ contexts/ # React contexts
β β β βββ WalletContext.tsx
β β β βββ ModeContext.tsx
β β βββ lib/ # Utilities
β β β βββ api.ts # API client
β β β βββ stellar.ts # Stellar utilities
β β β βββ wallets.ts # Wallet integrations
β β β βββ utils.ts # Helper functions
β β βββ main.tsx # Entry point
β βββ public/
β βββ package.json
β βββ vite.config.ts
β
βββ docs/ # Documentation
β βββ API.md # API documentation
β βββ architecture.md # System architecture
β βββ DEPLOYMENT_GUIDE.md # Deployment instructions
β βββ screenshots/ # Application screenshots
β
βββ README.md # This file
βββ USER_FEEDBACK.md # User feedback documentation
βββ SUBMISSION_CHECKLIST.md # Blue Belt checklist
βββ LICENSE # MIT License
βββ .gitignore
- Total Files: 150+
- Lines of Code: 15,000+
- Smart Contract: 500+ lines (Rust)
- Backend: 3,000+ lines (JavaScript)
- Frontend: 8,000+ lines (TypeScript/React)
- Documentation: 3,500+ lines (Markdown)
- Tests: 20+ test cases
- Dependencies: 100+ packages
npm testTest Coverage: 10+ passing tests including:
- Campaign validation (5 tests)
- Wallet address validation (2 tests)
- Amount conversion (3 tests)
cd contract
cargo testUse Stellar Friendbot to fund test wallets:
curl "https://friendbot.stellar.org?addr=YOUR_WALLET_ADDRESS"| Issue | Solution |
|---|---|
| Transaction failed | Ensure Stellar Testnet + sufficient XLM balance |
| IPFS upload fails | Check PINATA_JWT in backend .env |
| Contract simulation error | System uses automatic fallback - work still submitted |
| Supabase errors | Set env vars or use in-memory fallback (default) |
| Build errors | Delete node_modules, run npm install, check Node v18+ |
| Wallet connection fails | Ensure wallet extension is installed and unlocked |
| "Route not found" errors | Verify backend is running on port 3001 |
| CORS errors | Check VITE_API_URL in frontend .env |
Enable debug logging:
Backend:
DEBUG=* npm startFrontend:
# Check browser console for detailed logs# Backend health
curl http://localhost:3001/health
# Check active users endpoint
curl http://localhost:3001/users/active
# Check feedback endpoint
curl http://localhost:3001/feedback/latestβ
Fund locking until approval
β
Authorization checks on all operations
β
Deadline enforcement
β
No reentrancy vulnerabilities
β
Immutable contract logic
β
Input validation and sanitization
β
Wallet address verification
β
Transaction hash confirmation
β
CORS configuration
β
Environment variable protection
β
Error handling and logging
β
No private key storage
β
Wallet signing for all transactions
β
HTTPS enforced in production
β
XSS protection (React built-in)
β
Content Security Policy
β
Content addressing (cryptographic hash)
β
Immutability (content cannot be changed)
β
Pinning (prevents deletion)
β
Multiple gateway options
-
Connect Repository
- Go to Vercel Dashboard
- Import your GitHub repository
- Select
frontendas root directory
-
Configure Build Settings
Build Command: npm run build Output Directory: dist Install Command: npm install Root Directory: frontend -
Set Environment Variables
VITE_API_URL=https://your-backend.onrender.com VITE_STELLAR_NETWORK=testnet -
Deploy
- Click "Deploy"
- Your app will be live at
https://your-app.vercel.app
-
Create Web Service
- Go to Render Dashboard
- Create new Web Service
- Connect your GitHub repository
- Select
backendas root directory
-
Configure Service
Build Command: npm install Start Command: npm start Root Directory: backend -
Set Environment Variables
STELLAR_NETWORK=testnet STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org CONTRACT_ID=your_contract_id SUPABASE_URL=your_supabase_url SUPABASE_SERVICE_ROLE_KEY=your_key PINATA_JWT=your_jwt PORT=3001 -
Deploy
- Click "Create Web Service"
- Your API will be live at
https://your-app.onrender.com
- Create project at Supabase
- Go to SQL Editor
- Run
backend/supabase-schema.sql - Copy connection details to backend
.env
For detailed deployment instructions, see docs/DEPLOYMENT_GUIDE.md
| Resource | Link |
|---|---|
| Live Demo | Vercel Deployment |
| GitHub | yourusername/stellar-escrow-flow |
| Contract Explorer | Stellar Expert |
| Stellar Docs | developers.stellar.org |
| Soroban Docs | soroban.stellar.org |
| Testnet Faucet | Stellar Laboratory |
| IPFS Gateway | Pinata Gateway |
| Supabase | supabase.com |
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation
- Ensure all tests pass
MIT License β feel free to use this project as a learning resource!
MIT License
Copyright (c) 2024 Stellar Escrow Flow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
See LICENSE file for details.
Built for Stellar Blue Belt Challenge
Special thanks to:
- Stellar Development Foundation for the amazing blockchain platform
- Soroban team for smart contract capabilities
- Supabase for the database platform
- Pinata for IPFS pinning service
- Vercel for frontend hosting
- Render for backend hosting
- shadcn/ui for beautiful UI components
- Tailwind CSS for styling
- The open-source community for incredible tools and libraries
- Beta testers for valuable feedback and suggestions
- Submission Date: February 2026
- Author: Samrat
- Level: Blue Belt (Level 5) π΅
- Status: β Ready
Built with β€οΈ for the Stellar Blue Belt Challenge

