Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Latest commit

 

History

History
83 lines (63 loc) · 1.64 KB

File metadata and controls

83 lines (63 loc) · 1.64 KB

🧠 IoTIVP-Core v1.5

Structured JSON + Deterministic Hashing

IoTIVP-Core translates raw IoTIVP-Binary packets into a standardized JSON format.
It defines the trusted sensor packet schema shared across the ecosystem.


🧩 Core JSON Structure

{
  "header": 1,
  "timestamp": 1732212000,
  "device_id": 42,
  "nonce": 7,
  "fields": {
    "temperature": 23.5,
    "humidity": 60,
    "battery": 91
  },
  "hash": "baf24977"
}

🔐 Deterministic Hashing Pipeline (v1.5)

hash_input =
    header
  + timestamp
  + device_id
  + sorted(fields)
  + nonce
  + secret

Hash output: 4–8 bytes, BLAKE2s recommended.


🔧 Python Example: Compute Hash

from iotivp_core_hash import compute_core_hash

hash_hex = compute_core_hash(
    packet_json,
    secret=b"demo-secret",
    hash_len=4
)

print("hash:", hash_hex)

📘 Features

  • ✔ Stable cross-system JSON representation
  • ✔ Deterministic hashing
  • ✔ TLV → field mapping rules
  • ✔ Ideal for cloud, dashboards, robotics

🧱 Ideal For

  • AI/ML robotics decision loops
  • Cloud aggregators (AWS/GCP/CF Workers)
  • Sensor dashboards
  • n8n automations

IoTIVP-Core is the “source of truth” before verification.