Documentation ¶
Index ¶
- type Notifier
- type Request
- type Response
- type Signature
- type SignatureNotifier
- func (s *SignatureNotifier) BroadcastFailed(messageID string, peers []peer.ID) error
- func (s *SignatureNotifier) BroadcastSignature(messageID string, sig []*tsslibcommon.ECSignature, peers []peer.ID) error
- func (s *SignatureNotifier) ReleaseStream(msgID string)
- func (s *SignatureNotifier) WaitForSignature(messageID string, message [][]byte, poolPubKey string, timeout time.Duration, ...) ([]*common.ECSignature, error)
- type TssKeySign
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 ¶
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
type Response ¶
type Response struct { Signatures []Signature `json:"signatures"` Status common.Status `json:"status"` Blame blame.Blame `json:"blame"` }
Response key sign response
type Signature ¶ added in v1.3.0
type Signature struct { Msg string `json:"signed_msg"` R string `json:"r"` S string `json:"s"` RecoveryID string `json:"recovery_id"` }
signature
func NewSignature ¶ added in v1.3.0
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