HxTP Protocol
HxTP is a set of rules for how devices and the cloud talk to each other. Think of it like a formal handshake â both sides agree on the rules so nothing gets lost or misunderstood.
Why Rules Matterâ
In a smart home, a misunderstood message could mean a door stays unlocked or a heater stays on when it shouldn't. HxTP makes sure every message is:
- Authentic â it came from who it says it came from
- Fresh â it wasn't recorded and replayed later
- Intact â nobody tampered with it in transit
- Ordered â messages arrive in the right sequence
The Message Formatâ
Every HxTP message is a single line with 11 pieces of information, separated by pipe characters (|):
version|device_id|tenant_id|client_id|message_id|request_id|sequence_number|timestamp|nonce|message_type|payload_hash
Here's what that looks like with real data:
HxTP/3.1|dev-789|ten-abc|cli-def|msg-123|req-456|101|1713984000|abc123|command|a1b2c3...
Each field follows strict rules so every device â from a tiny sensor to a powerful server â reads the message exactly the same way.
The 7-Step Security Checkâ
Every incoming message goes through a 7-step security check. If even one step fails, the message is rejected instantly.
- Version â Are we speaking the same language? (must be HxTP/3.1)
- Timestamp â Was this sent recently? (prevents old messages from being reused)
- Size â Is the message too big?
- Nonce â Have we seen this exact message before? (prevents replay attacks)
- Hash â Does the content match its fingerprint? (tamper check)
- Sequence â Are messages in the right order?
- Signature â Is the Ed25519 digital signature valid? (identity check)
The HELLO Handshakeâ
Before a device can do anything, it must complete a simple introduction:
Device â "Hello, my public key is X" (HELLO)
Cloud â "Hello back, I trust you" (HELLO_ACK)
Device â Now it's ACTIVE and ready
This handshake happens automatically â you never need to think about it. The device just won't respond to commands until it's complete.
Signatures (The Digital Wax Seal)â
Every message is signed with Ed25519 â the same technology used in modern secure systems. Think of it like a wax seal on an old letter:
- You seal the letter with your unique ring â nobody can open it without breaking the seal
- The recipient checks the seal â they know it's really from you
- If the seal is broken â the message is thrown away
// This is what happens behind the scenes
const signature = signEd25519(privateKey, canonicalString);
const isValid = verifyEd25519(publicKey, canonicalString, signature);
The Device Lifecycleâ
A device only accepts commands when it's ACTIVE.
Next: Learn about Security or try the Quick Start.