Show / Hide Table of Contents

Interface IBlockMetadata

A common interface for blocks that do not have any proofs nor transactions (but only TxHash).

Namespace: Libplanet.Blocks
Assembly: Libplanet.dll
Syntax
public interface IBlockMetadata

Properties

| Improve this Doc View Source

Difficulty

The mining difficulty that the block's Nonce has to satisfy.

Declaration
long Difficulty { get; }
Property Value
Type Description
Int64
| Improve this Doc View Source

Index

The height of the block.

Declaration
long Index { get; }
Property Value
Type Description
Int64
Remarks

Zero means it is a genesis block. Disallowed to be negative.

| Improve this Doc View Source

Miner

The address of the miner.

Declaration
Address Miner { get; }
Property Value
Type Description
Address
| Improve this Doc View Source

PreviousHash

The previous block's hash. If it's a genesis block (i.e., its Index is 0) this should be null.

Declaration
BlockHash? PreviousHash { get; }
Property Value
Type Description
Nullable<BlockHash>
| Improve this Doc View Source

ProtocolVersion

The protocol version number.

Declaration
int ProtocolVersion { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

PublicKey

The public key of the Miner. This is used for verifying the signature.

Although this is nullable type-wise, it is mandatory where ProtocolVersion is 2 or later. As blocks had not been signed in the previous protocol versions, the type of this is nullable.

Declaration
PublicKey PublicKey { get; }
Property Value
Type Description
PublicKey
| Improve this Doc View Source

Timestamp

The time the block is created.

Declaration
DateTimeOffset Timestamp { get; }
Property Value
Type Description
DateTimeOffset
Remarks

This is always UTC.

| Improve this Doc View Source

TotalDifficulty

The total mining difficulty since the genesis including the block's Difficulty.

Declaration
BigInteger TotalDifficulty { get; }
Property Value
Type Description
BigInteger
Remarks

This must be greater than or equal to Difficulty at least, and must not be negative.

| Improve this Doc View Source

TxHash

The hash of all transactions in the block. This is null if the block has no transactions.

Declaration
HashDigest<SHA256>? TxHash { get; }
Property Value
Type Description
Nullable<HashDigest<SHA256>>

Extension Methods

BlockMetadataExtensions.Copy(IBlockMetadata)
BlockMetadataExtensions.ValidateTimestamp(IBlockMetadata)
BlockMetadataExtensions.ValidateTimestamp(IBlockMetadata, DateTimeOffset)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2021 Planetarium