From 7d521cfccf9b1eda1f3eee2af79c6d47c56007e5 Mon Sep 17 00:00:00 2001 From: Savely Krendelhoff Date: Fri, 22 Aug 2025 17:10:23 +0700 Subject: [PATCH] Update protocol spec --- docs/PROTOCOL.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/PROTOCOL.md b/docs/PROTOCOL.md index 1c27038..aa104d5 100644 --- a/docs/PROTOCOL.md +++ b/docs/PROTOCOL.md @@ -97,22 +97,20 @@ All protocol messages use a binary format with the following structure: - **Format**: ```json { - "id": "challenge_unique_id", "timestamp": 1640995200, "difficulty": 4, - "resource": "192.168.1.100:8080", + "resource": "quotes", "random": "a1b2c3d4e5f6", "hmac": "base64url_encoded_signature" } ``` **Field Descriptions**: -- **id**: Unique identifier for this challenge - **timestamp**: Unix timestamp when challenge was created - **difficulty**: Number of leading zero bits required in solution hash -- **resource**: Server resource identifier (typically IP:port) +- **resource**: Server resource identifier (e.g., "quotes") - **random**: Random hex string for challenge uniqueness -- **hmac**: HMAC-SHA256 signature of canonical challenge fields +- **hmac**: HMAC-SHA256 signature of canonical challenge fields (also serves as unique identifier) **Security Notes**: - Server is **stateless**: no need to store challenges locally @@ -126,10 +124,9 @@ All protocol messages use a binary format with the following structure: ```json { "challenge": { - "id": "challenge_unique_id", "timestamp": 1640995200, "difficulty": 4, - "resource": "192.168.1.100:8080", + "resource": "quotes", "random": "a1b2c3d4e5f6", "hmac": "base64url_encoded_signature" },