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

TangYewLabs/IoTIVP-Binary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧬 IoTIVP-Binary v1.0

Ultra-Light IoT Wire Format (TLV + Hash Footer)

IoTIVP-Binary defines the raw bytes-on-wire format for the IoTIVP ecosystem.
It is engineered for:

  • Low-power devices (ESP32, RP2040, STM32)
  • LoRa, BLE, UWB, WiFi, Sub-GHz
  • Robotics & sensors
  • Environments requiring integrity with minimal overhead

📦 Packet Structure

+---------+------------+-----------+-----------+--------+--------+
| Header  | Timestamp  | Device ID | TLV Block | Nonce  |  Hash  |
+---------+------------+-----------+-----------+--------+--------+
   1B       2–4B         1–4B        variable    0–2B     4–8B

TLV = Type • Length • Value

This provides unlimited flexibility for custom sensors.

Type Meaning Value Format
0x01 Temperature int16 fixed-point
0x02 Humidity uint8
0x03 Battery uint8
... Extend freely Custom

🔐 Hash Footer

The final bytes are a BLAKE2s or SHA-256 truncated hash:

hash = blake2s(header + timestamp + id + tlv + nonce + secret)

Length: 4–8 bytes depending on profile.


🧩 Python Example: Encode

from iotivp_binary import BinaryConfig, encode_packet

cfg = BinaryConfig(
    timestamp_len=2,
    device_id_len=2,
    nonce_len=1,
    hash_len=4,
    hash_alg="blake2s"
)

packet = encode_packet(
    header=0x01,
    timestamp=512,
    device_id=42,
    tlv_fields=[
        (0x01, (235).to_bytes(2, "big")),   # temperature
    ],
    nonce=7,
    cfg=cfg
)

print(packet.hex())

🔍 Python Example: Decode

from iotivp_binary import decode_packet

decoded = decode_packet(packet_bytes, cfg=cfg)
print(decoded)

📘 Features

  • ✔ Ultra-low overhead
  • ✔ MCU-friendly
  • ✔ Cryptographic integrity
  • ✔ TLV extensibility
  • ✔ Deterministic layout for firmware

🧱 Ideal For

  • LoRaWAN payloads
  • BLE/Bluetooth LE advertisements
  • Robotics control sensors
  • Satellite IoT links
  • Mobile asset tags

IoTIVP-Binary powers the entire IoTIVP integrity pipeline.

About

Ultra-light IoT binary packet format for secure, low-power devices. Supports TLV encoding, compact hashing, and integrity-focused design for BLE, LoRa, WiFi, UWB, and robotics systems.

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors