Skip to content

Block Format

Bruno França edited this page Jan 25, 2020 · 3 revisions

Blocks are composed of the header, the extrinsics and the justification.

  • The header contains data that is necessary for synchronization, plus commitments to accumulators (i.e. for the extrinsics and the state).
  • The justification contains the information necessary to make the block valid according to the consensus rules.
  • The extrinsics are all the data that is to be input into the state transition function.

Macro blocks

Header

  • Version [16-bit unsigned integer]: The current version of the block format,
  • Block number [32-bit unsigned integer]: The number of the current block,
  • View number [32-bit unsigned integer]: The view number of the current block,
  • Parent hash [256-bit Blake2b hash]: The hash of the previous block header,
  • Parent macro hash [256-bit Blake2b hash]: The hash of the previous macro block header,
  • Timestamp [64-bit unsigned integer]: An Unix timestamp,
  • Random Seed [BLS signature]: The random seed for the current block,
  • State root [256-bit Blake2b hash]: The root of a Merkle tree over the current state,
  • Extrinsics root [256-bit Blake2b hash]: The root of a Merkle tree over the extrinsics included in this block,
  • Transactions root [256-bit Blake2b hash]: The root of a Merkle tree over all transactions from the previous epoch,
  • Validators [Validator slots]: The list of the validator slots information for the new epoch.

Justification

  • 1st round validator subset [BitSet]: The list of validators that participated in the 1st round of signatures,
  • 1st round aggregated signature [BLS signature]: The aggregated signature of the validators that participated in the 1st round,
  • 2nd round validator subset [BitSet]: The list of validators that participated in the 2nd round of signatures,
  • 2nd round aggregated signature [BLS signature]: The aggregated signature of the validators that participated in the 2nd round.

Extrinsics

  • Stakers [StakeSlots]: The slots with the staker information (i.e. staker address and reward address),
  • Slashed set [BitSet]: The final list of slashed validators from the previous epoch,
  • Fork proofs [Vec]: Proofs attesting to the creation of a fork by a validator.

Micro blocks

Header

  • Version [16-bit unsigned integer]: The current version of the block format,
  • Block number [32-bit unsigned integer]: The number of the current block,
  • View number [32-bit unsigned integer]: The view number of the current block,
  • Parent hash [256-bit Blake2b hash]: The hash of the previous block header,
  • Timestamp [64-bit unsigned integer]: An Unix timestamp,
  • Random Seed [BLS signature]: The random seed for the current block,
  • State root [256-bit Blake2b hash]: The root of a Merkle tree over the current state,
  • Extrinsics root [256-bit Blake2b hash]: The root of a Merkle tree over the extrinsics included in this block.

Justification

  • View change proof [BitSet + BLS signature]: A proof attesting to the validity of a view change,
  • Signature [BLS signature]: The signature of the validators that produced the current block.

Extrinsics

  • Transactions [Vec]: The transactions that were processed in the current block,
  • Fork proofs [Vec]: Proofs attesting to the creation of a fork by a validator.