Full lesson
VOLTX
Decentralized electricity theft detection — ESP32 + ML + Solana community rewards. Built for Frontier Hackathon.solana blockchain iot esp32 electricity-theft fastapi machine-learning anchor rust india
What it does
From the project README:
Electricity theft costs India **₹30,000 crore every year** — and Tamil Nadu alone loses over **₹4,000 crore annually**. Honest households pay inflated bills to subsidise their neighbours' theft. Utility linemen detect theft manually, once a month, creating massive gaps in enforcement.
- Original
- gowthamsp0606/VOLTX
- SuperStack fork
- Blockchains/VOLTX @
e5996d2 - Stars
- 16
- Last push (original)
- 2026-05-10
- Languages
- JavaScript, Python, CSS, Rust, C++, HTML
- Detected stack
- solana-py
- Categories
- GamingDePIN
- Licence
- MIT
Architecture
24 source files. By extension: .jsx ×13, .py ×8, .js ×2, .rs ×1.
| Top-level directory | Source files |
|---|---|
VOLTX Frontend | 15 |
(root) | 9 |
Dapp: devnet deploy pending
⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/voltx/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
lib.rs L277–300 @ e5996d2 · MIT · original )] pub state: Account<'info, StateAccount>, #[account(mut)] pub admin: Signer<'info>, pub system_program: Program<'info, System>,} #[derive(Accounts)]#[instruction(community_id: String)]pub struct CreateCommunity<'info> { #[account( mut, seeds = [b"state", admin.key().as_ref()], bump, has_one = admin )] pub state: Account<'info, StateAccount>, #[account( init, payer = admin, space = 8 + CommunityAccount::SIZE,- Line 281
pub admin: Signer<'info>,: Requires this account to have signed the transaction. - Line 291
seeds = [b"state", admin.key().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 292
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 293
has_one = admin: Checks that a stored pubkey field matches the passed account. - Line 298
init,: Creates and pays for a new account. Space and payer must be specified.
pda.py L1–22 @ e5996d2 · MIT · original# get_pda.pyfrom solders.pubkey import Pubkeyfrom solders.keypair import Keypairimport json PROGRAM_ID = Pubkey.from_string("2Ru7HMxTjdZkVyRgQN3ygZSXh6Zdx62y2kryqwTQn24k") # Load your admin walletwith open("admin.json") as f: secret = json.load(f)ADMIN = Keypair.from_bytes(bytes(secret)) # Derive PDA using seeds = [b"state", admin_pubkey]pda, bump = Pubkey.find_program_address( [b"state", bytes(ADMIN.pubkey())], PROGRAM_ID) print("PROGRAM_ID :", PROGRAM_ID)print("ADMIN WALLET :", ADMIN.pubkey())print("STATE_ACCOUNT :", pda)print("BUMP :", bump)- Line 13
# Derive PDA using seeds = [b"state", admin_pubkey]: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match. - Line 14
pda, bump = Pubkey.find_program_address(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump. - Line 14
pda, bump = Pubkey.find_program_address(: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
VOLTX Frontend | npm run dev | vite |
VOLTX Frontend | npm run build | vite build |
What you could build from it
- Fork the SuperStack copy and extend it within the Gaming gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Compressed NFTs and state compression
- Learn the pattern first: Building and sending transactions from a client