Crate ethash

Source
Expand description

Apache-2 licensed Ethash implementation.

Structs§

EthereumPatch
LightDAG

Constants§

ACCESSES
CACHE_BYTES_GROWTH
CACHE_BYTES_INIT
CACHE_MULTIPLIER
CACHE_ROUNDS
DATASET_BYTES_GROWTH
DATASET_BYTES_INIT
DATASET_PARENTS
FNV_PRIME
HASH_BYTES
MIX_BYTES
WORD_BYTES

Traits§

Patch

Functions§

calc_dataset_item
Calculate the dataset item.
cross_boundary
Convert across boundary. f(x) = 2 ^ 256 / x.
get_cache_size
Get the cache size required given the block number.
get_full_size
Get the full dataset size given the block number.
get_seedhash
Get the seedhash for a given block number.
hashimoto
“Main” function of Ethash, calculating the mix digest and result given the header and nonce.
hashimoto_full
Ethash used by a full client. Stores the whole dataset in memory.
hashimoto_light
Ethash used by a light client. Only stores the 16MB cache rather than the full dataset.
make_cache
Make an Ethash cache using the given seed.
make_dataset
Make an Ethash dataset using the given hash.
mine
Mine a nonce given the header, dataset, and the target. Target is derived from the difficulty.