Module stack_test_epic_core::pow
source · [−]Expand description
The proof of work needs to strike a balance between fast header verification to avoid DoS attacks and difficulty for block verifiers to build new blocks. In addition, mining new blocks should also be as difficult on high end custom-made hardware (ASICs) as on commodity hardware or smartphones. For this reason we use Cuckoo Cycle (see the cuckoo module for more information).
Note that this miner implementation is here mostly for tests and reference. It’s not optimized for speed.
Re-exports
pub use crate::pow::cuckaroo::new_cuckaroo_ctx;
pub use crate::pow::cuckaroo::CuckarooContext;
pub use crate::pow::cuckatoo::new_cuckatoo_ctx;
pub use crate::pow::cuckatoo::CuckatooContext;
pub use crate::pow::md5::new_md5_ctx;
pub use crate::pow::md5::MD5Context;
pub use crate::pow::progpow::new_progpow_ctx;
pub use crate::pow::progpow::ProgPowContext;
pub use crate::pow::randomx::new_randomx_ctx;
pub use crate::pow::randomx::RXContext;
Modules
Implementation of Cuckaroo Cycle, based on Cuckoo Cycle designed by John Tromp. Ported to Rust from https://github.com/tromp/cuckoo.
Implementation of Cuckatoo Cycle designed by John Tromp.
Lean miner for Cuckatoo Cycle
Implementation of MD5 by Yuri Albuquerque
Structs
The difficulty is defined as the maximum target divided by the block hash.
Cuckatoo solver or validation error
Block header information pertaining to the proof of work
Enums
Traits
Operations needed for edge type (going to be u32 or u64)
Generic trait for a solver/verifier providing common interface into Cuckoo-family PoW Mostly used for verification, but also for test mining if necessary
Functions
Mines a genesis block using the internal miner
Runs a proof of work computation over the provided block using the provided Mining Worker, until the required difficulty target is reached. May take a while for a low target…
Validates the proof of work of a given header, and that the proof of work satisfies the requirements of the header.