A blockchain-powered recycling coordination system that uses Stellar micro-payments to incentivize real-world environmental action, connecting collectors, agents, and recycling companies in a transparent and scalable ecosystem.
EcoPlay is a 3-sided platform that sits between people who collect recyclable waste, agents who verify and aggregate it, and recycling companies who buy it. Instead of recycling being a thankless act, EcoPlay turns it into an income stream β every verified drop-off triggers an instant Stellar payment split between the collector and the agent, with a small platform fee retained.
This model works because Stellar transactions are:
- Near-instant (3β5 seconds)
- Extremely low cost (fractions of a cent)
- Transparent and auditable on-chain
Traditional banking cannot support this kind of high-frequency, low-value payout model. Stellar can.
Individuals who gather recyclable materials (plastic, metal, glass, paper, electronics) and bring them to a registered collection point. They earn a direct cut of the material's market value, paid instantly to their Stellar wallet.
Verified operators who run physical collection points. They weigh incoming materials, log submissions into the EcoPlay system, and earn a commission on every submission they process. Agents are the trust layer β only verified agents can create submissions.
Companies that purchase aggregated recyclable materials from the platform. Their bulk payments fund the reward pool that gets distributed to collectors and agents.
1. Collector brings recyclables to a collection point
2. Agent weighs the materials and logs a submission:
- Collector ID
- Material type (plastic / metal / glass / paper / electronics)
- Weight (kg)
- Optional proof photo
3. Backend calculates reward split based on:
- Material base price (per kg)
- Configured split percentages
4. Single Stellar transaction is built with 2 payment operations:
β 60% to collector's Stellar wallet
β 30% to agent's Stellar wallet
β 10% retained by platform wallet
5. Submission is marked Paid, collector and agent stats are updated
6. Collector sees earnings update in real time on their dashboard
| Recipient | Default Split |
|---|---|
| Collector | 60% |
| Agent | 30% |
| Platform | 10% |
Splits are configurable via environment variables. All percentages must sum to 100.
Material base prices (USD/kg):
| Material | Price/kg |
|---|---|
| Plastic | $0.15 |
| Metal | $0.45 |
| Glass | $0.08 |
| Paper | $0.06 |
| Electronics | $1.20 |
Example: Agent logs 10kg of metal for a collector.
- Total value: 10 Γ $0.45 = $4.50
- Collector receives: $2.70
- Agent receives: $1.35
- Platform retains: $0.45
Engagement is sustained through a lightweight gamification system built on top of the economic core:
- Leaderboards β top collectors ranked by total earnings and weight recycled
- Weekly challenges β bonus rewards for hitting weight targets
- Badges β Eco Hero, Top Agent, First Drop-off, and more
- Progress tracking β lifetime stats visible on every collector's profile
Gamification is secondary. The economic incentive is the primary driver.
Fraud prevention is built into the system architecture:
- Only verified agents can log submissions β collectors cannot self-report
- Every submission, payment, and status change is recorded with a full audit trail
- Optional proof photo upload per submission
- All Stellar transactions are publicly verifiable on-chain
- Future: GPS tagging of collection points, AI-assisted weight verification
| Layer | Technology |
|---|---|
| Backend | Rust (Axum, SQLx, Tokio) |
| Database | PostgreSQL |
| Payments | Stellar (Horizon REST API) |
| Collector App | Next.js 14, Tailwind CSS |
| Agent Dashboard | Next.js 14, Tailwind CSS |
| Auth | JWT (bcrypt + jsonwebtoken) |
| Infrastructure | Docker Compose |
EcoPlay/
β
βββ backend/ # Rust API server
β βββ Cargo.toml # Dependencies: axum, sqlx, tokio, bcrypt, jwt, reqwest
β βββ src/
β βββ main.rs # Entry point β boots Axum server, connects DB
β βββ config/
β β βββ mod.rs # Typed config loaded from environment variables
β βββ errors/
β β βββ mod.rs # AppError enum β HTTP response mapping
β βββ models/
β β βββ mod.rs
β β βββ user.rs # User struct (collector) β maps to users table
β β βββ agent.rs # Agent struct β maps to agents table
β β βββ submission.rs # Submission struct + MaterialType + SubmissionStatus enums
β β βββ transaction.rs # Transaction struct + TransactionType enum
β βββ db/
β β βββ mod.rs # create_pool() β PgPool
β β βββ migrations/
β β β βββ 001_create_users.sql
β β β βββ 002_create_agents.sql
β β β βββ 003_create_submissions.sql
β β β βββ 004_create_transactions.sql
β β βββ queries/
β β βββ mod.rs
β β βββ users.rs # find_by_id, find_by_email, insert, increment_stats, update_wallet
β β βββ agents.rs # find_by_id, find_by_email, insert, increment_commission
β β βββ submissions.rs # insert, find_by_id, find_by_collector, find_by_agent, update_status
β β βββ transactions.rs # insert, find_by_submission
β β βββ leaderboard.rs # top_collectors(limit) ORDER BY total_earned DESC
β βββ services/
β β βββ mod.rs
β β βββ auth/
β β β βββ mod.rs # register_collector, login_collector, login_agent β JWT
β β βββ rewards/
β β β βββ mod.rs # calculate(material, weight_kg) β RewardSplit
β β βββ payments/
β β β βββ mod.rs # send_payouts(recipients) β builds + submits Stellar tx
β β βββ submissions/
β β β βββ mod.rs # create() β full orchestration: validate β calculate β pay β record
β β βββ leaderboard/
β β βββ mod.rs # top_collectors(limit) β Vec<LeaderboardEntry>
β βββ stellar/
β β βββ mod.rs # Low-level Horizon HTTP client: load_account, build_tx, submit_tx
β βββ api/
β βββ mod.rs # router() β mounts all route groups under /api/v1
β βββ middleware/
β β βββ mod.rs # JWT extractor β injects Claims { sub, email, role }
β βββ routes/
β β βββ mod.rs # All route definitions with method + path + handler mapping
β βββ handlers/
β βββ mod.rs
β βββ auth.rs # POST /auth/register, /auth/login, /auth/agent/login
β βββ users.rs # GET /users/me, PATCH /users/me/wallet
β βββ submissions.rs # POST /submissions, GET /submissions, GET /submissions/my
β βββ leaderboard.rs # GET /leaderboard
β βββ payments.rs # GET /payments/history
β
βββ apps/
β β
β βββ web/ # Collector-facing app (port 3000)
β β βββ package.json
β β βββ next.config.ts
β β βββ tsconfig.json
β β βββ tailwind.config.ts
β β βββ postcss.config.js
β β βββ .env.local
β β βββ src/
β β βββ app/
β β β βββ layout.tsx # Root layout β fonts, providers, global styles
β β β βββ page.tsx # Landing / redirect to dashboard or login
β β β βββ globals.css
β β β βββ auth/
β β β β βββ login/page.tsx
β β β β βββ register/page.tsx
β β β βββ dashboard/
β β β β βββ layout.tsx # Dashboard shell with Navbar
β β β β βββ page.tsx # Earnings summary, recent submissions
β β β βββ leaderboard/
β β β β βββ page.tsx # Top collectors ranked by earnings
β β β βββ profile/
β β β βββ page.tsx # Wallet linking, lifetime stats, badges
β β βββ components/
β β β βββ ui/
β β β β βββ Button.tsx
β β β β βββ Card.tsx
β β β β βββ Badge.tsx
β β β β βββ Input.tsx
β β β β βββ Spinner.tsx
β β β βββ shared/
β β β β βββ Navbar.tsx
β β β β βββ Layout.tsx
β β β β βββ ProtectedRoute.tsx
β β β βββ forms/
β β β βββ LoginForm.tsx
β β β βββ RegisterForm.tsx
β β βββ lib/
β β β βββ api/
β β β β βββ client.ts # Axios instance with base URL + auth header injection
β β β β βββ auth.ts # register(), login()
β β β β βββ submissions.ts # getMySubmissions()
β β β β βββ leaderboard.ts # getLeaderboard()
β β β β βββ users.ts # getMe(), linkWallet()
β β β βββ stellar/
β β β β βββ wallet.ts # Stellar wallet helpers (keypair generation, validation)
β β β βββ utils/
β β β βββ format.ts # Currency, weight, date formatters
β β βββ hooks/
β β β βββ useAuth.ts # Login, register, logout, current user
β β β βββ useSubmissions.ts # Fetch collector's submission history
β β β βββ useLeaderboard.ts # Fetch leaderboard data
β β β βββ useProfile.ts # Fetch + update profile, link wallet
β β βββ store/
β β β βββ authStore.ts # Zustand β stores JWT token + user object
β β βββ types/
β β βββ index.ts # Re-exports all types
β β βββ api.ts # User, Submission, Transaction, LeaderboardEntry types
β β
β βββ agent-dashboard/ # Agent-facing app (port 3001)
β βββ package.json
β βββ next.config.ts
β βββ tsconfig.json
β βββ tailwind.config.ts
β βββ postcss.config.js
β βββ .env.local
β βββ src/
β βββ app/
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Redirect to dashboard or login
β β βββ globals.css
β β βββ auth/
β β β βββ login/page.tsx
β β βββ dashboard/
β β β βββ layout.tsx # Dashboard shell with Navbar
β β β βββ page.tsx # Stats: total submissions, total commission earned
β β βββ submissions/
β β β βββ page.tsx # List of agent's submissions
β β β βββ new/page.tsx # New submission form (weigh + assign to collector)
β β βββ history/
β β βββ page.tsx # Full submission history with filters
β βββ components/
β β βββ ui/
β β β βββ Button.tsx
β β β βββ Card.tsx
β β β βββ Input.tsx
β β β βββ Badge.tsx
β β β βββ Spinner.tsx
β β βββ shared/
β β β βββ Navbar.tsx
β β β βββ Layout.tsx
β β β βββ ProtectedRoute.tsx
β β βββ forms/
β β βββ SubmissionForm.tsx # Core form: collector ID, material, weight, photo
β β βββ LoginForm.tsx
β βββ lib/
β β βββ api/
β β β βββ client.ts # Axios instance
β β β βββ auth.ts # agentLogin()
β β β βββ submissions.ts # createSubmission(), getAgentSubmissions()
β β βββ utils/
β β βββ format.ts # Formatters
β βββ hooks/
β β βββ useAuth.ts # Agent login, logout, session
β β βββ useSubmissions.ts # Create + fetch submissions
β βββ store/
β β βββ authStore.ts # Zustand β agent JWT + agent object
β βββ types/
β βββ index.ts
β βββ api.ts # Agent, Submission, Transaction types
β
βββ infrastructure/
β βββ docker/
β β βββ docker-compose.yml # Full local stack: postgres + backend + web + agent-dashboard
β β βββ Dockerfile.backend # Multi-stage Rust build β minimal debian image
β β βββ Dockerfile.web # Next.js build β production image
β βββ nginx/ # Reverse proxy config for production
β βββ scripts/ # DB seed scripts, deploy helpers
β
βββ docs/
β βββ api/ # API endpoint documentation
β βββ architecture/ # System design diagrams
β βββ flows/ # End-to-end flow diagrams
β
βββ .env.example # All required environment variables documented
βββ .gitignore
βββ README.md
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/v1/auth/register |
β | Register a new collector |
| POST | /api/v1/auth/login |
β | Collector login β JWT |
| POST | /api/v1/auth/agent/login |
β | Agent login β JWT |
| GET | /api/v1/users/me |
JWT | Get current collector profile |
| PATCH | /api/v1/users/me/wallet |
JWT | Link Stellar wallet |
| POST | /api/v1/submissions |
JWT (agent) | Log a new submission + trigger payout |
| GET | /api/v1/submissions |
JWT (agent) | Agent's own submission history |
| GET | /api/v1/submissions/my |
JWT (collector) | Collector's own submission history |
| GET | /api/v1/leaderboard |
β | Top collectors by earnings |
| GET | /api/v1/payments/history |
JWT | Payment transaction history |
users β collectors registered on the platform agents β verified collection point operators submissions β every material drop-off event, linked to a collector and agent transactions β every Stellar payment attempt, success or failure, linked to a submission
# 1. Copy and fill environment variables
cp .env.example .env
# 2. Start Postgres
docker compose -f infrastructure/docker/docker-compose.yml up postgres -d
# 3. Run the Rust backend
cd backend && cargo run
# 4. Run the collector app
cd apps/web && npm install && npm run dev
# 5. Run the agent dashboard
cd apps/agent-dashboard && npm install && npm run dev- Project structure
- Rust backend β auth, submissions, rewards, Stellar payouts
- Collector app β register, dashboard, leaderboard, profile
- Agent dashboard β submission form, history
- Docker Compose full stack
Revenue sources:
- 10% platform fee on every submission payout
- Future: recycling company partnership fees, NGO grants, sponsor integrations
Why this is fundable:
- Directly addresses waste management in underserved regions
- Creates income for low-income collectors
- Fully transparent payment trail on Stellar blockchain
- Measurable environmental impact (kg recycled, COβ offset)