[][src]Struct grin_core::core::block::BlockHeader

pub struct BlockHeader {
    pub version: u16,
    pub height: u64,
    pub prev_hash: Hash,
    pub prev_root: Hash,
    pub timestamp: DateTime<Utc>,
    pub output_root: Hash,
    pub range_proof_root: Hash,
    pub kernel_root: Hash,
    pub total_kernel_offset: BlindingFactor,
    pub output_mmr_size: u64,
    pub kernel_mmr_size: u64,
    pub pow: ProofOfWork,
}

Block header, fairly standard compared to other blockchains.

Fields

Version of the block

Height of this block since the genesis block (height 0)

Hash of the block previous to this in the chain.

Root hash of the header MMR at the previous header.

Timestamp at which the block was built.

Merklish root of all the commitments in the TxHashSet

Merklish root of all range proofs in the TxHashSet

Merklish root of all transaction kernels in the TxHashSet

Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for this block from the total kernel offset of the previous block header.

Total size of the output MMR after applying this block

Total size of the kernel MMR after applying this block

Proof of work and related

Methods

impl BlockHeader
[src]

Write the pre-hash portion of the header

Return the pre-pow, unhashed Let the cuck(at)oo miner/verifier handle the hashing for consistency with how this call is performed everywhere else

Total difficulty accumulated by the proof of work on this header

The "overage" to use when verifying the kernel sums. For a block header the overage is 0 - reward.

The "total overage" to use when verifying the kernel sums for a full chain state. For a full chain state this is 0 - (height * reward).

Total kernel offset for the chain state up to and including this block.

Trait Implementations

impl Writeable for BlockHeader
[src]

Serialization of a block header

impl Readable for BlockHeader
[src]

Deserialization of a block header

impl PMMRable for BlockHeader
[src]

The type of element actually stored in the MMR data file. This allows us to store Hash elements in the header MMR for variable size BlockHeaders. Read more

impl PartialEq<BlockHeader> for BlockHeader
[src]

impl Clone for BlockHeader
[src]

Performs copy-assignment from source. Read more

impl Default for BlockHeader
[src]

impl Debug for BlockHeader
[src]

Auto Trait Implementations

impl Send for BlockHeader

impl Sync for BlockHeader

Blanket Implementations

impl<W> Hashed for W where
    W: Writeable
[src]

impl<H> ShortIdentifiable for H where
    H: Hashed
[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: Writeable
[src]

impl<T> From for T
[src]

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

Should always be Self