Difficulty
/// The difficulty is defined as the maximum target divided by the block hash.
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Eq, Ord)]
pub struct Difficulty {
num: u64,
}
ProofOfWork
/// Block header information pertaining to the proof of work
#[derive(Clone, Debug, PartialEq)]
pub struct ProofOfWork {
/// Total accumulated difficulty since genesis block
pub total_difficulty: Difficulty,
/// Variable difficulty scaling factor fo secondary proof of work
pub secondary_scaling: u32,
/// Nonce increment used to mine this block.
pub nonce: u64,
/// Proof of work data.
pub proof: Proof,
}
Proof
/// A Cuck(at)oo Cycle proof of work, consisting of the edge_bits to get the graph
/// size (i.e. the 2-log of the number of edges) and the nonces
/// of the graph solution. While being expressed as u64 for simplicity,
/// nonces a.k.a. edge indices range from 0 to (1 << edge_bits) - 1
///
/// The hash of the `Proof` is the hash of its packed nonces when serializing
/// them at their exact bit size. The resulting bit sequence is padded to be
/// byte-aligned.
///
#[derive(Clone, PartialOrd, PartialEq)]
pub struct Proof {
/// Power of 2 used for the size of the cuckoo graph
pub edge_bits: u8,
/// The nonces
pub nonces: Vec<u64>,
}