Skip to content

ValenteCreativo/SEN-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›°οΈ SEN Network β€” Sensor Economy Network

Decentralized Real-World Data Marketplace on Solana

Solana Anchor Next.js TypeScript Redis Prisma Docker License

The trust layer for physical reality.
AI needs verified data. Sensors need incentives.
Markets need trust.
SEN turns the physical world into a verifiable economy of data flows β€” powered by Solana and cryptographic proofs.


πŸ“‘ Table of Contents


🎯 Context

🚨 The Problem

  • Real-world data is not verifiable
  • IoT networks are centralized & siloed
  • Sensors lack economic incentives
  • AI relies on closed & untrusted feeds
  • Environmental data is opaque and gatekept

βœ… The Solution β€” SEN Network

A decentralized Sensor Data Marketplace where:

Actor Capability
🌎 Sensor Owners Register sensors & stream signed data
πŸ™οΈ Builders / Researchers / AI Systems Purchase or subscribe to feeds
⚑ Solana Fast micropayments, trust guarantees
πŸ” Backend Data ingest, validation, reputation

Sensors become economic agents.
Data becomes an asset class.

Welcome to the Sensor Economy.


🎯 Architecture

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Sensors    β”‚ ---> β”‚       SEN Backend       β”‚ ----┐
β”‚ IoT / DIY HW β”‚      β”‚ Fastify + Prisma + Redisβ”‚     β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
       β”‚                       β”‚                       β”‚
       β”‚                       β”‚ BullMQ Workers        β”‚
       β”‚                       β–Ό                       β”‚
       β”‚                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                 β”‚
       β”‚                β”‚   IPFS     │◄────────────┐   β”‚
       β”‚                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚   β”‚
       β”‚                                            β–Ό   β–Ό
       β–Ό                                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       Hashes / Payments       β”‚ Solana Programβ”‚
β”‚  Frontend    β”‚ <──────────────────────────── β”‚  (Anchor)     β”‚
β”‚ Next.js UI   β”‚       Reputation Proofs       β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜                                        β”‚
       β”‚ WebSockets + REST                               β”‚
       β–Ό                                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Real-time UI     β”‚ <────────────────────────> β”‚ Blockchain Stateβ”‚
β”‚ Subscriptions    β”‚                            β”‚ PDA Accounts    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Features

  • Sensor registration (on-chain PDA)
  • Proof-of-data hash commitment
  • Pay-per-query + subscriptions
  • Treasury (95%) & network vault (5%)
  • Realtime WebSockets (incoming telemetry)
  • Reputation engine
  • Mock sensor scripts for testing

🧩 On-Chain Modules (Anchor)

Module Purpose
register_sensor Creates PDA + metadata
submit_hash Commits SHA-256 hash of sensor feed
pay_per_query USDC micropayment engine
subscribe Access subscription w/ renewal cycle
withdraw_earnings Withdraw accumulated funds
update_reputation Maintains integrity score

State Accounts

  • Sensor
  • Subscription
  • Treasury
  • Vault
  • Reputation

Zero governance, no memecoin gimmicks β€” pure utility & infra.


🧰 Technology Stack

Blockchain

  • Solana
  • Anchor 0.30.1
  • SPL USDC
  • PDA-based account system

Backend

  • Fastify
  • Prisma + PostgreSQL
  • Redis + BullMQ workers
  • IPFS (web3.storage)
  • Zod validation
  • Structured logging (Pino)

Frontend

  • Next.js 14 (App Router)
  • Tailwind + Radix UI
  • Zustand state
  • Wallet Adapter (Phantom)
  • Charts + dashboards

πŸ› οΈ Prerequisites

node >= 18 docker + docker compose solana-cli >= 2.x (Agave stack) anchor-cli >= 0.30.1

Verify setup:

solana --version
anchor --version
docker --version

## βš™οΈ **Install & Setup**

Clone repo:

git clone <repo-url>
cd sen-network
pnpm install
docker compose up -d
Set devnet:

solana config set --url https://api.devnet.solana.com
solana airdrop 2

🧱 Anchor Program Deployment

Build:

anchor build



Deploy:

anchor deploy



Copy IDL to frontend:

cp target/idl/sen_network.json app/lib/idl/



Update program ID in:

- `Anchor.toml`
- `app/lib/idl/sen_network.json`

## πŸ’» **Local Development**

Backend:

pnpm dev:server



Frontend:

cd app
pnpm dev



Open browser β†’ `http://localhost:3000`

πŸ“‚ Project Structure

sen-network/
β”œβ”€ programs/
β”‚  └─ sen_network/         # Solana smart contract (Anchor)
β”‚     └─ src/
β”‚        └─ lib.rs
β”œβ”€ backend/                # Fastify API + Prisma ORM + Redis queues
β”‚  └─ src/
β”‚     β”œβ”€ server.ts         # API entrypoint
β”‚     β”œβ”€ workers/          # BullMQ job processors
β”‚     └─ prisma/           # Database schema & migrations
└─ app/                    # Next.js Marketplace UI
   β”œβ”€ sensors/             # Sensor management UI
   β”œβ”€ market/              # Data marketplace UI
   └─ lib/idl/             # IDL imported from Anchor build


πŸ§ͺ Useful Commands

solana-test-validator # local chain
solana-keygen new # new wallet
anchor build --idl # rebuild IDL
cp target/idl/*.json app/lib/idl/ # sync IDL to UI
docker compose restart # infra reset

🩹 Troubleshooting

Issue Fix
Wallet not connecting Phantom β†’ enable Devnet
IDL missing anchor build && cp idl
Program mismatch Update Anchor.toml & UI IDL
Docker errors docker compose down && docker compose up

πŸ›£οΈ Roadmap

βœ… Phase 1 β€” MVP

  • Sensor registry
  • Data proof hashing
  • Wallet connect UI
  • Mock data ingest + charts

πŸš€ Phase 2 β€” Real-World Readiness

  • Live sensor firmware script
  • Strong reputation scoring
  • USDC subscriptions
  • ZK-based data integrity (optional)

🌍 Phase 3 β€” Scale

  • Mobile app
  • LoRaWAN gateway integration
  • Community sensor kits (Raspberry Pi)
  • Municipal + research partnerships

Goal: AI-ready real-world data rails.


🐾 Author

ValentΓ­n MartΓ­nez
Builder β€” PhD Candidate on Technological Innovation | COO Frutero Club | Cyberpunk Panther πŸ†βš‘οΈ

https://github.com/ValenteCreativo

MIT License β€” **Open source for planetary intelligence & resilience 🌍**s

About

Sensor Economy Network (SEN) - V 1.0 - Colosseum Solana Hackathon

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published