<<<<<<< HEAD
ProofChain features a completely custom smart contract built with modern AlgoKit:
- 🏗️ Built with: AlgoKit + PyTeal (Python)
- 📋 App ID:
748025246 - 🌐 Network: Algorand TestNet
- 📄 Source Code:
proofchain-algokit/smart_contracts/proofchain_contract.py - 🏭 TEAL Artifacts:
proofchain-algokit/artifacts/ng Platform
A complete full-stack application for reporting hate incidents securely and anonymously, powered by Algorand blockchain and IPFS.
https://www.loom.com/share/46c24e4bc0b44f6192208b4d0c2cb3c7?sid=6bf755c9-c604-4f7e-9d76-5f018a667936
Complete walkthrough showing the platform functionality, smart contract deployment, and technical implementation
Clean, modern interface introducing the platform
TrustChain features a completely custom smart contract built from scratch using PyTeal:
- 📋 App ID:
748025246 - 🌐 Network: Algorand TestNet
- 🔗 Block Explorer: View Contract on Asset Hub
- 📄 Source Code:
proofchain-algokit/smart_contracts/proofchain_contract.py
-
🎯 Purpose-Built for Hate Crime Reporting
- Specialized data structures for incident reports
- Support for police reference numbers
- Evidence linking via IPFS CIDs
- Anonymous reporting capabilities
-
🛡️ Advanced Security Features
- Rate limiting (1 report per minute per user)
- Input validation and size limits
- Anti-spam mechanisms
- Sender verification
-
📊 Sophisticated State Management
- Global state tracking total reports
- Local state per user with reporting history
- Timestamp tracking for rate limiting
- Version control for contract upgrades
-
🔍 Transparency & Auditability
- All reports logged to blockchain transaction history
- Public statistics accessible via contract calls
- Immutable record keeping
- Full source code availability
# Core Functions (PyTeal Implementation)
def submit_report():
# Validates sender, enforces rate limits, stores report
# Updates global counters and user state
# Logs incident data to blockchain permanently
def get_stats():
# Returns contract usage statistics
# Public transparency for community oversight📚 Complete Smart Contract Documentation →
Audio explanation covering:
- How the TrustChain project works end-to-end
- GitHub repository structure walkthrough
- Smart contract deployment and functionality demo
- Detailed explanation of custom smart contract development process
- Integration between frontend, backend, and blockchain
- IPFS evidence storage demonstration
proofchain/
├── 🎨 trustchain-witness-main/ # React TypeScript Frontend
├── 🔧 trustchain-backend/ # Node.js Express Backend
├── 🏗️ proofchain-algokit/ # AlgoKit Smart Contract Project ⭐
│ ├── smart_contracts/ # PyTeal source code
│ │ └── proofchain_contract.py # Custom smart contract (177 lines)
│ ├── artifacts/ # Generated TEAL files
│ │ ├── ProofChain.approval.teal
│ │ ├── ProofChain.clear.teal
│ │ └── ProofChain.arc32.json
│ ├── scripts/ # Deployment automation
│ │ ├── deploy_localnet.py
│ │ └── deploy_testnet.py
│ ├── .algokit.toml # AlgoKit configuration
│ └── README.md # Smart contract documentation
├── 🔗 trustchain-smart-contract/ # Legacy smart contract (deprecated)
│ ├── report_contract.py # Old PyTeal implementation
│ └── *.teal # Old TEAL files
├── 📜 proofchain-frontend/ # Legacy frontend (deprecated)
├── 🚀 setup.sh # Setup script
├── ▶️ start-dev.sh # Development start script
└── 📖 README.md # This file
- Modern React with TypeScript - Type-safe development
- shadcn/ui Components - Beautiful, accessible UI components
- React Router - Client-side routing
- React Query - Powerful data fetching and caching
- Algorand Integration - Custom smart contract interaction
- Pera Wallet Connect - Secure wallet connectivity
- IPFS Integration - Decentralized file storage via Pinata
- Responsive Design - Works on all devices
- Express.js API - RESTful API server
- SQLite Database - Lightweight, file-based database
- Input Validation - Secure data validation
- Rate Limiting - API protection
- CORS Support - Cross-origin resource sharing
- Analytics Endpoints - Data insights and reporting
- Search Functionality - Full-text search capabilities
- AlgoKit Smart Contract - Modern PyTeal development with full tooling
- Custom Logic - Purpose-built for hate incident reporting (177 lines)
- Box Storage - Scalable report data management
- TEAL Artifacts - Generated approval and clear state programs
- ABI Compliance - ARC-32 specification for frontend integration
- LocalNet Testing - AlgoKit development sandbox support
- TestNet Deployment - Production-ready deployment pipeline
- Rate Limiting - On-chain spam prevention
- Anonymous Reporting - Privacy-preserving options
- Evidence Storage - IPFS integration for file attachments
- Immutable Records - Permanent incident storage
- 🌐 Pera Explorer: https://testnet.explorer.perawallet.app/application/748025246
- 🔍 AlgoExplorer: https://testnet.algoexplorer.io/application/748025246
- 📝 Report Submission: View Transaction
- 📊 Stats Query: View Transaction
Links will be updated after contract deployment
- Node.js (v16 or higher)
- Python 3.8+ (for smart contract)
- npm or yarn
- Git
- AlgoKit CLI (for smart contract development)
-
Install AlgoKit
pipx install algokit algokit --version
-
Deploy Custom Smart Contract
cd trustchain-smart-contract # Create virtual environment python3 -m venv venv source venv/bin/activate # Install dependencies pip install -r requirements.txt # Compile contract python report_contract.py # Fund deployer account at https://bank.testnet.algorand.network/ export ALGORAND_MNEMONIC="your 25 word mnemonic phrase" # Deploy to TestNet python deploy.py
-
Clone and Setup
cd /Users/efi/proofchain ./setup.sh -
Configure Environment
Frontend (.env in trustchain-witness-main/):
VITE_ALGORAND_APP_ID=[YOUR_DEPLOYED_APP_ID] VITE_ALGOD_SERVER=https://testnet-api.algonode.cloud VITE_API_BASE_URL=http://localhost:3001 VITE_PINATA_API_KEY=your_pinata_api_key VITE_PINATA_SECRET_KEY=your_pinata_secret_key
Backend (.env in trustchain-backend/):
PORT=3001 NODE_ENV=development FRONTEND_URL=http://localhost:5173
-
Start Development Servers
./start-dev.sh
-
Access the Application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Health Check: http://localhost:3001/health
POST /api/reports
Content-Type: application/json
{
"message": "Report description",
"txId": "algorand_transaction_id",
"timestamp": 1640995200000,
"isAnonymous": false,
"policeRef": "REF123",
"ipfsCid": "QmXXXXXX",
"incidentDate": "2024-01-01T00:00:00.000Z",
"accountAddress": "ALGOACCOUNT123..."
}GET /api/reports?limit=50&offset=0&status=confirmed// Frontend integration with custom smart contract
const submitReportToBlockchain = async (reportData) => {
const appArgs = [
new Uint8Array(Buffer.from("submit_report")),
new Uint8Array(Buffer.from(reportData))
];
const txn = algosdk.makeApplicationNoOpTxnFromObject({
sender: accountAddress,
suggestedParams: suggestedParams,
appIndex: CUSTOM_APP_ID, // Our deployed contract
appArgs: appArgs,
});
const signedTxn = await peraWallet.signTransaction([txn]);
const response = await algodClient.sendRawTransaction(signedTxn).do();
return response.txid;
};py-algorand-sdk- Python SDK for smart contract development and deploymentalgosdk(JavaScript) - Frontend integration with Algorand blockchain- PyTeal - Python framework for writing Algorand smart contracts in Python
-
⚡ Instant Finality
- Reports are confirmed in under 4 seconds
- No waiting for multiple confirmations like other blockchains
- Real-time user feedback on report submission
-
💚 Carbon Negative
- Environmentally conscious choice for social impact platform
- Algorand is certified carbon negative by ClimateTrade
-
💰 Micro-Transaction Friendly
- $0.001 transaction fees make the platform accessible globally
- No barrier to entry for reporting incidents
-
🔒 Built-in Security
- Pure Proof-of-Stake consensus mechanism
- Byzantine fault tolerance
- Immediate transaction finality
-
📊 Rich State Management
- Global and local state storage for complex applications
- Built-in key-value storage without additional infrastructure
- Social Impact Focus: Low fees enable global accessibility for reporting hate crimes
- Real-time Reporting: Instant finality means immediate report confirmation
- Environmental Responsibility: Carbon-negative blockchain aligns with social good mission
- Scalability: Can handle high volumes of reports during crises or events
- Developer Experience: PyTeal and rich SDKs enabled rapid custom contract development
cd trustchain-witness-main
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run buildcd trustchain-backend
# Install dependencies
npm install
# Start development server (with hot reload)
npm run devcd trustchain-smart-contract
# Activate virtual environment
source venv/bin/activate
# Modify contract
nano report_contract.py
# Recompile
python report_contract.py
# Deploy updates (new app ID)
python deploy.py- Algorand TestNet - Layer 1 blockchain
- PyTeal - Smart contract development framework
- Algorand Python SDK - Blockchain interaction
- Pera Wallet - User wallet interface
- React 18 with TypeScript
- Vite - Fast build tool
- shadcn/ui - Component library
- Tailwind CSS - Utility-first CSS
- React Router - Routing
- React Query - Data fetching
- Algorand JS SDK - Blockchain integration
- Node.js with Express.js
- SQLite - Database
- express-validator - Input validation
- CORS - Cross-origin support
- Helmet - Security headers
- IPFS via Pinata - Decentralized storage
- AlgoKit - Development toolkit
- LocalNet - Local development blockchain
-
Blockchain-Level Security
- Smart contract rate limiting (1 report/minute/user)
- Input validation and size limits in contract
- Immutable record storage
- Sender verification
-
API-Level Security
- Rate limiting (100 requests per 15 minutes per IP)
- Input validation on all endpoints
- CORS protection
- Security headers via Helmet.js
-
Privacy Features
- Anonymous reporting options
- IPFS for decentralized evidence storage
- No personal data stored on blockchain
# Fund account at https://bank.testnet.algorand.network/
export ALGORAND_MNEMONIC="your mnemonic"
cd trustchain-smart-contract && python deploy.pycd trustchain-witness-main
npm run build
# Deploy dist/ foldercd trustchain-backend
# Set environment variables and deploy- ✅ Unit tests for all contract functions
- ✅ Integration tests with frontend
- ✅ Rate limiting verification
- ✅ State management validation
- ✅ Error handling tests
- ✅ Report submission workflow
- ✅ Wallet connection testing
- ✅ IPFS file upload testing
- ✅ Analytics data accuracy
- ✅ Cross-browser compatibility
CREATE TABLE reports (
id TEXT PRIMARY KEY, -- UUID
message TEXT NOT NULL, -- Report content
txId TEXT UNIQUE NOT NULL, -- Algorand transaction ID
timestamp INTEGER NOT NULL, -- Unix timestamp
isAnonymous BOOLEAN DEFAULT 0, -- Privacy flag
policeRef TEXT, -- Police reference number
ipfsCid TEXT, -- IPFS content ID
incidentDate TEXT, -- ISO date string
status TEXT DEFAULT 'confirmed', -- pending/confirmed/failed
accountAddress TEXT, -- Reporter address (if not anonymous)
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);- Fork the repository
- Create feature branch:
git checkout -b feature/new-feature - Test smart contract changes:
python report_contract.py && python deploy.py - Commit changes:
git commit -am 'Add new feature' - Push to branch:
git push origin feature/new-feature - Submit pull request
MIT License - see LICENSE file for details
- Smart Contract Issues: Check
trustchain-smart-contract/logs - API Issues: Check health endpoint: http://localhost:3001/health
- Blockchain Issues: Verify TestNet connectivity and account funding
- IPFS Issues: Verify Pinata API keys and configuration
- Smart Contract V2 with governance features
- MainNet deployment for production use
- Mobile app (React Native)
- Multi-language support
- Advanced analytics dashboard
- Integration with law enforcement APIs
- NFT certificates for verified reports
🏆 Built for Algorand Hackathon 2025
Demonstrating custom smart contract development, full-stack integration, and social impact through blockchain technology.
Built with ❤️ for a safer, more transparent world.
Technical (Coding) Track Submission | EasyA × Algorand London Hackathon 2025
ProofChain is a Web3 civic-tech platform built on the Algorand TestNet that enables citizens to report hate crimes transparently and anonymously, using blockchain to ensure immutable, verifiable proof of incidents.
It demonstrates how Algorand smart contracts can power public accountability and trust, transforming blockchain into infrastructure for social good.
Core Features Feature Description Algorand Smart Contract Custom PyTeal contract (APP_ID: 748001402) deployed on Algorand TestNet, defining submit_report() for on-chain submissions. Pera Wallet Integration Secure user authentication via WalletConnect. Supports both anonymous and verified reporting. Report Submission Form Collects text reports, optional police reference, and optional IPFS evidence uploads (PDF/image). Immutable Records Every report becomes a public, timestamped transaction on-chain, viewable via AlgoExplorer. Analytics Dashboard Displays live metrics such as total reports, verified vs anonymous ratio, and time-based trends (built with Recharts). TrustScore System Community transparency metric calculated as (Verified / Total Reports) × 100. Open Source Fully open codebase (frontend and smart contract), licensed under MIT. How It Works
Frontend (React + Vite + Tailwind) Users connect their Pera Wallet, submit a report, and optionally attach files. Evidence is uploaded to IPFS.
Smart Contract Layer (PyTeal + Beaker) The frontend triggers the submit_report() function in the Algorand contract (APP_ID 748001402), writing metadata to the blockchain and returning a transaction ID.
Real-Time Sync Frontend updates dynamically through React context hooks, ensuring live dashboards and metrics.
Transparency Layer Each transaction includes a direct AlgoExplorer link, providing verifiable public proof of submission.
Tech Stack
Frontend: React (Vite), TailwindCSS, Recharts Blockchain: Algorand TestNet, PyTeal, Beaker Wallet: Pera Wallet (@perawallet/connect) Storage: IPFS (Pinata / Web3.Storage) Languages: Python, JavaScript
Repository Structure ProofChain/ ├── trustchain_v2/ # Smart contract backend (PyTeal / Beaker) │ ├── app.py # Smart contract logic │ ├── deploy.py # Deployment script │ └── call_submit.py # Helper for transaction testing │ ├── trustchain-frontend/ # React + Vite frontend │ ├── components/ # UI components (ReportForm, ReportCard, etc.) │ ├── pages/ # Home, Dashboard, Learn, About │ ├── context/ # Global state management │ ├── utils/ # algorand.js, ipfs.js, constants.js │ └── vite.config.js # Polyfills for algosdk │ └── README.md
Smart Contract Details Property Value Network Algorand TestNet App ID 748001402 Contract File trustchain_v2/app.py Method submit_report(message, police_ref, ipfs_cid, is_anonymous) Verification View on AlgoExplorer Local Setup and Deployment
git clone https://github.com/shahaman098/ProofChain.git cd ProofChain/trustchain-frontend
npm install
npm run dev
Open in your browser: http://localhost:5173
To deploy the smart contract (optional):
cd ../trustchain_v2 python3 deploy.py
Demo Resources
Demo Video Shows wallet connection, report submission, transaction confirmation, and dashboard update. Watch the Demo Video
Walkthrough (Loom with Audio) Explains architecture, repository structure, contract logic, and integration. Watch the Walkthrough
Hackathon Submission Checklist
Built on Algorand Smart Contracts (PyTeal)
Fully open source (MIT License)
Includes demo video and walkthrough
Clear README with screenshots and AlgoExplorer link
Canva presentation slides attached
Meets all Technical Track requirements
Future Roadmap
Verified Partner Dashboards – NGO and council validation layer
AI Classification Engine – detect trends, sentiment, and recurring patterns
Reward System – tokenized community transparency incentives
Multi-Language UI – inclusive accessibility for diverse users
Mainnet Deployment – scalable rollout beyond TestNet pilots
Built For
EasyA × Algorand London Hackathon 2025 Team: ProofChain
“ProofChain empowers communities through immutable, verifiable transparency — powered by Algorand.”
7923594b4cf3edf7e808a490a462ec7a3ba25df9
