keysign

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier struct {
	MessageID string
	// contains filtered or unexported fields
}

Notifier is design to receive keysign signature, success or failure

func NewNotifier

func NewNotifier(messageID string, messages [][]byte, poolPubKey string) (*Notifier, error)

NewNotifier create a new instance of Notifier

func (*Notifier) GetResponseChannel

func (n *Notifier) GetResponseChannel() <-chan []*common.ECSignature

GetResponseChannel the final signature gathered from keysign party will be returned from the channel

func (*Notifier) ProcessSignature

func (n *Notifier) ProcessSignature(data []*common.ECSignature) (bool, error)

ProcessSignature is to verify whether the signature is valid return value bool , true indicated we already gather all the signature from keysign party, and they are all match false means we are still waiting for more signature from keysign party

type Request

type Request struct {
	PoolPubKey    string   `json:"pool_pub_key"` // pub key of the pool that we would like to send this message from
	Messages      []string `json:"messages"`     // base64 encoded message to be signed
	SignerPubKeys []string `json:"signer_pub_keys"`
	BlockHeight   int64    `json:"block_height"`
	Version       string   `json:"tss_version"`
}

Request request to sign a message

func NewRequest

func NewRequest(pk string, msgs []string, blockHeight int64, signers []string, version string) Request

type Response

type Response struct {
	Signatures []Signature   `json:"signatures"`
	Status     common.Status `json:"status"`
	Blame      blame.Blame   `json:"blame"`
}

Response key sign response

func NewResponse

func NewResponse(signatures []Signature, status common.Status, blame blame.Blame) Response

type Signature

type Signature struct {
	Msg        string `json:"signed_msg"`
	R          string `json:"r"`
	S          string `json:"s"`
	RecoveryID string `json:"recovery_id"`
}

signature

func NewSignature

func NewSignature(msg, r, s, recoveryID string) Signature

type SignatureNotifier

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

SignatureNotifier is design to notify the

func NewSignatureNotifier

func NewSignatureNotifier(host host.Host) *SignatureNotifier

NewSignatureNotifier create a new instance of SignatureNotifier

func (*SignatureNotifier) BroadcastFailed

func (s *SignatureNotifier) BroadcastFailed(messageID string, peers []peer.ID) error

BroadcastFailed will send keysign failed message to the nodes that are not in the keysign party

func (*SignatureNotifier) BroadcastSignature

func (s *SignatureNotifier) BroadcastSignature(messageID string, sig []*tsslibcommon.ECSignature, peers []peer.ID) error

BroadcastSignature sending the keysign signature to all other peers

func (*SignatureNotifier) ReleaseStream

func (s *SignatureNotifier) ReleaseStream(msgID string)

func (*SignatureNotifier) WaitForSignature

func (s *SignatureNotifier) WaitForSignature(messageID string, message [][]byte, poolPubKey string, timeout time.Duration, sigChan chan string) ([]*common.ECSignature, error)

WaitForSignature wait until keysign finished and signature is available

type TssKeySign

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

func NewTssKeySign

func NewTssKeySign(localP2PID string,
	conf common.TssConfig,
	broadcastChan chan *messages.BroadcastMsgChan,
	stopChan chan struct{}, msgID string, privKey tcrypto.PrivKey, p2pComm *p2p.Communication, stateManager storage.LocalStateManager, msgNum int) *TssKeySign

func (*TssKeySign) GetTssCommonStruct

func (tKeySign *TssKeySign) GetTssCommonStruct() *common.TssCommon

func (*TssKeySign) GetTssKeySignChannels

func (tKeySign *TssKeySign) GetTssKeySignChannels() chan *p2p.Message

func (*TssKeySign) SignMessage

func (tKeySign *TssKeySign) SignMessage(msgsToSign [][]byte, localStateItem storage.KeygenLocalState, parties []string) ([]*tsslibcommon.ECSignature, error)

signMessage

Jump to

Keyboard shortcuts

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