Proof Of Work Specification
Abstract
A Spam and Denial of Service countermeasure. Reduce the capability of each single client to flood the server with messages.
It is not planned to be implemented for the BETA.
Scheme
- Run a Flood Control using stochastical techniques or if the server detects a suspicious connection.
- Additionally the client could send a calculation based on parameters and date/time with each query.
- Inspired by Hashcash
Protocol
- The smallest time unit could be 1 second
- A certain time period could be 1 minute
- The client requests the number of leading zeros
X
of a proper request and the currentIVserver
- The server responses
X
andIVserver
if it was generated for this time period already, else it generatesIVserver
and stores it for a time period - The client generates a random
IVclient
- The client iterates the
counter
to findhash(IVserver || IVclient || time || hash(m) || counter) = "000..."
withX
leading zeros - The client sends
IVserver || IVclient || time || hash(m) || counter || hash(IVserver || IVclient || time || hash(m) || counter) || m
- The server verifies
- that the proof of work hash begins with
X
zeros - that
(time, IVserver, IVclient)
is unique and thus not stored yet - that requested time does not differ more than a time period from current time and
IVserver
matches the time period - proof of work hash
- message hash
- that the proof of work hash begins with
- On successful verification server accepts the message and stores
(time, IVclient)
for a time period, else server rejects the message
Parameters
- X variable number of leading zeros to dynamically adapt the workload
- IVserver is generated, stored and used for a time period to prevent precomputation of PoW hashes
- IVclient to prevent reusing of drop messages during the smallest time unit;
using a server generated unique IV could lead to an overflow (e.g., see SYN flood);
storing a fix number of IVs could lead to an overflow (100 IVs:
IV_1=IV_101, IV_2=IV_102, ...
=> client can resend messages during the smallest time unit) - time to prevent reusing of drop messages
- hash(m) to bind a PoW hash to a certain message
- counter to find a well formated hash
Remote Data
The server stores its state and information on previous drop messages:
powConfig = "{"
'timePeriod' : INT,
'leadingZeros' : INT,
"}"
serverIVs = "["
serverIV*
"]"
serverIV = "{"
'periodStartTime' : LONG, //time stamp
'IV' : STR,
"}"
clientIVs = "["
clientIV*
"]"
clientIV = "{"
'transmissionTime' : LONG, //time stamp
'IV' : STR,
"}"