Skip to content

sjorsvanheuveln/hashcash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashcash

Implementation of Adam Back's hashcash. By using the SHA1 hashing function which is deterministic and produces random results, we can use it as a proof of work that calculation was done to find a solution with a specific difficulty. Hashcash was invented as a anti spam/ddos technology. PoW was later implemented into the Bitcoin protocol.

Adam Back

How to use

Run test.py and:

  1. Set a challenge and difficulty (higher number, the more difficult)
  2. Mint the token
  3. Verify the token against the difficulty.

Difficulty

Difficulty is defined as producing a hash from a challenge and token that has 'n' trailing zeroes in binary.

Mining and Verification

The proof of work is expensive, but the solutions are easy to verify. This idea was put into the Bitcoin protocol as new blocks need to mined through expensive calculation but can be easily verified.

About

A Python implementation of Adam Back's hashcash.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages