Ask for any Lagos route in Yoruba, Igbo, Hausa, Pidgin, or English — answered from route data the community maintains and earns for maintaining.
Lagos runs on informal danfo minibuses — no official map, no reliable fare data. Danfo fixes the data problem with real economic weight:
- Stake — a rider or driver submits a route/fare correction, staking a small amount via the danfo-registry Soroban contract.
- Attest — peers approve or reject it during a 24-hour challenge window.
- Settle — accepted corrections refund the stake; spam is slashed into the reward pool.
- Earn — accepted corrections claim a reward from the sponsor-funded pool. With NGNC (Stellar's naira stablecoin) and SEP-24, rewards can become naira in a Nigerian bank account.
The AI agent is the demand side: a voice-and-text assistant that answers routing questions grounded in this community-verified knowledge base — in five languages, with Nigerian-accented speech.
"Mo fẹ lọ si Oshodi lati CMS" → the best danfo route, where to change, and a fare estimate, in Yoruba.
User ──► apps/web (Next.js)
│ chat: KB-grounded inference (any OpenAI-compatible endpoint)
│ corrections feed: reads via indexer, falls back to chain
│ writes: Freighter signs → Soroban RPC (never through the indexer)
│
├──► indexer/ (Node + SQLite) — syncs chain state, REST feed,
│ finalize/claim crank
│
└──► Soroban contracts (danfo-contracts repo)
danfo-registry: submit (staked) → attest → finalize
danfo-rewards: sponsor pool → claim per accepted correction
This monorepo holds the application layer; the contracts live in danfo-contracts.
| Workspace | What it is |
|---|---|
apps/web |
Next.js app — multilingual chat, voice, route map, corrections feed, Freighter wallet, fare payments |
packages/sdk |
@danfo/sdk — typed clients for both contracts (reads, XDR builders, submit helpers) |
indexer/ |
Chain-state poller, finalize/claim crank, REST API (SQLite) |
services/speech |
Optional FastAPI service: YarnGPT2 TTS + Whisper STT for Nigerian languages |
Prereqs: Node 18+ (Node 20 recommended), a funded Stellar testnet account
(friendbot), and the deployed contract ids
from danfo-contracts/scripts/deploy.sh.
npm install
cp apps/web/.env.example apps/web/.env.local # fill in contract ids + inference endpoint
npm run dev # web app on :3000
# optional but recommended — feed + crank:
REGISTRY_CONTRACT=C... REWARDS_CONTRACT=C... INDEXER_SECRET_KEY=S... npm run dev:indexerOpen http://localhost:3000, tap the ⭐ button for the corrections feed, the mic to talk.
Testnet software, unaudited contracts. See SECURITY.md.
Issues are labeled by area (web, sdk, indexer, speech) and complexity.
Start with CONTRIBUTING.md. Conventional commits, one
logical change per PR, CI must be green.
Route data and fares are community-maintained and approximate. Corrections welcome — that's the whole point.