π‘ Inspiration
Every second, the global financial sector processes hundreds of thousands of digital transactions. While consumers see an instantaneous screen update, behind the scenes, vast cloud data centers consume terawatt-hours of electricity to power databases, consensus engines, and API microservices.
Today, enterprise Environmental, Social, and Governance (ESG) disclosures rely almost entirely on annualized estimates, third-party vendor surveys, and unverified carbon offsets. This lack of granular measurement leads directly to "greenwashing"βfinancial institutions can claim carbon neutrality without having any empirical visibility into the actual physical power consumed by their servers.
We built Green-Finance to solve this fundamental accountability gap: transforming corporate sustainability from static, self-reported estimates into real-time, kernel-measured, and cryptographically auditable telemetry.
β‘ What It Does
Green-Finance is an end-to-end sustainable digital banking ecosystem and real-time energy observability framework. It pairs core financial microservices with kernel-level instrumentation to compute the precise carbon footprint of every financial transfer down to the microjoule.
Core Architecture & Capabilities:
- Full-Featured Digital Banking Portal: Consumers can transfer funds via instant UPI, pay utility bills (Electricity, Water, Gas), monitor live balances in INR (βΉ), and review their transaction history.
- Kernel-Level Energy Telemetry (CNCF Kepler eBPF): Uses Extended Berkeley Packet Filters (eBPF) and Intel/AMD Running Average Power Limit (RAPL) hardware counters to sample physical CPU and DRAM power consumption in real time without injecting code into microservices.
- Location-Based Scope 2 GHG Accounting: Automatically translates energy in Joules ($J$) into localized carbon emissions ($g\text{ CO}_2e$) using the Central Electricity Authority (CEA) India baseline ($713.0\text{ g CO}_2/\text{kWh}$).
- Tamper-Evident Cryptographic Ledger: Employs an append-only double-entry ledger linked by continuous SHA-256 cryptographic hash chaining. Every financial transfer and carbon offset certificate receives a verified digital receipt.
- Multi-Role Security & Governance: 4-tier Role-Based Access Control (RBAC) separating Customers, Forensic Investigators, Compliance Admins, and Super Administrators.
- Forensic Sustainability Investigator Hub: Provides compliance auditors with real-time Workload Telemetry, Attribution Fidelity calibration gauges, carbon risk alerts, and exportable ESG audit reports.
π Mathematical Foundations & Attribution Fidelity
To ensure that reported energy metrics reflect physical reality, Green-Finance implements an empirical Energy Attribution & Fidelity Engine grounded in the First Law of Thermodynamics:
$$\mathbf{E_{\text{Host}}} = \mathbf{E_{\text{Containers}}} + \mathbf{E_{\text{Idle Baseline}}} + \mathbf{\Delta E_{\text{Residual}}}$$
Where:
- $E_{\text{Host}}$ is the total server package energy captured via hardware RAPL counters.
- $E_{\text{Containers}}$ is the energy consumed by active banking containers.
- $E_{\text{Idle Baseline}}$ is the calibrated background host power ($18.7\text{ W}$, $CV \le 5.0\%$).
- $\Delta E_{\text{Residual}}$ represents unaccounted thermal or peripheral bus losses.
The Attribution Fidelity of each measurement cycle is evaluated as:
$$\text{Fidelity } (\%) = \left(1 - \frac{|\Delta E_{\text{Residual}}|}{E_{\text{Host}}}\right) \times 100$$
The system certifies telemetry as HEALTHY / VERIFIED only when Fidelity exceeds $94.0\%$ (Residual $\le 6.0\%$), achieving an empirical statistical correlation of $R^2 = 0.962$.
π οΈ How We Built It
- Backend & Core Engine: Python 3.10 with FastAPI, Pydantic v2, and SQLAlchemy ORM configured in WAL (Write-Ahead Logging) mode with strict ACID compliance.
- Kernel Telemetry & Observability: CNCF Kepler reading bare-metal Linux MSR/RAPL registers via eBPF; Prometheus TSDB scraping container power metrics; Grafana for industrial dashboard visualizations.
- Frontend User Experience: Modern, responsive vanilla JavaScript UI with custom SVG data visualizers, HTML5 Canvas glowing neon sparklines, and role-gated navigation panels.
- Cryptographic Security: Passwords hashed with Argon2id ($m=65536, t=3$), stateful session tracking with instant server-side revocation, and defense-in-depth security headers (CSP, X-Frame-Options, CSRF tokens).
- Automated Verification: 77 automated pytest scenarios verifying financial double-entry balance invariants ($\sum \text{Debits} == \sum \text{Credits}$ down to $0.0000$), race condition overdraft prevention under 10 parallel threads, and zero-trust RBAC isolation.
π§ Challenges We Ran Into
- Low-Overhead Telemetry Without Workload Distortion: Traditional profiling tools add significant CPU overhead, skewing power measurements. We overcame this by using kernel-level eBPF probes that sample hardware registers asynchronously with near-zero (<0.5%) overhead.
- Preventing Race Conditions Under High Concurrency: In high-volume transfers, simultaneous debit calls can trigger negative balances. We implemented explicit database row-level locking and idempotency key deduplication to guarantee that balances never drop below zero.
- Filtering Background Noise from Idle Baselines: Host CPUs dynamically throttle clock speeds based on ambient thermal state. We authored an Exponential Moving Average (EMA, $\alpha=0.2$) smoothing filter and an automated drift detector that triggers re-calibration if idle variance exceeds $15\%$.
π Accomplishments That We're Proud Of
- 100% Pass Rate Across 77 Automated Tests: Complete verification covering financial invariants, directory traversal defense, and microjoule attribution.
- End-to-End Functioning Prototype: A live, interactive platform with independent Customer, Investigator, Admin, and Operations dashboards.
- Anti-Greenwashing Architecture: Proven system design where synthetic or simulated telemetry can never be falsely stamped as "Hardware Observed."
π What We Learned
- How to harness Linux eBPF probes to measure containerized energy consumption in container clusters.
- The mechanics of ISO/IEC 21031 (Software Carbon Intensity specification) and location-based Scope 2 carbon accounting.
- Designing tamper-proof audit trails using chained cryptographic hashes for institutional compliance.
π What's Next for Green-Finance
- Dynamic Carbon-Aware Routing: Automatically routing non-urgent batch financial settlements to Kubernetes clusters powered by solar or wind energy during peak renewable generation windows.
- Central Bank Digital Currency (CBDC) Interoperability: Integrating green ledger telemetry into upcoming digital currency rails for automated ESG tax compliance.
Built With
- argon2id
- cryptography
- css3
- docker
- ebpf
- esg
- fastapi
- fintech
- grafana
- green-computing
- html5
- javascript
- kepler
- postgresql
- prometheus
- pytest
- python
- sha-256
- sqlalchemy
- sqlite