The Proof-of-Work Challenge That Melted Mobile Batteries
The Proof-of-Work Challenge That Melted Mobile Batteries
Your decentralized messaging network exposes an anonymous public relay endpoint (/api/v1/relay/broadcast) where users submit encrypted messages without user accounts or IP tracking. To prevent spam flooding and Sybil attacks without compromising privacy, the protocol implements a client-side Hashcash Proof-of-Work (PoW) challenge: before submitting a message, the client must compute a SHA-256 hash collision with 20 leading zero bits ( hash evaluations on average). While this successfully deters casual spam bots, customer satisfaction plummets among real users on mobile devices: on an iPhone 11 or budget Android phone, solving the 20-bit challenge takes 12-18 seconds, causes noticeable thermal throttling, and rapidly drains battery life. Meanwhile, professional spammers utilizing cloud GPU clusters (Nvidia RTX 4090s or AWS spot instances) compute the same 20-bit SHA-256 solution in under 8 milliseconds, allowing them to flood the relay at 5,000 messages/second for pennies an hour. You are tasked with analyzing this fundamental hardware asymmetry and redesigning the client-side Proof-of-Work challenge using dynamic difficulty adjustment and memory-hard algorithms.
The Proof-of-Work Challenge That Melted Mobile Batteries
Your decentralized messaging network exposes an anonymous public relay endpoint (/api/v1/relay/broadcast) where users submit encrypted messages without user accounts or IP tracking. To prevent spam flooding and Sybil attacks without compromising privacy, the protocol implements a client-side Hashcash Proof-of-Work (PoW) challenge: before submitting a message, the client must compute a SHA-256 hash collision with 20 leading zero bits ( hash evaluations on average). While this successfully deters casual spam bots, customer satisfaction plummets among real users on mobile devices: on an iPhone 11 or budget Android phone, solving the 20-bit challenge takes 12-18 seconds, causes noticeable thermal throttling, and rapidly drains battery life. Meanwhile, professional spammers utilizing cloud GPU clusters (Nvidia RTX 4090s or AWS spot instances) compute the same 20-bit SHA-256 solution in under 8 milliseconds, allowing them to flood the relay at 5,000 messages/second for pennies an hour. You are tasked with analyzing this fundamental hardware asymmetry and redesigning the client-side Proof-of-Work challenge using dynamic difficulty adjustment and memory-hard algorithms.
Provide 1–2 precise sentences for each architectural dimension. Each box guides you on what staff-level interviewers evaluate.
Define SLA targets, hard consistency constraints, and conditions the system must never violate.
Quantify throughput (QPS/RPS), read:write ratios, and peak burst multipliers.
Step-by-step path: client ingress → API gateway → queues → background workers → persistence.
Database engine, table schema, partition keys (PK/SK), and durability strategy.
What resource hits saturation first under 10x traffic? (CPU, disk IOPS, connection pools, network).
Worker crashes, network partitions, split-brain, poison pill DLQ, retries, and idempotency.
What did you sacrifice in exchange and why? (e.g. eventual consistency vs latency, cost vs redundancy).