https://github.com/digitalbazaar/equihash
Equihash Proof of Work for Node.js
https://github.com/digitalbazaar/equihash
cryptocurrency cryptography equihash proof-of-work
Last synced: 5 months ago
JSON representation
Equihash Proof of Work for Node.js
- Host: GitHub
- URL: https://github.com/digitalbazaar/equihash
- Owner: digitalbazaar
- License: mit
- Created: 2017-07-05T17:43:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-03T21:26:22.000Z (about 8 years ago)
- Last Synced: 2025-04-19T11:08:37.641Z (6 months ago)
- Topics: cryptocurrency, cryptography, equihash, proof-of-work
- Language: C++
- Homepage: https://www.internetsociety.org/sites/default/files/blogs-media/equihash-asymmetric-proof-of-work-based-generalized-birthday-problem.pdf
- Size: 109 KB
- Stars: 10
- Watchers: 14
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Equihash Proof of Work for Node
[](https://ci.digitalbazaar.com/job/equihash)
Equihash is a tunable asymmetric proof of work algorithm where it is difficult
to generate a proof, but easy to verify one. The algorithm makes it difficult
to build custom hardware to generate the proof by ensuring forced CPU and
memory trade offs. The algorithm is useful for cryptocurrency mining as
well as building solutions that require a proof of work capability.## Installation
```
npm install equihash
```## The Equihash API
- solve(input, options, callback(err, proof))
- verify(input, proof)## Usage Example
```javascript
const equihash = require('equihash')('khovratovich');// input seed for equihash (up to 512 bits)
const input = crypto.createHash('sha256').update('test1234', 'utf8').digest();
const options = {
n: 90,
k: 5
}equihash.solve(input, options, (err, proof) => {
if(err) {
return console.log('Failed to generate proof:', err);
}console.log('Equihash proof:', proof)
console.log('Valid proof? ', equihash.verify(input, proof));
});
```## Test Suite
```
npm install
npm run test
```