# dira-api
**The Dira Africa backend**
The Fastify REST API that verifies climate data, anchors it on Hedera, mints Climate Token rewards, and settles redemptions to mobile money, airtime, and vouchers.
---
## Overview
`dira-api` is the backend for the Dira Africa platform — a decentralized climate-data verification network for African smallholder agriculture. It handles authentication, data ingestion, AI crop verification, atmospheric triangulation, Hedera anchoring, the Climate Token economy, the circular-economy redemption rails, and the B2B verification API used by insurance partners.
All blockchain activity runs here, server-side, under Dira-controlled Hedera accounts — a **custodial** model, so farmers using the `dira-core` Mini App never handle keys.
## How it works
```
Submission → Verify (AI + triangulation) → Anchor (Hedera HCS) → Reward (Hedera HTS) → Redeem
```
- **Provenance:** each verified submission is hashed (SHA-256) and the hash is written to a **Hedera Consensus Service** topic. Only the hash is anchored — never raw farmer data.
- **Rewards:** the Climate Token is a **Hedera Token Service** token. An internal, atomic ledger (`token_transactions`) is the source of truth for balances; HTS mint (on earn) and burn (on redeem) mirror it on-chain.
- **Redemption:** Pretium (stablecoin → mobile money across Kenya and Uganda), Africa's Talking (airtime), agro-dealer QR vouchers, and the Dira Circle community pool.
## Features
- 🔐 JWT authentication with role-based access (farmers, agents, admins, partners)
- 🌾 Crop-submission pipeline with AI verification and atmospheric triangulation
- ⛓️ Hedera HCS provenance anchoring and HTS Climate Token mint/burn
- 💸 Multi-rail redemption (mobile money, airtime, vouchers, community pool)
- 🤝 B2B verification API for insurers to independently audit data provenance
- 🛡️ Kenya Data Protection Act (ODPC) compliance — consent and data-subject rights
- 📈 Public dashboard and Prometheus metrics
## Tech …