keysign

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 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 *bc.SignatureData

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

func (*Notifier) ProcessSignature

func (n *Notifier) ProcessSignature(data *bc.SignatureData) (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"`
}

Request request to sign a message

func NewRequest

func NewRequest(pk, msg string, signers []string) Request

type Response

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

Response key sign response

func NewResponse

func NewResponse(r, s 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 *bc.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) (*bc.SignatureData, 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) (*bc.SignatureData, error)

signMessage

func (*TssKeySign) WriteKeySignResult

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

Jump to

Keyboard shortcuts

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