Proof of Work
KayakNet uses Proof-of-Work (PoW) as an anti-Sybil mechanism to prevent attackers from creating many fake nodes.
What is Proof of Work?
PoW requires nodes to solve a computational puzzle before joining the network. This makes creating many identities expensive.
How It Works
Challenge-Response
New Node Existing Node
│ │
│──────── Connect ───────────▶│
│ │
│◀─────── Challenge ──────────│
│ (random bytes, difficulty) │
│ │
│ [Compute solution] │
│ │
│──────── Solution ──────────▶│
│ │
│◀─────── Accepted ───────────│
│ (join network) │
│ │The Puzzle
Find a nonce such that:
Where:
challenge= Random 32 bytes from servernonce= 64-bit number found by nodeD= Difficulty (number of zero bits required)HASH= BLAKE2b-256
Example
Configuration
Default Settings
Difficulty
20
Leading zero bits
Timeout
60s
Max time to solve
Expiry
5min
Challenge validity
Adjusting Difficulty
Time to Solve
16
~100ms
Modern CPU
20
~500ms
Modern CPU
24
~10s
Modern CPU
28
~2min
Modern CPU
Security Properties
What PoW Prevents
Sybil Attacks - Creating many fake nodes is expensive
Spam - Sending many messages requires many nodes
Eclipse Attacks - Surrounding target needs many nodes
Cost Analysis
To create 1000 fake nodes:
Difficulty 20: ~500 seconds of CPU time
Difficulty 24: ~3 hours of CPU time
Plus electricity cost
What PoW Doesn't Prevent
Well-funded attackers - Can afford computation
Botnet operators - Free computing power
ASIC attacks - Specialized hardware
Implementation Details
Hash Function
Using BLAKE2b for:
Speed (faster than SHA-256)
Security (256-bit output)
ASIC resistance (memory-hard)
Nonce Search
Verification
Challenge Management
Challenge Generation
Challenge Storage
Challenges are stored with:
Timestamp (for expiry)
Node public key (to prevent reuse)
One-time use flag
Rate Limiting
Additional protection:
Max 5 challenges per IP per minute
Failed attempts increase cooldown
IP banning for excessive failures
Alternatives Considered
Why Not Proof of Stake?
Requires cryptocurrency
Complexity for users
Chicken-egg problem
Why Not CAPTCHA?
Requires human interaction
Not automatable
Centralized verification
Why Not Trust on First Use?
Initial join could be Sybil
No cost to create nodes
Easy to abuse
Future Improvements
Planned
Adaptive Difficulty - Adjust based on network size
Memory-Hard PoW - Better ASIC resistance
Stake + PoW - Hybrid approach
Research
Proof of Space-Time
VDF (Verifiable Delay Functions)
Social trust graphs
Last updated

