Documentation ¶
Index ¶
- Constants
- Variables
- func CreateExchange(pk kyber.Point, commits []byte) ([]byte, *wire.Exchange, error)
- type DKGdata
- type DistKeyShare
- type LocalOwner
- func (o *LocalOwner) Broadcast(ts *wire.Transport) error
- func (o *LocalOwner) GetCeremonySig(secretKeyBLS *bls.SecretKey) ([]byte, error)
- func (o *LocalOwner) GetDKGNodes(ops []*wire.Operator) ([]kyber_dkg.Node, error)
- func (o *LocalOwner) GetLocalOwner() *LocalOwner
- func (o *LocalOwner) Init(reqID [24]byte, init *wire.Init) (*wire.Transport, error)
- func (o *LocalOwner) InitReshare(reqID [24]byte, reshare *wire.Reshare, commitsPoints []kyber.Point) (*wire.Transport, error)
- func (o *LocalOwner) PostDKG(res *kyber_dkg.OptionResult) error
- func (o *LocalOwner) Process(from uint64, st *wire.SignedTransport) error
- func (o *LocalOwner) PushDealsOldNodes() error
- func (o *LocalOwner) StartDKG() error
- func (o *LocalOwner) StartReshareDKGNewNodes() error
- func (o *LocalOwner) StartReshareDKGOldNodes() error
- type Operator
- type OwnerOpts
- type PriShare
- type Result
Constants ¶
const ( // MaxEffectiveBalanceInGwei is the max effective balance MaxEffectiveBalanceInGwei phase0.Gwei = 32000000000 )
Variables ¶
var ErrAlreadyExists = errors.New("duplicate message")
Functions ¶
Types ¶
type DKGdata ¶ added in v1.0.0
type DKGdata struct {
// contains filtered or unexported fields
}
DKGdata structure to store at LocalOwner information about initial message parameters and secret scalar to be used as input for DKG protocol
type DistKeyShare ¶ added in v1.0.0
type DistKeyShare struct {}
func (*DistKeyShare) Decode ¶ added in v1.0.0
func (msg *DistKeyShare) Decode(data []byte) error
Decode returns error if decoding failed
func (*DistKeyShare) Encode ¶ added in v1.0.0
func (msg *DistKeyShare) Encode() ([]byte, error)
Encode returns a msg encoded bytes or error
type LocalOwner ¶
type LocalOwner struct { Logger *zap.Logger ErrorChan chan error ID uint64 Suite pairing.Suite InitiatorPublicKey *rsa.PublicKey RSAPub *rsa.PublicKey // contains filtered or unexported fields }
LocalOwner as a main structure created for a new DKG initiation or resharing ceremony
func New ¶
func New(opts *OwnerOpts) *LocalOwner
New creates a LocalOwner structure. We create it for each new DKG ceremony.
func (*LocalOwner) Broadcast ¶
func (o *LocalOwner) Broadcast(ts *wire.Transport) error
Function to send signed messages back to initiator
func (*LocalOwner) GetCeremonySig ¶ added in v1.2.0
func (o *LocalOwner) GetCeremonySig(secretKeyBLS *bls.SecretKey) ([]byte, error)
func (*LocalOwner) GetDKGNodes ¶ added in v1.0.0
GetDKGNodes returns a slice of DKG node instances used for the protocol
func (*LocalOwner) GetLocalOwner ¶ added in v1.0.0
func (o *LocalOwner) GetLocalOwner() *LocalOwner
func (*LocalOwner) Init ¶
Init function creates an interface for DKG (board) which process protocol messages Here we randomly create a point at G1 as a DKG public key for the node
func (*LocalOwner) InitReshare ¶ added in v1.0.0
func (o *LocalOwner) InitReshare(reqID [24]byte, reshare *wire.Reshare, commitsPoints []kyber.Point) (*wire.Transport, error)
InitReshare initiates a resharing owner of dkg protocol
func (*LocalOwner) PostDKG ¶
func (o *LocalOwner) PostDKG(res *kyber_dkg.OptionResult) error
PostDKG stores the resulting key share, convert it to BLS points acceptable by ETH2 and creates the Result structure to send back to initiator
func (*LocalOwner) Process ¶
func (o *LocalOwner) Process(from uint64, st *wire.SignedTransport) error
Process processes incoming messages from initiator at /dkg route
func (*LocalOwner) PushDealsOldNodes ¶ added in v1.0.0
func (o *LocalOwner) PushDealsOldNodes() error
func (*LocalOwner) StartDKG ¶
func (o *LocalOwner) StartDKG() error
StartDKG initializes and starts DKG protocol
func (*LocalOwner) StartReshareDKGNewNodes ¶ added in v1.0.0
func (o *LocalOwner) StartReshareDKGNewNodes() error
func (*LocalOwner) StartReshareDKGOldNodes ¶ added in v1.0.0
func (o *LocalOwner) StartReshareDKGOldNodes() error
type Operator ¶
Operator structure contains information about external operator participating in the DKG ceremony
type OwnerOpts ¶
type OwnerOpts struct { Logger *zap.Logger ID uint64 BroadcastF func([]byte) error Suite pairing.Suite VerifyFunc func(id uint64, msg, sig []byte) error SignFunc func([]byte) ([]byte, error) EncryptFunc func([]byte) ([]byte, error) DecryptFunc func([]byte) ([]byte, error) InitiatorPublicKey *rsa.PublicKey RSAPub *rsa.PublicKey Owner [20]byte Nonce uint64 Version []byte }
OwnerOpts structure to pass parameters from Switch to LocalOwner structure
type Result ¶
type Result struct { // Operator ID OperatorID uint64 // Operator RSA pubkey PubKeyRSA *rsa.PublicKey // RequestID for the DKG instance (not used for signing) RequestID [24]byte EncryptedShare []byte SharePubKey []byte // ValidatorPubKey the resulting public key corresponding to the shared private key ValidatorPubKey []byte // Partial Operator Signature of Deposit data DepositPartialSignature []byte // SSV owner + nonce signature OwnerNoncePartialSignature []byte // Signed priv share + initiator pub CeremonySig []byte }
Result is the last message in every DKG which marks a specific node's end of process