AI + Blockchain EFD Receipt System for Tanzania Revenue Authority - TRA Innovation Challenge 2026
# ⚖️ SmartEFD AI Bridge
**Tanzania Revenue Authority — Innovation Challenge 2026**
An AI-powered, blockchain-verified Electronic Fiscal Device (EFD) receipt system that detects tax evasion in real-time and stores permanent receipt records on the Avalanche blockchain.
---
## 🌍 Overview
SmartEFD AI Bridge combines Artificial Intelligence, Big Data analytics, and Blockchain technology to modernize Tanzania's EFD receipt infrastructure — addressing all 6 areas of the TRA Innovation Competition:
| # | TRA Area | How SmartEFD Addresses It |
|---|----------|--------------------------|
| 1 | Kupanua wigo wa kodi | USSD channel reaches informal sector |
| 2 | Kupunguza gharama za makusanyo | Automated AI scoring replaces manual audit selection |
| 3 | Kutumia AI kurahisisha huduma | Real-time 0–100 risk scoring engine |
| 4 | Kutatua migogoro ya kodi haraka | Blockchain provides immutable tamper-proof receipt records |
| 5 | Kuimarisha huduma za kodi kidijitali | Full bilingual Swahili/English web portal |
| 6 | Kurahisisha makadirio kwa biashara ndogo | Risk scoring designed for micro-transactions |
---
## ⚙️ Tech Stack
- **AI Engine** — Python risk scoring (4-factor, 0–100 score)
- **Backend** — Flask REST API (6 endpoints)
- **Blockchain** — Solidity smart contract on Avalanche C-Chain
- **Frontend** — Bilingual Swahili/English TRA-styled portal
- **Database** — JSON transaction history with gap detection
---
## 🔗 Smart Contract
- **Network:** Avalanche Fuji Testnet (Chain ID: 43113)
- **Contract:** `0x8F241Ab76e7aAB7B4D10711E9fEB650EC8c41f7F`
- **Explorer:** View on SnowTrace
---
## 🚀 How to Run
```bash
# 1. Install dependencies
pip install flask flask-cors web3 python-dotenv
# 2. Create .env file with your wallet key
echo "WALLET_PRIVATE_KEY=0xYourKey" > .env
# 3. Start the server
python app.py
# 4. Open browser
#
localhost
```
---
## 📁 Project Structure
smartefd-backend/data/
├── receipt.py # Receipt data model
├── risk_engine. …