[PHASE-7] Update the protocol

This commit is contained in:
Savely Krendelhoff 2025-08-23 13:24:31 +07:00
parent 65945d34c0
commit e9f60136ef
No known key found for this signature in database
GPG key ID: F70DFD34F40238DE

View file

@ -31,27 +31,37 @@ For detailed analysis of alternative PoW algorithms and comprehensive justificat
## Protocol Flow
### Successful Flow
### Challenge Request Flow
```
Client Server
| |
|-------- CHALLENGE_REQUEST ------------->|
| |
|<------- CHALLENGE_RESPONSE -------------| (HMAC-signed)
| |
[Connection closes]
```
### Solution Submission Flow
```
Client Server
| |
|-------- SOLUTION_REQUEST -------------->|
| |
|<------- QUOTE_RESPONSE -----------------| (if solution valid)
| |
[Connection closes]
```
### Error Flow
```
Client Server
|-------- CHALLENGE_REQUEST ------------->|
|<------- CHALLENGE_RESPONSE -------------|
| |
|-------- SOLUTION_REQUEST (invalid) ---->|
| |
|<------- ERROR_RESPONSE -----------------| (if solution invalid)
| |
[Connection closes]
```
## Message Format
@ -252,12 +262,21 @@ Server verifies solutions through the following steps:
## Connection Management
### Connection Lifecycle
The protocol uses separate TCP connections for challenge requests and solution submissions:
#### Challenge Request:
1. **Connect**: Client establishes TCP connection to server
2. **Challenge**: Client requests and receives HMAC-signed challenge
3. **Solve**: Client solves PoW challenge offline (can take time)
4. **Submit**: Client submits solution with challenge proof
5. **Receive**: Client receives quote (if valid) or error (if invalid)
6. **Disconnect**: Connection closes automatically after response
2. **Request**: Client sends CHALLENGE_REQUEST
3. **Receive**: Client receives CHALLENGE_RESPONSE with HMAC-signed challenge
4. **Disconnect**: Connection closes automatically
#### Solution Submission:
1. **Solve**: Client solves PoW challenge offline
2. **Connect**: Client establishes new TCP connection to server
3. **Submit**: Client sends SOLUTION_REQUEST with challenge and nonce
4. **Receive**: Client receives QUOTE_RESPONSE or ERROR_RESPONSE
5. **Disconnect**: Connection closes automatically
### Timeouts and Limits