node

package
v0.12.0-rc Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package node defines a node executing the TSS protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node holds interfaces to interact with the blockchain and network messages transport layer.

func NewNode

func NewNode(
	ethereumChain eth.Handle,
	networkProvider net.Provider,
	tssConfig *tss.Config,
) *Node

NewNode initializes node struct with provided ethereum chain interface and network provider. It also initializes TSS Pre-Parameters pool. But does not start parameters generation. This should be called separately.

func (*Node) AnnounceSignerPresence

func (n *Node) AnnounceSignerPresence(
	ctx context.Context,
	operatorPublicKey *operator.PublicKey,
	keepAddress common.Address,
	keepMembersAddresses []common.Address,
) ([]tss.MemberID, error)

AnnounceSignerPresence triggers the announce protocol in order to signal signer presence and gather information about other signers.

func (*Node) CalculateSignature

func (n *Node) CalculateSignature(
	ctx context.Context,
	signer *tss.ThresholdSigner,
	digest [32]byte,
) error

CalculateSignature calculates a signature over a digest with threshold signer and publishes the result to the keep associated with the signer. In case of failure on signature submission we need to check if the keep is still waiting for the signature. It is possible that other member was faster than the current one and submitted the signature first.

func (*Node) GenerateSignerForKeep

func (n *Node) GenerateSignerForKeep(
	ctx context.Context,
	operatorPublicKey *operator.PublicKey,
	keepAddress common.Address,
	keepMembersIDs []tss.MemberID,
) (*tss.ThresholdSigner, error)

GenerateSignerForKeep generates a new threshold signer with ECDSA key pair. The public key is a public key of the signing group. It publishes the public key to the keep. It uses keep address as unique signing group identifier.

func (*Node) InitializeTSSPreParamsPool

func (n *Node) InitializeTSSPreParamsPool()

InitializeTSSPreParamsPool generates TSS pre-parameters and stores them in a pool.

Jump to

Keyboard shortcuts

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