Documentation ¶
Index ¶
- func ComputeVRF(privKey crypto.PrivKey, sigInput []byte) ([]byte, error)
- func DrawRandomness(rbase []byte, randomnessType RandomnessType, round uint64, entropy []byte) ([]byte, error)
- func VerifyVRF(worker peer.ID, vrfBase, vrfproof []byte) error
- type BeaconAPI
- type BeaconNetwork
- type BeaconNetworks
- type BeaconResult
- type RandomnessType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawRandomness ¶
Types ¶
type BeaconAPI ¶
type BeaconAPI interface { Entry(context.Context, uint64) (types.BeaconEntry, error) VerifyEntry(types.BeaconEntry, types.BeaconEntry) error LatestBeaconRound() uint64 }
BeaconAPI represents a system that provides randomness. Other components interrogate the BeaconAPI to acquire randomness that's valid for a specific chain epoch. Also to verify beacon entries that have been posted on chain.
type BeaconNetwork ¶
type BeaconNetworks ¶
type BeaconNetworks []BeaconNetwork
func (BeaconNetworks) BeaconNetworkForRound ¶
func (bn BeaconNetworks) BeaconNetworkForRound(e uint64) BeaconAPI
func (BeaconNetworks) ValidateBlockBeacons ¶
func (bn BeaconNetworks) ValidateBlockBeacons(beaconNetworks BeaconNetworks, curEntry, prevEntry types.BeaconEntry) error
ValidateBlockBeacons is a function that verifies block randomness
type BeaconResult ¶
type BeaconResult struct { Entry types.BeaconEntry Err error }
type RandomnessType ¶
type RandomnessType int64
RandomnessType specifies a type of randomness.
const (
RandomnessTypeElectionProofProduction RandomnessType = 1 + iota
)
Click to show internal directories.
Click to hide internal directories.