PoW and mining
Last updated
Was this helpful?
Mazze uses a Proof of Work scheme backed by RandomX hashing. Mining produces a nonce that satisfies a difficulty boundary.
ProofOfWorkProblem bundles the block hash, difficulty, boundary, and seed.
ProofOfWorkSolution carries the nonce.
PowComputer computes the PoW hash with RandomX using a cached VM.
The boundary is derived from difficulty; a block is valid when pow_hash <= boundary.
PowComputer uses RandomXCacheBuilder to hold RandomX VMs and to swap context when the seed hash changes. This makes per-block hashing fast while still rotating the seed across epochs.
target_difficulty computes the next target from recent blocks, the configured block generation period, and the adjustment epoch period in ProofOfWorkConfig.
CPU - local worker threads iterate nonces.
Stratum - a job dispatcher hands work to external miners and validates submitted nonces.
Disable - mining is turned off (used for read-only nodes or some dev modes).
crates/mazzecore/core/src/pow/mod.rs
crates/mazzecore/core/src/pow/cache.rs
crates/blockgen/src/lib.rs
crates/blockgen/src/miner/stratum.rs
Last updated
Was this helpful?
Was this helpful?