Skip to content

Latest commit

Β 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BAE - Baby Ambient Environment

A decentralized IoT + Blockchain platform for neonatal environmental monitoring that ensures data traceability and privacy. Combines real-time sensor data, AES-256-GCM encryption, and Polkadot blockchain to protect babies' health information while enabling ethical research for medical institutions.

Group 8

The Problem

In Latin America and the Caribbean, the PAHO estimates that 255 babies die every day before reaching one month of age. This figure reflects a silent crisis during the neonatal period, when mortality risk is highest.

Critical Statistics

  • 57% of all infant deaths in Latin America occur in the first 28 days of life
  • Lack of accessible and reliable preventive monitoring solutions
  • Absence of traceability in neonatal health data
  • Limited options for vulnerable families

"More than 57% of infant deaths in Latin America occur in the first 28 days of life. This evidences the urgency for a preventive, accessible, and reliable solution to reduce risk." β€” PAHO

The Solution: BAE

BAE integrates Polkadot blockchain technology to ensure traceability and privacy of baby data. Every time the IoT sensor measures temperature or humidity, that information is transformed into an encrypted transaction recorded on the network in a decentralized way, guaranteeing it cannot be altered or manipulated.

Key Features

  • Real-Time Monitoring: Temperature and humidity readings every 30 seconds with instant alerts
  • End-to-End Encryption: Sensor data encrypted with AES-256-GCM before transmission
  • Device Authentication: Each device linked to a unique NFT certifying authenticity
  • Data Ownership: Parents have total ownership and control of their data
  • Ethical Research: Anonymous data can be shared ethically with universities/institutions
  • Blockchain Traceability: Every reading is verifiable and immutable on Polkadot
  • Privacy-Preserving: Encrypted data on-chain, only decrypted by authorized backend

Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        BAE SYSTEM ARCHITECTURE                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   ESP32 Sensor   β”‚  Temperature: 15-31Β°C
β”‚   (Simulator)    β”‚  Humidity: 40-80%
β”‚                  β”‚  Frequency: Every 30s
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”‚ MQTT Protocol
         β”‚ Topic: bae/sensors/+/data
         β”‚ Broker: broker.hivemq.com
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Rust Gateway    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  β”‚  β”‚ Security Processing:            β”‚
β”‚  - Validates     β”‚  β”‚ 1. Validate sensor data         β”‚
β”‚  - Encrypts      β”‚  β”‚ 2. AES-256-GCM Encryption       β”‚
β”‚  - Signs         β”‚  β”‚ 3. SHA-256 Signature            β”‚
β”‚  - Submits       β”‚  β”‚ 4. Submit to blockchain         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”‚ JSON-RPC
         β”‚ Transaction to Polkadot
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            POLKADOT PASEO HUB TESTNET                        β”‚
β”‚                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚     Smart Contract: BaeSensorRegistry             β”‚     β”‚
β”‚  β”‚     Address: 0xfD0b...f217                        β”‚     β”‚
β”‚  β”‚                                                    β”‚     β”‚
β”‚  β”‚  Storage:                                         β”‚     β”‚
β”‚  β”‚  β€’ Device ID                                      β”‚     β”‚
β”‚  β”‚  β€’ Ciphertext (encrypted data)                    β”‚     β”‚
β”‚  β”‚  β€’ Nonce (12 bytes)                               β”‚     β”‚
β”‚  β”‚  β€’ Signature (32 bytes)                           β”‚     β”‚
β”‚  β”‚  β€’ Timestamp                                      β”‚     β”‚
β”‚  β”‚  β€’ Block Number                                   β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚                                                              β”‚
β”‚  Features: Immutable β€’ Transparent β€’ Verifiable             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                   β”‚
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚                       β”‚
       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Backend API    β”‚    β”‚    Frontend      β”‚
β”‚   (Node.js)      β”‚    β”‚   (Next.js 15)   β”‚
β”‚                  β”‚    β”‚                  β”‚
β”‚  β€’ Reads chain   β”‚    β”‚  β€’ Web3 wallet   β”‚
β”‚  β€’ Decrypts AES  │◄────  β€’ Dashboard     β”‚
β”‚  β€’ REST API      β”‚    β”‚  β€’ Alerts        β”‚
β”‚  β€’ Stats calc.   β”‚    β”‚  β€’ Charts        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚
         β”‚                       β”‚
         β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         END USERS                    β”‚
β”‚                                      β”‚
β”‚  πŸ‘¨β€πŸ‘©β€πŸ‘§ Parents    πŸ‘¨β€βš•οΈ Doctors    πŸ”¬ Researchers β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         DATA FLOW PROCESS                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

STEP 1: DATA GENERATION
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Sensor Reading        β”‚
β”‚                         β”‚
β”‚   Plain JSON:           β”‚
β”‚   {                     β”‚
β”‚     "device_id": "...", β”‚
β”‚     "temp": 23.5,       β”‚
β”‚     "humidity": 55.2    β”‚
β”‚   }                     β”‚
β”‚                         β”‚
β”‚   Status: βœ… READABLE   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β–Ό
STEP 2: ENCRYPTION
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Gateway Processing    β”‚
β”‚                         β”‚
β”‚   AES-256-GCM:          β”‚
β”‚   Plain β†’ Ciphertext    β”‚
β”‚                         β”‚
β”‚   SHA-256:              β”‚
β”‚   Generate Signature    β”‚
β”‚                         β”‚
β”‚   Status: πŸ”’ ENCRYPTED  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β–Ό
STEP 3: BLOCKCHAIN STORAGE
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Smart Contract        β”‚
β”‚                         β”‚
β”‚   Stored Data:          β”‚
β”‚   β€’ Ciphertext          β”‚
β”‚   β€’ Nonce               β”‚
β”‚   β€’ Signature           β”‚
β”‚   β€’ Metadata            β”‚
β”‚                         β”‚
β”‚   Status: ⛓️ IMMUTABLE  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β–Ό
STEP 4: AUTHORIZED ACCESS
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Backend Decryption    β”‚
β”‚                         β”‚
β”‚   Process:              β”‚
β”‚   1. Read from chain    β”‚
β”‚   2. Verify signature   β”‚
β”‚   3. Decrypt with key   β”‚
β”‚   4. Return JSON        β”‚
β”‚                         β”‚
β”‚   Status: βœ… READABLE   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β–Ό
STEP 5: VISUALIZATION
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Dashboard        β”‚
β”‚                         β”‚
β”‚   Display:              β”‚
β”‚   🌑️ Temperature: 23.5Β°C β”‚
β”‚   πŸ’§ Humidity: 55.2%     β”‚
β”‚   πŸ“Š Charts & Stats     β”‚
β”‚   ⚠️ Alerts             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Security Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       SECURITY LAYERS                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Layer 1: SENSOR LEVEL
β”œβ”€ Plain data generation
β”œβ”€ Device authentication via NFT
└─ Secure MQTT transmission

Layer 2: GATEWAY LEVEL (Encryption)
β”œβ”€ AES-256-GCM Encryption
β”‚  β”œβ”€ Algorithm: Advanced Encryption Standard
β”‚  β”œβ”€ Key Size: 256 bits (32 bytes)
β”‚  β”œβ”€ Mode: Galois/Counter Mode
β”‚  └─ Nonce: 12 random bytes per message
β”‚
β”œβ”€ SHA-256 Signature
β”‚  β”œβ”€ Hash of encrypted data
β”‚  β”œβ”€ Integrity verification
β”‚  └─ 32 bytes output
β”‚
└─ Retry logic (up to 3 attempts)

Layer 3: BLOCKCHAIN LEVEL (Storage)
β”œβ”€ Immutable storage on Polkadot
β”œβ”€ Transparent transaction history
β”œβ”€ No decryption capability on-chain
β”œβ”€ Public verification of signatures
└─ Event emission for real-time tracking

Layer 4: BACKEND LEVEL (Decryption)
β”œβ”€ Authorized decryption only
β”œβ”€ Encryption key stored server-side
β”œβ”€ REST API access control
β”œβ”€ Rate limiting
└─ Audit logging

Layer 5: FRONTEND LEVEL (Display)
β”œβ”€ No sensitive keys exposed
β”œβ”€ Web3 wallet authentication
β”œβ”€ HTTPS/TLS encryption
β”œβ”€ Client-side validation
└─ User permission management

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     ENCRYPTION KEY DISTRIBUTION        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                        β”‚
β”‚  Gateway (Rust)    βœ… HAS KEY         β”‚
β”‚  β”œβ”€ Encrypts data                     β”‚
β”‚  └─ Stored in env variables           β”‚
β”‚                                        β”‚
β”‚  Smart Contract    ❌ NO KEY          β”‚
β”‚  β”œβ”€ Only stores encrypted data        β”‚
β”‚  └─ Cannot decrypt                    β”‚
β”‚                                        β”‚
β”‚  Backend API       βœ… HAS KEY         β”‚
β”‚  β”œβ”€ Decrypts data                     β”‚
β”‚  └─ Stored in env variables           β”‚
β”‚                                        β”‚
β”‚  Frontend          ❌ NO KEY          β”‚
β”‚  β”œβ”€ Only displays decrypted data      β”‚
β”‚  └─ Cannot decrypt                    β”‚
β”‚                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Component Communication

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    COMPONENT INTERACTIONS                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Sensor     │──── MQTT Pub ────▢ β”‚   Gateway    β”‚
β”‚   ESP32      β”‚                    β”‚   (Rust)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚
                                           β”‚ JSON-RPC
                                           β”‚ submitSensorData()
                                           β”‚
                                           β–Ό
                              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                              β”‚   Smart Contract       β”‚
                              β”‚   (Solidity)           β”‚
                              β”‚                        β”‚
                              β”‚   Functions:           β”‚
                              β”‚   β€’ submitSensorData() β”‚
                              β”‚   β€’ getLatestReading() β”‚
                              β”‚   β€’ getReading(index)  β”‚
                              β”‚   β€’ totalReadings()    β”‚
                              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                      β”‚
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚                           β”‚
                        β–Ό                           β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
              β”‚   Backend API    β”‚                  β”‚
              β”‚   (Node.js)      β”‚                  β”‚
              β”‚                  β”‚                  β”‚
              β”‚   Endpoints:     β”‚                  β”‚
              β”‚   GET /health    β”‚                  β”‚
              β”‚   GET /latest    │◀─── Reads β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚   GET /history   β”‚      Chain
              β”‚   GET /stats     β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β”‚ REST API
                        β”‚ JSON Response
                        β”‚
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚    Frontend      β”‚
              β”‚    (Next.js)     β”‚
              β”‚                  β”‚
              β”‚   Components:    β”‚
              β”‚   β€’ Dashboard    β”‚
              β”‚   β€’ Charts       β”‚
              β”‚   β€’ Alerts       β”‚
              β”‚   β€’ History      β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Alert System Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         ALERT SYSTEM                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Temperature Reading
        β”‚
        β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Analyze β”‚
   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
        β”‚
        β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚              β”‚              β”‚              β”‚
        β–Ό              β–Ό              β–Ό              β–Ό
   < 17Β°C         17-21Β°C        21-25Β°C        > 29Β°C
        β”‚              β”‚              β”‚              β”‚
        β”‚              β”‚              β”‚              β”‚
        β–Ό              β–Ό              β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ₯Ά COLD ALERTβ”‚ β”‚   COOL   β”‚ β”‚ βœ… NORMALβ”‚ β”‚ πŸ”₯ HOT ALERT β”‚
β”‚              β”‚ β”‚          β”‚ β”‚          β”‚ β”‚              β”‚
β”‚ Hypothermia  β”‚ β”‚  Safe    β”‚ β”‚ Optimal  β”‚ β”‚ Hyperthermia β”‚
β”‚ Risk         β”‚ β”‚  Range   β”‚ β”‚ Range    β”‚ β”‚ Risk         β”‚
β”‚              β”‚ β”‚          β”‚ β”‚          β”‚ β”‚              β”‚
β”‚ Action:      β”‚ β”‚ Action:  β”‚ β”‚ Action:  β”‚ β”‚ Action:      β”‚
β”‚ β€’ Alert      β”‚ β”‚ β€’ Monitorβ”‚ β”‚ β€’ Monitorβ”‚ β”‚ β€’ Alert      β”‚
β”‚ β€’ Notify     β”‚ β”‚          β”‚ β”‚          β”‚ β”‚ β€’ Notify     β”‚
β”‚ β€’ Log        β”‚ β”‚          β”‚ β”‚          β”‚ β”‚ β€’ Log        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Alert Distribution:
β”œβ”€ 85% Normal Range (21-25Β°C)
β”œβ”€ 10% Cold Alerts (<17Β°C)
└─  5% Hot Alerts (>29Β°C)

Technical Architecture

Components:

  • Frontend: Next.js 15 with Web3 wallet connection (RainbowKit + Wagmi)
  • Backend: Node.js/Express with REST API for data decryption
  • Smart Contracts: Solidity 0.8.28 on Polkadot Paseo Hub Testnet
  • Gateway: Rust-based IoT gateway with AES-256-GCM encryption and SHA-256 signing
  • Sensor: ESP32 simulator generating realistic neonatal environment data
  • Storage: On-chain encrypted data with off-chain decryption capabilities

Key Benefits

For Parents

  • Data sovereignty and complete control over baby's information
  • Real-time alerts for abnormal temperature/humidity conditions
  • Peace of mind with 24/7 monitoring
  • Transparent and verifiable data history

For Healthcare Providers

  • Access to anonymized aggregate data for research
  • Evidence-based insights for neonatal care protocols
  • Compliance with privacy regulations
  • Immutable audit trails

For Researchers

  • Ethical access to large-scale anonymous datasets
  • Privacy-preserving analytics on encrypted data
  • Contribution to reducing neonatal mortality
  • Built-in data integrity verification

MVP Capabilities

  • Environmental Monitoring: Secure, encrypted temperature and humidity tracking
  • Real-Time Alerts: Instant notifications for critical conditions (<17Β°C or >29Β°C)
  • Statistical Research: Privacy-preserving analytics on encrypted datasets
  • Access Control: Smart contract-based permission management
  • Data Ownership: NFT-based device authentication and data ownership
  • Dashboard: Real-time visualization with historical data and trends

Roadmap

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          BAE ROADMAP                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Q1 2025: MVP LAUNCH
β”œβ”€ Target Date: January 31, 2025
β”œβ”€ Deliverables:
β”‚  β”œβ”€ βœ… Encrypted sensor data upload
β”‚  β”œβ”€ βœ… Smart contract deployment (Paseo Testnet)
β”‚  β”œβ”€ βœ… Backend decryption API
β”‚  β”œβ”€ βœ… Real-time dashboard with alerts
β”‚  └─ βœ… Basic documentation
β”œβ”€ Status: COMPLETED
└─ Metrics: 1 device, 10,000+ readings

Q2 2025: VALIDATION PHASE
β”œβ”€ Target Date: March 31, 2025
β”œβ”€ Deliverables:
β”‚  β”œβ”€ End-to-end demo: sensor β†’ blockchain β†’ dashboard
β”‚  β”œβ”€ Pilot program with 10 families
β”‚  β”œβ”€ Basic audit logging
β”‚  β”œβ”€ Compliance features (GDPR/HIPAA considerations)
β”‚  └─ Mobile app prototype
β”œβ”€ Status: IN PROGRESS
└─ Metrics: 10 devices, 3 partner families

Q3 2025: SCALE & PARTNERSHIPS
β”œβ”€ Target Date: August 31, 2025
β”œβ”€ Deliverables:
β”‚  β”œβ”€ Expand to 100 devices
β”‚  β”œβ”€ Role-based access control (RBAC)
β”‚  β”œβ”€ Partnership with 5 hospitals
β”‚  β”œβ”€ Research data platform for institutions
β”‚  β”œβ”€ Advanced analytics dashboard
β”‚  └─ Multi-language support (ES/EN/PT)
β”œβ”€ Status: PLANNED
└─ Metrics: 100 devices, 5 hospital partners

Q4 2025+: PRODUCTION & MAINNET
β”œβ”€ Target Date: December 31, 2025
β”œβ”€ Deliverables:
β”‚  β”œβ”€ Mainnet deployment (Polkadot)
β”‚  β”œβ”€ Multi-device support per household
β”‚  β”œβ”€ ML-based predictive analytics
β”‚  β”œβ”€ Integration with healthcare systems (HL7/FHIR)
β”‚  β”œβ”€ Hardware production & distribution
β”‚  └─ Grant funding secured
β”œβ”€ Status: PLANNED
└─ Metrics: 1,000+ devices, 50+ institutions

2026: REGIONAL EXPANSION
β”œβ”€ Target: Full Latin America coverage
β”œβ”€ Goals:
β”‚  β”œβ”€ 10,000 devices deployed
β”‚  β”œβ”€ 100 partner institutions
β”‚  β”œβ”€ 5% reduction in neonatal deaths (pilot areas)
β”‚  └─ 100+ research papers using BAE data
└─ Status: VISION

Business Model

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       REVENUE STREAMS                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1. DEVICE SALES
   β”œβ”€ Hardware: ESP32 sensor units
   β”œβ”€ Target Price: $50-80 USD per device
   β”œβ”€ Launch: February 2025
   β”œβ”€ Focus: Low-cost for vulnerable communities
   └─ Revenue Share: 40%

2. SUBSCRIPTION SERVICE
   β”œβ”€ Monthly monitoring & data storage
   β”œβ”€ Tiers:
   β”‚  β”œβ”€ Basic: $5/month (1 device, 30 days history)
   β”‚  β”œβ”€ Family: $10/month (3 devices, 90 days history)
   β”‚  └─ Premium: $20/month (5 devices, unlimited history + alerts)
   β”œβ”€ Beta: March 2025
   β”œβ”€ General Availability: May 2025
   └─ Revenue Share: 35%

3. RESEARCH LICENSING
   β”œβ”€ Anonymous data access for institutions
   β”œβ”€ Pricing:
   β”‚  β”œβ”€ University: $500/month (10k records/month)
   β”‚  β”œβ”€ Hospital: $1,500/month (50k records/month)
   β”‚  └─ Pharmaceutical: $5,000/month (unlimited)
   β”œβ”€ Launch: June 2025
   β”œβ”€ Compliance: Full ethical research standards
   └─ Revenue Share: 20%

4. GRANT FUNDING
   β”œβ”€ Public health organizations
   β”œβ”€ Applications: Q1 2025
   β”œβ”€ Focus: Latin American initiatives
   β”œβ”€ Target: $500k-1M in grants (2025)
   └─ Revenue Share: 5%

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     PRICING STRATEGY                                β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                    β”‚
β”‚  Hardware (One-time):        $50-80 USD                           β”‚
β”‚  Subscription (Monthly):     $5-20 USD                            β”‚
β”‚  Research License (Monthly): $500-5,000 USD                       β”‚
β”‚                                                                    β”‚
β”‚  Total Addressable Market:                                        β”‚
β”‚  β”œβ”€ Latin America: 10M+ births/year                              β”‚
β”‚  β”œβ”€ High-risk neonates: ~1.5M/year                               β”‚
β”‚  └─ Target penetration (2026): 10,000 devices (0.7%)             β”‚
β”‚                                                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Deployed Contracts

The BaeSensorRegistry contract for the current MVP has been deployed to Polkadot Paseo Hub Testnet. You can inspect transactions and contract state on BlockScout:

Live Demo

Technology Stack

Frontend

  • Next.js 15 (App Router)
  • Tailwind CSS v4
  • Viem + Wagmi (Web3)
  • RainbowKit (Wallet connection)
  • TanStack Query (Data fetching)
  • Recharts (Data visualization)

Backend

  • Node.js + Express
  • Ethers.js (Blockchain interaction)
  • Crypto (AES-256-GCM decryption)
  • CORS (Cross-origin support)

Smart Contracts

  • Solidity 0.8.28
  • Hardhat (Development framework)
  • Polkadot Paseo Testnet

IoT Gateway & Sensor

  • Rust (High-performance, memory-safe)
  • MQTT protocol (HiveMQ broker)
  • AES-256-GCM encryption
  • SHA-256 signatures
  • Deployed on Render.com

Blockchain

  • Polkadot Paseo Hub Testnet
  • EVM-compatible (Ethereum compatibility layer)
  • JSON-RPC interface

API Endpoints

Backend API (Production)

Base URL: https://bae-backend-api.onrender.com

Endpoint Method Description
/health GET Health check and service status
/api/readings/latest/decrypt GET Latest decrypted sensor reading
/api/readings/:index/decrypt GET Specific reading by index
/api/readings/history GET Paginated reading history (limit 1-100)
/api/readings/count GET Total number of readings
/api/readings/stats GET Aggregated statistics (avg, min, max, alerts)

Example Response

{
  "deviceId": "ESP32-001",
  "temperature": 23.5,
  "humidity": 55.2,
  "timestamp": 1728421234,
  "timestampDate": "2024-10-08T15:20:34.000Z",
  "blockNumber": 12345
}

Example API Usage

# Health check
curl https://bae-backend-api.onrender.com/health

# Get latest reading
curl https://bae-backend-api.onrender.com/api/readings/latest/decrypt

# Get total readings
curl https://bae-backend-api.onrender.com/api/readings/count

# Get history (last 20 readings)
curl https://bae-backend-api.onrender.com/api/readings/history?limit=20

# Get statistics
curl https://bae-backend-api.onrender.com/api/readings/stats?limit=50

Smart Contract ABI

Key functions available in the BaeSensorRegistry contract:

// Submit encrypted sensor data
function submitSensorData(
    string deviceId,
    bytes ciphertext,
    bytes nonce,
    bytes signature,
    uint256 timestamp
) external

// Get latest reading
function getLatestReading() external view returns (SensorData)

// Get total number of readings
function totalReadings() external view returns (uint256)

// Get specific reading by index
function getReading(uint256 index) external view returns (SensorData)

// Data structure
struct SensorData {
    string deviceId;
    bytes ciphertext;
    bytes nonce;
    bytes signature;
    uint256 timestamp;
    uint256 blockNumber;
}

// Event emitted on new data
event SensorDataSubmitted(
    string indexed deviceId,
    uint256 timestamp,
    uint256 blockNumber,
    uint256 index
)

Environmental Variables

Frontend (.env.local)

NEXT_PUBLIC_API_URL=https://bae-backend-api.onrender.com
NEXT_PUBLIC_RPC_URL=https://testnet-passet-hub-eth-rpc.polkadot.io
NEXT_PUBLIC_CONTRACT_ADDRESS=0xfD0b399898efC0186E32eb81B630d7Cf7Bb6f217
NEXT_PUBLIC_CHAIN_ID=420420422
NEXT_PUBLIC_NETWORK_NAME="Paseo Testnet"
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_project_id

Backend (.env)

PORT=3001
FRONTEND_URL=https://bae-frontend-plum.vercel.app
RPC_URL=https://testnet-passet-hub-eth-rpc.polkadot.io
CONTRACT_ADDRESS=0xfD0b399898efC0186E32eb81B630d7Cf7Bb6f217
ENCRYPTION_KEY=your_32_byte_hex_key
NODE_ENV=production

Gateway (.env)

RUST_LOG=info
MQTT_BROKER=broker.hivemq.com
MQTT_PORT=1883
RPC_URL=https://testnet-passet-hub-eth-rpc.polkadot.io
CONTRACT_ADDRESS=0xfD0b399898efC0186E32eb81B630d7Cf7Bb6f217
PRIVATE_KEY=your_private_key
ENCRYPTION_KEY=your_32_byte_hex_key

Documentation

  • Technical Docs: Complete architecture and integration guides available in repository
  • API Reference: Full endpoint documentation with examples
  • Smart Contract Docs: ABI and function reference
  • Security Whitepaper: Encryption and privacy model details

Contributing

We welcome contributions that help save babies' lives! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'feat: add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

All contributions require:

  • Code review and approval
  • Security assessment for sensitive components
  • Documentation updates
  • Test coverage

Report security issues: security@bae-project.io

Social Impact

BAE is committed to reducing neonatal mortality in Latin America through:

  • Accessible Technology: Low-cost IoT devices for vulnerable communities
  • Open Data: Anonymous research datasets for medical advancement
  • Community Partnerships: Collaboration with hospitals and NGOs
  • Education: Training programs for parents and healthcare workers
  • Transparency: Open-source approach with verifiable blockchain data

Target Impact (2025-2027)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      IMPACT METRICS                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                    β”‚
β”‚  2025 Goals:                                                       β”‚
β”‚  β”œβ”€ 1,000 devices deployed                                        β”‚
β”‚  β”œβ”€ 10 partner institutions                                       β”‚
β”‚  β”œβ”€ 10,000+ babies monitored                                      β”‚
β”‚  └─ 5 research publications                                       β”‚
β”‚                                                                    β”‚
β”‚  2026 Goals:                                                       β”‚
β”‚  β”œβ”€ 10,000 devices deployed                                       β”‚
β”‚  β”œβ”€ 50 partner institutions                                       β”‚
β”‚  β”œβ”€ 100,000+ babies monitored                                     β”‚
β”‚  β”œβ”€ 5% reduction in preventable deaths (pilot communities)       β”‚
β”‚  └─ 100+ research papers using BAE data                           β”‚
β”‚                                                                    β”‚
β”‚  2027 Vision:                                                      β”‚
β”‚  β”œβ”€ 50,000 devices across Latin America                          β”‚
β”‚  β”œβ”€ 200 partner institutions                                      β”‚
β”‚  β”œβ”€ 500,000+ babies monitored                                     β”‚
β”‚  β”œβ”€ 10% reduction in neonatal mortality (covered areas)          β”‚
β”‚  └─ International expansion                                        β”‚
β”‚                                                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

License

Apache 2.0 License

Important: Ensure regulatory compliance with local healthcare data protection laws before deployment. BAE is designed with privacy-first principles but must be configured according to jurisdictional requirements.

Team & Contact

BAE Team - Decentralized IoT for Neonatal Care

Acknowledgments

  • Built with support from the Polkadot ecosystem
  • Inspired by the need to reduce neonatal mortality in Latin America
  • Dedicated to all parents who have lost children during the neonatal period
  • Special thanks to healthcare professionals providing guidance on clinical requirements

BAE - Because every baby deserves a safe environment 🍼

About

Decentralized IoT + Blockchain platform for neonatal environmental monitoring using Polkadot. Real-time temperature/humidity tracking with AES-256-GCM encryption, NFT device authentication, and ethical research data sharing. Addressing 57% of infant deaths in Latin America's first 28 days.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages