Skip to content
/ ethash Public

C/C++ implementation of Ethash and ProgPoW – the Ethereum Proof of Work algorithms

License

Notifications You must be signed in to change notification settings

chfast/ethash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7cac303 · Feb 14, 2025
Sep 12, 2023
Apr 3, 2023
Feb 13, 2025
Apr 3, 2023
Feb 13, 2025
Apr 3, 2023
Feb 13, 2025
Oct 8, 2018
Sep 10, 2023
Jun 11, 2019
Feb 14, 2025
Feb 13, 2025
Feb 21, 2018
Jun 11, 2019
Apr 3, 2023
Feb 13, 2025
Feb 13, 2025
Dec 8, 2020
Feb 13, 2025
Feb 13, 2025

Repository files navigation

Ethash

readme style standard GitPOAP Badge

C/C++ implementation of Ethash – the Ethereum Proof of Work algorithm

Table of Contents

Install

Build from source using CMake.

mkdir build
cd build
cmake ..
cmake --build .

Usage

See ethash.hpp for a list of exported functions and documentation.

Optimizations

This section describes the optimizations, modifications and tweaks applied in this library in relation to Ethash reference implementation.

The library contains a set of micro-benchmarks.Build and run the ethash-bench tool.

Seed hash is computed on the fly.

Seed hash is a sequence of keccak256 hashes applied the epoch number of times. Time needed to compute seed hash is negligible compared to time needed to build light cache. Computing seed hash for epoch 10000 takes ~ 5 ms, building light cache for epoch 1 takes ~ 500 ms.

Dataset size is computed on the fly

Computing the size of the full dataset and light cache requires finding the largest prime number given an upper bound. For similar reasons as with seed hash, this is computed on the fly. The procedure used is quite naive and forks well only up to 40-bit number, so some additional improvement can be done in the future.

Maintainer

Paweł Bylica @chfast

License

Licensed under the Apache License, Version 2.0.