ZenTropy is a provably-fair gaming and rewards platform in the Zenpower ecosystem. It combines Bitcoin Satori rewards, educational content (Learn to Earn), social collaboration (Collaborate to Earn), and responsible gaming through an AI companion.
Current Status: PostgreSQL Integration Complete
Updated: 2025-12-05
| Component |
Status |
Tests |
Notes |
| Domain Layer |
✅ Complete |
300+ |
Entities, value objects, services |
| Application Layer |
✅ Complete |
50+ |
Commands, queries, handlers |
| API Routes |
✅ Complete |
215 endpoints |
18 routers |
| PostgreSQL Ledger |
✅ Complete |
38 |
ACID transactions, double-entry |
| Total Tests |
440 passing |
|
|
Implementation Summary
Core Features Implemented
| Feature |
Domain |
Routes |
Description |
| Dual-Coin Economy |
✅ |
✅ |
ZEN$ (stablecoin) + ZENCOIN (21M cap) |
| PoWTS Activities |
✅ |
✅ |
Provably fair 4-phase lifecycle |
| Ethical Guardrails |
✅ |
✅ |
Spending/session/loss limits |
| AI Companion |
✅ |
✅ |
Pattern detection, guidance |
| Educational (L2E) |
✅ |
✅ |
Learning paths, quizzes, XP |
| Social (C2E) |
✅ |
✅ |
Friends, guilds, mentorship |
API Endpoints (215 total)
| Router |
Prefix |
Count |
Purpose |
| zendollar |
/zendollar |
15 |
ZEN$ stablecoin |
| zencoin |
/zencoin |
23 |
ZENCOIN token |
| games |
/games |
6 |
Game sessions |
| players |
/players |
10 |
Profiles & limits |
| proofs |
/proofs |
6 |
Provably fair |
| mining |
/mining |
20 |
PoWTS activities |
| lessons |
/learn |
8 |
Educational |
| social |
/social |
19 |
Friends/guilds |
| companion |
/companion |
10 |
AI guidance |
| + 9 more |
|
98 |
Economy, trading |
Remaining Work
Phase 2: Database Integration (COMPLETE)
| Task |
Status |
Notes |
| PostgreSQL repository implementations |
✅ Complete |
postgres.py |
| Alembic migrations |
✅ Complete |
002_ledger_tables.py |
| Session management |
✅ Complete |
SQLAlchemy async sessions |
| Transaction boundaries |
✅ Complete |
Optimistic locking |
Phase 3: Blockchain Integration (Q3 2026)
| Task |
Priority |
Dependency |
| Satori RPC client |
P1 |
Bitcoin fork online |
| On-chain settlement |
P1 |
Satori client |
| ZENCOIN emission sync |
P2 |
Settlement |
Phase 4: Production Readiness
| Task |
Priority |
Dependency |
| TLS certificates |
P0 |
Domain routing |
| Rate limiting |
P0 |
None |
| Monitoring integration |
P1 |
Prometheus/Grafana |
| Incident runbooks |
P1 |
Ops team |
Domains & Routing
- Primary:
zentropy.${DOMAIN} for web surface
- API: Subpaths proxied through existing API service
- Vanity: Optional routes under
zenpower.at/zentropy/*
Traefik configuration in infra/docker-compose*.yml with dedicated routers, middlewares, and TLS.
Infrastructure Components
Service Image
- Location:
apps/zentropy/
- Pattern: Shares base with
mindset-explorer
- Stack: FastAPI + SQLAlchemy + Pydantic
Worker Queue
- Namespace:
zentropy:*
- Backend: Redis RQ (existing infrastructure)
- Tasks: Quest payouts, emission scheduling
Monitoring
- Extend
tools/status/surface_smoke.py with Zentropy endpoints
- Add to
quick_validation.sh for CI/CD
- Background job probes via worker health checks
Safety Gates
Pre-Launch Checklist
Secrets Configuration
Configure in ops/secrets/manifest.json:
- RNG salts
- Payout webhooks
- Oracle API keys
Responsible Gaming
- Ops runbooks for responsible gaming notices
- Support contacts documented
- Vault rotation cadence defined
Feature Flags
Toggle via ops/modules.yml and config/settings.py:
zentropy:
# Core (enable first)
guardrails_enabled: true
companion_enabled: true
# Gaming (enable after routes verified)
games_enabled: true
mining_enabled: true
# Extended features
educational_enabled: true
social_enabled: true
# Advanced (enable last)
pattern_detection_enabled: true
Timeline
Completed
- Sprint 1-2: Foundation (persistence, auth, feature flags)
- Sprint 3-4: Core systems (guardrails, player/games)
- Sprint 5: Educational & Social layers
- Sprint 6: AI Companion & code unification
- API Routes: All 215 endpoints implemented
Remaining
- Sprint 7: PostgreSQL integration
- Sprint 8: Satori blockchain integration
- Sprint 9: Production hardening
- Sprint 10: Closed alpha with internal wallets
Related Documentation