[−][src]Struct grin_core::pow::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.
Fields
edge_bits: u8
Power of 2 used for the size of the cuckoo graph
nonces: Vec<u64>
The nonces
Methods
impl Proof
[src]
pub fn new(in_nonces: Vec<u64>) -> Proof
[src]
Builds a proof with provided nonces at default edge_bits
pub fn zero(proof_size: usize) -> Proof
[src]
Builds a proof with all bytes zeroed out
pub fn random(proof_size: usize) -> Proof
[src]
Builds a proof with random POW data, needed so that tests that ignore POW don't fail due to duplicate hashes
pub fn proof_size(&self) -> usize
[src]
Returns the proof size
Trait Implementations
impl DefaultHashable for Proof
[src]
impl Writeable for Proof
[src]
impl Readable for Proof
[src]
impl PartialOrd<Proof> for Proof
[src]
fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
[src]
fn lt(&self, other: &Proof) -> bool
[src]
fn le(&self, other: &Proof) -> bool
[src]
fn gt(&self, other: &Proof) -> bool
[src]
fn ge(&self, other: &Proof) -> bool
[src]
impl PartialEq<Proof> for Proof
[src]
impl Clone for Proof
[src]
fn clone(&self) -> Proof
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for Proof
[src]
impl Debug for Proof
[src]
impl Serialize for Proof
[src]
Auto Trait Implementations
Blanket Implementations
impl<D> Hashed for D where
D: DefaultHashable,
[src]
D: DefaultHashable,
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]
H: Hashed,
fn short_id(&Self, &Hash, u64) -> ShortId
[src]
Generate a short_id via the following -
- extract k0/k1 from block_hash hashed with the nonce (first two u64
values) * initialize a siphasher24 with k0/k1
- self.hash() passing in the siphasher24 instance
- drop the 2 most significant bytes (to return a 6 byte short_id)
impl<T> PMMRIndexHashable for T where
T: DefaultHashable,
[src]
T: DefaultHashable,
fn hash_with_index(&Self, u64) -> Hash
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self