ETH Carbon Offset
A dApp that allows users to calculate and offset their Ethereum transactions' carbon footprint by purchasing carbon credits on-chain.
About
The problem it solves This is a simple dApp that allows users to connect their wallets, estimate their Ethereum carbon footprint, and (in the future) offset it by purchasing carbon credits. User Interaction and Data Flow Connecting a Wallet The user visits the ETH Carbon Offset dApp. They click the “Connect Wallet” button. The app prompts the user to connect their MetaMask (or another Web3 wallet). Once connected, the user's wallet address is displayed on the screen. 2️⃣ Fetching Ethereum Transaction Data The dApp (in a future version) fetches the user's Ethereum transaction history from an API (e.g., Etherscan). It calculates the carbon footprint based on the number of transactions. The estimated CO₂ emissions are displayed to the user. 3️⃣ Purchasing Carbon Credits The user clicks “Offset Now” to buy tokenized carbon credits. (Future Version) A smart contract will handle the transaction using ERC-20/1155 tokens. The user receives a confirmation of their purchase. 4️⃣ Leaderboard (Future Enhancement) Users with the most offset transactions appear on a leaderboard. This encourages eco-friendly blockchain usage. The project architecture and development process User Interaction and Data Flow Connect Wallet – Users authenticate via MetaMask. Calculate Carbon Footprint – The dApp estimates CO₂ emissions from past transactions. Offset Emissions (Future Feature) – Users buy tokenized carbon credits. Leaderboard (Future Enhancement) – Displays top eco-conscious users. Project Architecture and Development Process Frontend: Next.js (React), Tailwind CSS, ethers.js. Smart Contract (Planned): Solidity (ERC-20/1155 for carbon credits). Backend (Future Work): Node.js, Etherscan API for transaction data. Development Process ✅ Phase 1 – UI & Wallet Integration. ✅ Phase 2 – Mock CO₂ Calculation. ⏳ Phase 3 – Smart Contract for Credit Purchases. ⏳ Phase 4 – Real Transaction Data & Leaderboard. Product Integrations MetaMask / WalletConnect – Enables users to connect their Ethereum wallet for authentication and transactions. ethers.js – Facilitates interaction with the Ethereum blockchain, including fetching transaction data and executing smart contract functions. Etherscan API (Planned) – Retrieves users' Ethereum transaction history to calculate carbon footprint accurately. Solidity Smart Contract (Future Work) – Manages carbon credit purchases using ERC-20 or ERC-1155 tokens. Vercel (Deployment) – Hosts the frontend for easy access and usability Key differentiators and uniqueness of the project Key Differentiators & Uniqueness 🔹 Unique Aspects On-Chain Carbon Offsetting – Unlike traditional offset programs, this dApp uses blockchain technology to enable transparent and verifiable carbon credit purchases. Seamless Wallet Integration – Users can instantly calculate and offset their carbon footprint without creating additional accounts. Decentralized & Transparent – Transactions and offset contributions are recorded on-chain, ensuring trust and accountability. Future Leaderboard & Incentives – Gamifies sustainability efforts by ranking users based on their eco-friendly blockchain usage. 🔍 Comparison with Similar Projects Traditional Carbon Offset Platforms – Most rely on centralized entities, whereas this dApp ensures transparency via smart contracts. Existing Blockchain Sustainability Efforts – Some projects focus on green blockchain solutions, but ETH Carbon Offset uniquely targets individual Ethereum users, making sustainability accessible to everyone. This approach bridges blockchain technology with real-world sustainability, empowering users to make Ethereum transactions more eco-friendly. 🚀 Trade-offs and shortcuts while building Trade-offs and Shortcuts While Building ⚡ Quick Fixes & Compromises 🚀 Mock Carbon Footprint Calculation – Instead of fetching real transaction data from Etherscan API, a static multiplier was used to estimate CO₂ emissions. (Future Improvement: Integrate live transaction analysis.) 🔗 No Smart Contract Deployment Yet – The feature to purchase carbon credits is currently a placeholder. (Future Improvement: Deploy an ERC-20/1155 token for carbon credits.) 🖥️ Frontend-Only MVP – The project runs without a backend for now, keeping it lightweight and fast to deploy. (Future Improvement: Add a backend for user history and leaderboard tracking.) 💡 Planned Optimizations Integrate real-time transaction data for more precise footprint calculations. Deploy smart contracts to enable real on-chain carbon credit purchases. Introduce a ranking system to incentivize sustainable blockchain usage. Additional Features This project was built entirely during the ETHSF Hackathon. Key features developed within the hackathon timeframe include: 🔹 Wallet Integration – Enabled users to connect their Ethereum wallet using MetaMask. 🔹 Carbon Footprint Estimation – Implemented a basic model to calculate CO₂ emissions based on Ethereum transactions. 🔹 UI & Frontend Development – Designed a simple and responsive interface using Next.js and Tailwind CSS. 🚀 Planned Post-Hackathon Enhancements 🔜 Real-Time Transaction Data – Integrate Etherscan API for accurate carbon footprint calculations. 🔜 Smart Contract Deployment – Implement on-chain carbon credit purchases using ERC-20/1155 tokens. 🔜 Leaderboard & Incentives – Reward users who offset the most CO₂. This hackathon version serves as a Minimum Viable Product (MVP), with future updates planned to enhance functionality and impact. 🚀