Documentation ¶
Index ¶
- type Notifier
- type Request
- type Response
- type SignatureNotifier
- func (s *SignatureNotifier) BroadcastFailed(messageID string, peers []peer.ID) error
- func (s *SignatureNotifier) BroadcastSignature(messageID string, sig *signing.SignatureData, 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
- func (tKeySign *TssKeySign) GetTssCommonStruct() *common.TssCommon
- func (tKeySign *TssKeySign) GetTssKeySignChannels() chan *p2p.Message
- func (tKeySign *TssKeySign) SignMessage(msgToSign []byte, localStateItem storage.KeygenLocalState, parties []string) (*signing.SignatureData, error)
- func (tKeySign *TssKeySign) WriteKeySignResult(w http.ResponseWriter, R, S, recovertID string, status common.Status)
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 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
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
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)