/DynamicHashcash

Server which only allows users that verify with a valid generated hash with Client counterpart. Basic proof of work idea with dynamic difficulty of challenge based on amount of users.

Primary LanguageJavaScript

Idea

The idea is to implement a server and client where as the client has to "work" before being able to connect to the server.

How it works (Procedure on every Request)

  1. Client tries to connect to the server.
  2. Server adds 2 HTML Header Tags to the Request
	challenge	9tmfp8n0zfr	(randomly generated)
	difficulty	5			(depending on Server load)
  1. Client tries to find a String which added to the challenge String generates a SHA256-Hash which starts with 00000 (difficulty determines amount of 0's).
  2. Client adds the additional String to the HTML Response Header
	solution	hfw8aerh
  1. Server generates SHA256-Hash of both Challenge-String and Solution-String combined. If it also starts with X amount of 0's, access is granted. Else access is denied.

What is Hashcash?

Wikipedia