Ixian SDK
IXICore.BlockHeader Class Reference

An Ixian DLT Block Header. A block header contains the minimum required data needed for transaction inclusion verification. More...

Public Member Functions

 BlockHeader ()
 
 BlockHeader (Block block)
 Copies the given block's header More...
 
 BlockHeader (byte[] bytes)
 Reconstructs a BlockHeader from the bytestream. See also getBytes. More...
 
byte [] getBytes ()
 Retrieves the block header in its serialized, 'byte stream' format. See also BlockHeader(byte[] bytes). More...
 
byte [] calculateChecksum ()
 Calculates the blockChecksum of the DLT Block header, using the relevant fields. More...
 
bool Equals (BlockHeader bh)
 Checks if the two blockheaders are exactly equal. More...
 

Public Attributes

List< string > transactions = new List<string> { }
 The list of transactions which should act on the WalletState from the previous block to produce the WalletState for this block. More...
 
int version = 0
 Block version. More...
 
byte [] blockChecksum = null
 Checksum of all the data in the block. This value serves as the basis for block signatures since no block contents may be changed without affecting the block checksum. More...
 
byte [] lastBlockChecksum = null
 Checksum of the previous block, so that accepting a new block indirectly confirms and validates all past blocks. This is the basic functionality of DLT. More...
 
byte [] walletStateChecksum = null
 Checksum of the WalletState after the transactions in this block are applied to the WalletState from the previous block. More...
 
byte [] signatureFreezeChecksum = null
 Checksum of the final list of signatures for block blockNum - 5. More...
 
Dictionary< ulong, SuperBlockSegmentsuperBlockSegments = new Dictionary<ulong, SuperBlockSegment>()
 List of blocks and their checksums - used only in the superblock functionality. More...
 
byte [] lastSuperBlockChecksum = null
 Checksum of the previous superblock - used only in superblock functionality. More...
 
ulong lastSuperBlockNum = 0
 Block height of the previous superblock - used only in superblock functionality. More...
 
ulong difficulty = 0
 Ixian Hybrid PoW difficulty value. More...
 

Properties

ulong blockNum [get, set]
 Block height (block number). This is a sequential index in the blockchain which uniquely identifies each block. More...
 

Detailed Description

An Ixian DLT Block Header. A block header contains the minimum required data needed for transaction inclusion verification.

Definition at line 15 of file BlockHeader.cs.

Constructor & Destructor Documentation

◆ BlockHeader() [1/3]

IXICore.BlockHeader.BlockHeader ( )

Definition at line 84 of file BlockHeader.cs.

◆ BlockHeader() [2/3]

IXICore.BlockHeader.BlockHeader ( Block  block)

Copies the given block's header

Parameters
blockSource block.

Definition at line 95 of file BlockHeader.cs.

◆ BlockHeader() [3/3]

IXICore.BlockHeader.BlockHeader ( byte []  bytes)

Reconstructs a BlockHeader from the bytestream. See also getBytes.

Each block header has a getBytes() function which serializes the block header data into a byte buffer, suitable for sending over the network. This constructor can re-create the block headerfrom the given bytestream.

Parameters
bytesBlock header bytes, usually received from the network.

Definition at line 155 of file BlockHeader.cs.

Member Function Documentation

◆ calculateChecksum()

byte [] IXICore.BlockHeader.calculateChecksum ( )

Calculates the blockChecksum of the DLT Block header, using the relevant fields.

Returns
Byte value of the checksum result.

Definition at line 323 of file BlockHeader.cs.

◆ Equals()

bool IXICore.BlockHeader.Equals ( BlockHeader  bh)

Checks if the two blockheaders are exactly equal.

Parameters
bhOther blockheader.
Returns
True if both objects represent the same Ixian transaction.

Definition at line 385 of file BlockHeader.cs.

◆ getBytes()

byte [] IXICore.BlockHeader.getBytes ( )

Retrieves the block header in its serialized, 'byte stream' format. See also BlockHeader(byte[] bytes).

A block header can be serialized for network transmission using this function. All relevant fields will be encoded and a byte buffer will be returned. The byte buffer contains a copy of the block header, so no thread synchronization is required.

Returns
Byte buffer with the serialized block header.

Definition at line 240 of file BlockHeader.cs.

Member Data Documentation

◆ blockChecksum

byte [] IXICore.BlockHeader.blockChecksum = null

Checksum of all the data in the block. This value serves as the basis for block signatures since no block contents may be changed without affecting the block checksum.

Definition at line 39 of file BlockHeader.cs.

◆ difficulty

ulong IXICore.BlockHeader.difficulty = 0

Ixian Hybrid PoW difficulty value.

Ixian Blockchain works on a consensus model and mining is not strictly required. An optional mining system is included to enable initial coin supply distribution. The mining algorithm is Argon2id and the solutions are not included in blocks themselves. There is a special Transaction type which submits a solution to a block. Miners are able to work on any block in the Redacted History window, with the target block specifying its difficulty to which the posted solution must conform.

Definition at line 82 of file BlockHeader.cs.

◆ lastBlockChecksum

byte [] IXICore.BlockHeader.lastBlockChecksum = null

Checksum of the previous block, so that accepting a new block indirectly confirms and validates all past blocks. This is the basic functionality of DLT.

Definition at line 43 of file BlockHeader.cs.

◆ lastSuperBlockChecksum

byte [] IXICore.BlockHeader.lastSuperBlockChecksum = null

Checksum of the previous superblock - used only in superblock functionality.

Definition at line 69 of file BlockHeader.cs.

◆ lastSuperBlockNum

ulong IXICore.BlockHeader.lastSuperBlockNum = 0

Block height of the previous superblock - used only in superblock functionality.

Definition at line 73 of file BlockHeader.cs.

◆ signatureFreezeChecksum

byte [] IXICore.BlockHeader.signatureFreezeChecksum = null

Checksum of the final list of signatures for block blockNum - 5.

In this way, the signers list is 'frozen' and may no longer be changed, preventing various possible tampering attacks. Since the payout of many of the Ixian DLT's Master Node functions is tied to the accepted signature list, this field protects that list from malicious tinkering. Changes are permitted for five blocks to allow slower nodes to process and apply their signatures.

Definition at line 61 of file BlockHeader.cs.

◆ superBlockSegments

Dictionary<ulong, SuperBlockSegment> IXICore.BlockHeader.superBlockSegments = new Dictionary<ulong, SuperBlockSegment>()

List of blocks and their checksums - used only in the superblock functionality.

Definition at line 65 of file BlockHeader.cs.

◆ transactions

List<string> IXICore.BlockHeader.transactions = new List<string> { }

The list of transactions which should act on the WalletState from the previous block to produce the WalletState for this block.

Definition at line 24 of file BlockHeader.cs.

◆ version

int IXICore.BlockHeader.version = 0

Block version.

New blocks should always be generated with the latest version - maxVersion, except during the transitional period while the network is upgrading from one block version to the next. Older blocks, retrieved from files or the network may have an older version and this field identifies which version the specific block has. Some Block features are only enabled from specific versions forward.

Definition at line 34 of file BlockHeader.cs.

◆ walletStateChecksum

byte [] IXICore.BlockHeader.walletStateChecksum = null

Checksum of the WalletState after the transactions in this block are applied to the WalletState from the previous block.

This allows Ixian Master Nodes to operate on the WalletState and be certain that it matches all other Master nodes without exchanging all the wallet data. WalletState is synchornized when the node first boots up, but is never transferred between nodes later, since it can be updated in a consistent manner using the transactions and wallet state checksums in each block.

Definition at line 52 of file BlockHeader.cs.

Property Documentation

◆ blockNum

ulong IXICore.BlockHeader.blockNum
getset

Block height (block number). This is a sequential index in the blockchain which uniquely identifies each block.

Definition at line 20 of file BlockHeader.cs.


The documentation for this class was generated from the following file: