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. β¦