This page is a proof of concept of using Web Workers to calculate a so-called 'proof of work'. A proof of work is a solution to a mathematical problem that can only be solved using trial-and-error; showing that you have found the solution is proof that you have performed a certain amount of computation (in reality, sometimes you 'get lucky' and find a solution fast, and sometimes it takes much longer; the average amount of work required however can be decided upon in advance).
Proofs of work can be used to prevent spam (e.g. on form submissions, e-mails, et cetera). Traditional CAPTCHAs prevent spam by exploiting the fact that computers cannot solve a particular problem easily, and that humans that can solve them are scarce/expensive/slow (but available in the regular use case). Proof of work, by contrast, exploits the fact that computational resources are scarce. While non-spamming users will typically have the resources to perform the computation once in reasonable time, spammers will have difficulty finding the resources to compute many proofs of work required to submit their spam. By requiring a 'proof of work' from the client before accepting any data, spammers are thus effectively blocked.
Using Web Workers, the proof of work computation can be performed in standard browsers in the background, while efficiently utilizing available computing power. This demo will attempt to spawn four worker threads (most browsers seem to be able to saturate four cores with this).
Tommy van der Vorst (Pixelspark), 2014