# README

Candidate Generator Component

This package implements a candidate generator, for the blind-bid protocol of the SBA* consensus protocol.

Abstract

For more information on block generation, please refer to the generation package readme.

Values

Candidate (Block)

FieldType
Versionuint8
Heightuint64
Timestampint64
Previous block hashuint256
Block seedBLS Signature
Merkle root[]byte (32 bytes)
CertificateCertificate*
Block hash[]byte (32 bytes)
Transactions[]Transaction* (variable size)

Architecture

The candidate generator exposes its functionality through a single interface method: GenerateCandidateMessage. It should logically follow a call to the score generator to generate a score proposal. This score proposal should also be fed into the candidate generator, which combines it with the candidate block, in order to create a fully-fledged Score message.

The component should be initialized with a public key, to which the potential reward can be attributed. Once called, the block generator goes through these steps:

  • It will generate a committee for the given round and step. This committee contains all the people that can potentially be rewarded, if this block is finalized
  • The generator will ask the mempool for a list of transactions, up to a certain size (determined by the block size cap)
  • A coinbase transaction will be appended to the end of the list, as per the consensus rules
  • A block header is constructed, leaving only the certificate field empty. This certificate is constructed later, in the agreement phase
  • The block is put together, and is then concatenated with the score proposal, to create a `Score message. This message is then returned to the caller

This message is then fully ready to be encoded and gossiped to the network.