[][src]Struct snarkos_objects::block_header::BlockHeader

pub struct BlockHeader {
    pub previous_block_hash: BlockHeaderHash,
    pub merkle_root_hash: MerkleRootHash,
    pub pedersen_merkle_root_hash: PedersenMerkleRootHash,
    pub proof: ProofOfSuccinctWork,
    pub time: i64,
    pub difficulty_target: u64,
    pub nonce: u32,
}

Block header.

Fields

previous_block_hash: BlockHeaderHash

Hash of the previous block - 32 bytes

merkle_root_hash: MerkleRootHash

Merkle root representing the transactions in the block - 32 bytes

pedersen_merkle_root_hash: PedersenMerkleRootHash

Merkle root of the transactions in the block using a Pedersen hash - 32 bytes

proof: ProofOfSuccinctWork

Proof of Succinct Work

time: i64

The block timestamp is a Unix epoch time (UTC) when the miner started hashing the header (according to the miner). - 8 bytes

difficulty_target: u64

Proof of work algorithm difficulty target for this block - 8 bytes

nonce: u32

Nonce for solving the PoW puzzle - 4 bytes

Implementations

impl BlockHeader[src]

pub const fn size() -> usize[src]

pub fn serialize(&self) -> [u8; 1088][src]

pub fn deserialize(bytes: &[u8; 1088]) -> Self[src]

pub fn get_hash(&self) -> BlockHeaderHash[src]

pub fn to_difficulty_hash(&self) -> u64[src]

Trait Implementations

impl Clone for BlockHeader[src]

impl Debug for BlockHeader[src]

impl<'de> Deserialize<'de> for BlockHeader[src]

impl Eq for BlockHeader[src]

impl FromBytes for BlockHeader[src]

impl PartialEq<BlockHeader> for BlockHeader[src]

impl Serialize for BlockHeader[src]

impl StructuralEq for BlockHeader[src]

impl StructuralPartialEq for BlockHeader[src]

impl ToBytes for BlockHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,