Phase 1: Implement PoW algorithm #1

Merged
krendelhoff merged 14 commits from phase-1-pow into master 2025-08-22 15:57:21 +03:00
Showing only changes of commit 7d521cfccf - Show all commits

View file

@ -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"
},