4 ms·
Here's a really simple proof of work system: during connection, the server tells the client some randomly generated bytes and a number of bits, and then the cli
by AgentME 11y ago
Here's a really simple proof of work system: during connection, the server tells the client some randomly generated bytes and a number of bits, and then the client has to come up with a string whose MD5 hash (or whatever algorithm you want to use) has its first N bits match the first N bits of the bytestring that the server gave.
It's easy for the server to adjust the difficulty of the proof-of-work: it just needs to given a larger bitcount to force the client to match a longer prefix.
- chmike 11y agoHow is the client expected to proceed ? Should it try a,b, ... aa, ab, ... ? Couldn't a rainbow table allow to cheat with such algorithm ? It seam that the computation of a MAC or an encryption where the key serves as salt could prevent such cheating. But this computations are now hardcoded in the cpu which won't be the same proof of work for everybody.
- nindalf 11y agoIts not possible to maintain a rainbow table because the server would specify the string to start with. Server sends "randomstringthatalsoreferencescurrenttime" Client needs to add strings to this such that the MD5 hash of the result has the first N bits as 0 where N specifies the difficulty. The client is expected to send what it added to the server's string and the server verifies the proof of work.
- AgentME 11y agoOh, I left that out of my description. Having the server specify the salt or the text required to be at the front of the value to be hashed does make things better.