[−][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]
impl Proof
pub fn new(in_nonces: Vec<u64>) -> Proof
[src]
pub fn new(in_nonces: Vec<u64>) -> Proof
Builds a proof with provided nonces at default edge_bits
pub fn zero(proof_size: usize) -> Proof
[src]
pub fn zero(proof_size: usize) -> Proof
Builds a proof with all bytes zeroed out
pub fn random(proof_size: usize) -> Proof
[src]
pub fn random(proof_size: usize) -> Proof
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
Returns the proof size
Trait Implementations
impl Writeable for Proof
[src]
impl Writeable for Proof
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
[src]
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>
Write the data held by this Writeable to the provided writer
impl Readable for Proof
[src]
impl Readable for Proof
fn read(reader: &mut dyn Reader) -> Result<Proof, Error>
[src]
fn read(reader: &mut dyn Reader) -> Result<Proof, Error>
Reads the data necessary to this Readable from the provided reader
impl PartialOrd<Proof> for Proof
[src]
impl PartialOrd<Proof> for Proof
fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Proof) -> bool
[src]
fn lt(&self, other: &Proof) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Proof) -> bool
[src]
fn le(&self, other: &Proof) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Proof) -> bool
[src]
fn gt(&self, other: &Proof) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Proof) -> bool
[src]
fn ge(&self, other: &Proof) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<Proof> for Proof
[src]
impl PartialEq<Proof> for Proof
fn eq(&self, other: &Proof) -> bool
[src]
fn eq(&self, other: &Proof) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Proof) -> bool
[src]
fn ne(&self, other: &Proof) -> bool
This method tests for !=
.
impl Clone for Proof
[src]
impl Clone for Proof
fn clone(&self) -> Proof
[src]
fn clone(&self) -> Proof
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Eq for Proof
[src]
impl Eq for Proof
impl Debug for Proof
[src]
impl Debug for Proof
Auto Trait Implementations
Blanket Implementations
impl<W> Hashed for W where
W: Writeable,
[src]
impl<W> Hashed for W where
W: Writeable,
fn hash(&Self) -> Hash
[src]
fn hash(&Self) -> Hash
Obtain the hash of the object
fn hash_with<T>(&Self, T) -> Hash where
T: Writeable,
[src]
fn hash_with<T>(&Self, T) -> Hash where
T: Writeable,
Hash the object together with another writeable object
impl<H> ShortIdentifiable for H where
H: Hashed,
[src]
impl<H> ShortIdentifiable for H where
H: Hashed,
fn short_id(&Self, &Hash, u64) -> ShortId
[src]
fn short_id(&Self, &Hash, u64) -> ShortId
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, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 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> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self