On August 1, 2002, Adam Back officially presented the Hashcash paper, a precursor to the system used in Bitcoin mining.
In 1997, Adam Back, a British cryptographer and cypherpunk, proposed Hashcash, a mechanism designed to combat email spam and denial-of-service (DoS) attacks. It was a proof-of-work algorithm that required a certain amount of computational work to send an email, making spam sending uneconomical.
Five years later, on August 1, 2002, Back more formally described the functioning of Hashcash in the paper “Hashcash – A Denial of Service Counter-Measure,” which would later be cited in the Bitcoin white paper.
How Hashcash works
The underlying idea was to make sending emails costly in terms of computing power, thus discouraging the mass sending of spam messages.
The operation was as follows:
- Hash calculation: the sender had to calculate the hash of the email text plus a random number called a nonce;
- Search for the correct nonce: the process was repeated with different nonces until finding a hash that started with a certain number of zeros. The only way to find the correct nonce was through brute force operations, meaning making many attempts until reaching the desired result. By modifying the number of zeros required, the difficulty of finding the correct nonce for the sender changed, and thus also the computational resources used.
- Quick verification: the recipient could easily verify the validity of the hash by counting the number of initial zeros.
Initially, the hashing algorithm used in Hashcash was SHA-1. Example of searching for the correct nonce:
SHA1(“Here we go!00”) = 2bf6d36bf9b140c2a62c66d79f6bd578dccdc141
SHA1(“Here we go!01”) = cd7810e0446a26b4a4e7c1773989050d9fe798a2
SHA1(“Here we go!02”) = 3fbf1f91e1a212c66f65786040bb25cc91f4598b
SHA1(“Here we go!03”) = 2ad11aff9dd50f5e8641862638db2ff8420b89b8
SHA1(“Here we go!04”) = 173ba0b3dc1adbce286c4ba9ea62199ab659e608
SHA1(“Here we go!05”) = 076174d1a153e87da3248278132b007cf6adb701
In practice, Hashcash made the computational cost negligible for those sending a limited number of emails as it only required a few seconds of processing on a normal computer, while it became prohibitive for those trying to send millions of spam emails.
The use in Bitcoin mining
Hashcash laid the foundation for other technologies based on proof-of-work.
Bitcoin mining is certainly one of the main applications of Hashcash. Unlike emails, mining uses the SHA-256 hashing algorithm.