generation

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 3 Imported by: 0

README

Block Generator

Abstract

Block Generator is the first of the two full-node types eligible to participate in the consensus (the other being the Provisioner). To become a Block Generator, a full-node has to submit a Bid Transaction. The Block Generator is eligible to participate in one phase - the block generation where the Block Generators participates in a non-interactive lottery to be able to forge a candidate block.

Blind Bid Algorithm

The block generation makes use of bulletproof-based zero-knowledge cryptography in order to prove the correct computation of a score associated with a block candidate which gets validated and selected by Provisioners during the score selection phase carried out by the selection package.

Procedure

The Blind Bid algorithm is outlined in the following steps

  1. A universal counter N is maintained for all bidding transactions in the lifetime.
  2. Seed S is computed and broadcasted.
  3. Bidder selects secret K.
  4. Bidder sends a bidding transaction with data M = H(K).
  5. For every bidding transaction with d coins and data M an entry X = H(d,M,N) is added to T. Then N is increased.
  6. Potential bidder computes Y =H(S,X), score Q=F(d,Y), and identifier Z =H(S,M).
  7. Bidder selects a bid root RT and broadcasts proof π = Π(Z, RT, Q, S; K, d, N).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory added in v0.2.0

type Factory struct {
}

Factory creates a first step reduction Component

func NewFactory added in v0.2.0

func NewFactory() *Factory

NewFactory instantiates a Factory

func (*Factory) Instantiate added in v0.2.0

func (f *Factory) Instantiate() consensus.Component

Instantiate a generation component

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator is the component that signals a restart of score generation and selection after a Restart Event is detected

func NewComponent added in v0.2.0

func NewComponent() *Generator

NewComponent instantiates a new Generator

func (*Generator) Collect added in v0.2.0

func (g *Generator) Collect(ev consensus.Event) error

Collect `Restart` events and triggers a Generation event

func (*Generator) Finalize added in v0.2.0

func (g *Generator) Finalize()

Finalize as part of the Component interface

func (*Generator) ID added in v0.2.0

func (g *Generator) ID() uint32

ID as part of the Component interface

func (*Generator) Initialize added in v0.2.0

func (g *Generator) Initialize(eventPlayer consensus.EventPlayer, signer consensus.Signer, ru consensus.RoundUpdate) []consensus.TopicListener

Initialize the Generator by subscribing to `Restart` topic. The Listener is marked as LowPriority to allow for the `Selector` to be notified first

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL