Documentation ¶
Overview ¶
Package beacon implements the beacon random source. This source is meant to be used in the setup stage only. After the setup phase is done, it shall return a coin random source for use in the main part of the protocol.
Beacon assumes the following about the dag:
(1) there are no forks, (2) level = height for each unit,
Index ¶
- type Beacon
- func (b *Beacon) DataToInclude(parents []gomel.Unit, level int) ([]byte, error)
- func (b *Beacon) DealingData(epoch gomel.EpochID) ([]byte, error)
- func (b *Beacon) GetWTK(head uint16) *tss.WeakThresholdKey
- func (b *Beacon) NewRandomSource(dag gomel.Dag) gomel.RandomSource
- func (b *Beacon) RandomBytes(pid uint16, level int) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beacon ¶
type Beacon struct {
// contains filtered or unexported fields
}
Beacon is a struct representing the beacon random source.
func (*Beacon) DataToInclude ¶
DataToInclude returns data which should be included in a unit with given parents and level.
func (*Beacon) DealingData ¶
DealingData returns random source data that should be included in the dealing unit.
func (*Beacon) GetWTK ¶
func (b *Beacon) GetWTK(head uint16) *tss.WeakThresholdKey
GetWTK returns a weak threshold key obtained by using this beacon. Head should be the creator of the timing unit chosen on the 6th level.
func (*Beacon) NewRandomSource ¶
func (b *Beacon) NewRandomSource(dag gomel.Dag) gomel.RandomSource
NewRandomSource allows using this instance of Beacon as a RandomSource by binding the provided dag to it.
func (*Beacon) RandomBytes ¶
RandomBytes returns a sequence of random bits for a given unit. It returns nil when (1) asked on a level that is too low i.e. level < sharesLevel or (2) there are no enough shares, i.e. the number of units on a given level created by share providers to the multicoin of pid is less than f+1.
When there is at least one unit of level+1 in the dag then condition (2) cannot hold.