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
Xof a proper request and the currentIVserver - The server responses
XandIVserverif it was generated for this time period already, else it generatesIVserverand stores it for a time period - The client generates a random
IVclient - The client iterates the
counterto findhash(IVserver || IVclient || time || hash(m) || counter) = "000..."withXleading 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
Xzeros - 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
IVservermatches 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,
"}"