sortition

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParams = errors.New("invalide params")
	HashMax, _, _    = new(big.Float).Parse("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 16)
)

Functions

func Sortition

func Sortition(key []byte, seed []byte, t, s, w, W int64) (hash []byte, j uint)

Simplified sortition algorithm implementation In original design, each candidate need to generate verifiable random based on their secret key before sortition. In this case, we need a round of consensus to make sure all candidates are honest. In the simplied vesion, we'll use ordinary SHA3-256 to generate random which is public and fair to everyone. However, candidate's public key and each block's VRF seed will be used as entropy sources.

Params

key: candidate's public key
seed: block's VRF seed
t: each subuser's stake
s: size of subuser committee (to be nominated)
w: current candidate's stake
W: all candidates' total stake

Returns

hash: generated random
j: nominated subuser number

Types

This section is empty.

Jump to

Keyboard shortcuts

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