keysign

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 29 Imported by: 6

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, message []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
	Message       string   `json:"message"`      // 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, msg string, blockHeight int64, signers []string, version string) Request

type Response

type Response struct {
	R          string        `json:"r"`
	S          string        `json:"s"`
	RecoveryID string        `json:"recovery_id"`
	Status     common.Status `json:"status"`
	Blame      blame.Blame   `json:"blame"`
}

Response key sign response

func NewResponse

func NewResponse(r, s, recoveryID string, status common.Status, blame blame.Blame) Response

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 *signing.SignatureData, 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) *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(msgToSign []byte, localStateItem storage.KeygenLocalState, parties []string) (*signing.SignatureData, error)

signMessage

func (*TssKeySign) WriteKeySignResult

func (tKeySign *TssKeySign) WriteKeySignResult(w http.ResponseWriter, R, S, recovertID string, status common.Status)

Jump to

Keyboard shortcuts

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