A smart solar energy distribution and management system, powered by AI and paid on-chain.

Distributed solar is growing faster than the systems that manage it. Power is now generated at thousands of small sites, such as rooftops, housing societies, campuses and community microgrids, and consumed by many parties at once. Yet distribution, billing and maintenance still run on estimates, manual meter readings and trust. Energy goes unused at peak hours, surplus is sold back at the lowest price, and payments between producers, consumers and service providers are slow and hard to audit. Dynaura is a smart solar energy distribution and management system that closes the loop from generation to payment: measure, decide, settle and record. Measure. An edge node meters generation and every consumer in real time and signs each reading at the source, so the data can't be changed later. Decide. An AI planner on 0G combines the weather forecast with consumption history to schedule loads into peak generation, route surplus to where it's needed, price it by scarcity, and detect when a panel is losing output. Every decision can be verified through its 0G request ID and an audit log on 0G Storage and 0G Chain. Settle. Payments run in USDC on Arc smart contracts that release funds only against metered proof. Buyers prepay and are refunded for energy not delivered, consumption is billed per unit, revenue is shared by measured contribution, and maintenance is paid from escrow only once output is restored. Record. Arkiv holds an open ledger of readings, decisions, trades, bills and service jobs that every participant can check. We run it end to end on working hardware: A model showcasing 3 flats, Raspberry Pi, live meters and relays. The same design scales to a housing society, a campus or a community grid.
Hardware. A working prototype on one board. A Raspberry Pi 4 reads four INA219 meters over I2C: one on a real solar panel and one for each of three consumers (A, B, C). A 4-channel relay module switches each consumer between solar and grid, shown by yellow and blue LEDs, and drives a water pump as a shared load. A power bank stands in for the grid, a lamp plays the sun, and tracing paper on the panel simulates dust. Pi software (Python). A FastAPI service meters everything once a second, signs each 1-minute summary with the device key (eth-account), and streams live state to the app over SSE. It runs as systemd services, with a SIM mode for development and a safe stop (all flats on grid, pump off) whenever anything fails. 0G. The planner, dust check and spare-sun trader call the 0G Compute Router through the OpenAI SDK with verify_tee on. Each decision is saved as a hash chained episode on 0G Storage (Go storage client) and indexed by an EpisodeRegistry contract on 0G Galileo. If 0G is unreachable the Pi never fakes a verdict: it falls back to a labelled no-AI rule and logs the outage. Arc. Four Solidity contracts written, tested and deployed in Arc Studio: CleaningEscrow (conditional escrow, meter-proven release, dispute and refund), ShopTrade (prepay, settle by delivered Wh, refund the rest), SolarBilling (monthly bill split between solar and grid) and SolarCredits (revenue paid out by each flat's unused share). The Pi is the oracle and posts with web3.py; residents, the shop and the cleaner sign from their own wallets with viem. Arkiv. A Node bridge with @arkiv-network/sdk writes readings, decisions, trades, bills and cleaning jobs from one building wallet. Expiry does real work: a 2-minute heartbeat is the offline alarm, shop offers close at sunset, and the planner reads the last 7 days back from Arkiv into every 0G prompt. App. React, Vite and Tailwind, mobile-first, with resident, committee, cleaner and shop roles. It reads Arkiv straight from the browser. Hacky bit: the panel had no load, so the INA219 read 0 mA. We switched to sensing the panel's voltage between lamp-off and lamp-on, calibrated live at the venue.

