Struct grin_core::pow::Proof [−][src]
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
Implementations
impl Proof
[src]
impl Proof
[src]pub fn new(in_nonces: Vec<u64>) -> Proof
[src]
pub fn new(in_nonces: Vec<u64>) -> Proof
[src]Builds a proof with provided nonces at default edge_bits
pub fn random(proof_size: usize) -> Proof
[src]
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]
pub fn proof_size(&self) -> usize
[src]Returns the proof size
Trait Implementations
impl PartialOrd<Proof> for Proof
[src]
impl PartialOrd<Proof> for Proof
[src]fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl DefaultHashable for Proof
[src]
impl Eq for Proof
[src]
impl StructuralPartialEq for Proof
[src]
Auto Trait Implementations
impl RefUnwindSafe for Proof
impl Send for Proof
impl Sync for Proof
impl Unpin for Proof
impl UnwindSafe for Proof
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CloneAny for T where
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
pub fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
pub fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send, Global> where
T: Send,
T: Send,
pub fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync, Global> where
T: Sync,
T: Sync,
pub fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
&self
) -> Box<dyn CloneAny + 'static + Sync + Send, Global> where
T: Send + Sync,
impl<D> Hashed for D where
D: DefaultHashable,
[src]
impl<D> Hashed for D where
D: DefaultHashable,
[src]impl<T> PMMRIndexHashable for T where
T: DefaultHashable,
[src]
impl<T> PMMRIndexHashable for T where
T: DefaultHashable,
[src]pub fn hash_with_index(&Self, u64) -> Hash
[src]
pub fn hash_with_index(&Self, u64) -> Hash
[src]Hash with a given index
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]pub fn short_id(&Self, &Hash, u64) -> ShortId
[src]
pub 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> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
T: Any,