Documentation ¶
Index ¶
- type MockTxProofChecker
- type MoneroKeySign
- func (tKeySign *MoneroKeySign) GetTssCommonStruct() *common.TssCommon
- func (tKeySign *MoneroKeySign) GetTssKeySignChannels() chan *p2p.Message
- func (tKeySign *MoneroKeySign) OrderKeysignMembers(msgID string, parties []string) []string
- func (tKeySign *MoneroKeySign) SignMessage(encodedTx string, parties []string, memo string) (*TxSendProof, error)
- type Notifier
- type Request
- type Response
- type SignatureNotifier
- func (s *SignatureNotifier) BroadcastFailed(messageID string, peers []peer.ID) error
- func (s *SignatureNotifier) BroadcastSignature(messageID string, signedTxHex *TxSendProof, peers []peer.ID) error
- func (s *SignatureNotifier) ReleaseStream(msgID string)
- func (s *SignatureNotifier) WaitForSignature(messageID, encodedTx, memo string, txProofChecker TxProofChecker, ...) (*TxSendProof, error)
- type TxProofChecker
- type TxSendProof
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTxProofChecker ¶
MockTxProofChecker a Mock of TxProofChecker
func (*MockTxProofChecker) CheckTxProof ¶
func (m *MockTxProofChecker) CheckTxProof(proof *wallet.RequestCheckTxProof) (*wallet.ResponseCheckTxProof, error)
CheckTxProof mock implementation of check tx proof
type MoneroKeySign ¶
type MoneroKeySign struct {
// contains filtered or unexported fields
}
MoneroKeySign structure to process monero keysign
func NewMoneroKeySign ¶
func NewMoneroKeySign(localP2PID string, conf common.TssConfig, broadcastChan chan *messages.BroadcastMsgChan, stopChan chan struct{}, msgID string, privKey tcrypto.PrivKey, p2pComm *p2p.Communication, walletAccessor monero_multi_sig.WalletAccessor, walletName string) (*MoneroKeySign, error)
NewMoneroKeySign create a new instance of Monero Keysign
func (*MoneroKeySign) GetTssCommonStruct ¶
func (tKeySign *MoneroKeySign) GetTssCommonStruct() *common.TssCommon
GetTssCommonStruct return the common struct used by keysign
func (*MoneroKeySign) GetTssKeySignChannels ¶
func (tKeySign *MoneroKeySign) GetTssKeySignChannels() chan *p2p.Message
GetTssKeySignChannels return the tss message channel
func (*MoneroKeySign) OrderKeysignMembers ¶
func (tKeySign *MoneroKeySign) OrderKeysignMembers(msgID string, parties []string) []string
OrderKeysignMembers sort keysign members, based on message id and member's node public key
func (*MoneroKeySign) SignMessage ¶
func (tKeySign *MoneroKeySign) SignMessage(encodedTx string, parties []string, memo string) (*TxSendProof, error)
SignMessage use multisig to process the given encoded Tx parties represent all the members of the multisig wallet.
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, encodedTx string, memo string, txProofChecker TxProofChecker, threshold int) (*Notifier, error)
NewNotifier create a new instance of Notifier
func (*Notifier) GetResponseChannel ¶
func (n *Notifier) GetResponseChannel() <-chan *TxSendProof
GetResponseChannel the final signature gathered from keysign party will be returned from the channel
func (*Notifier) ProcessSignature ¶
func (n *Notifier) ProcessSignature(data *TxSendProof) (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 { BlockHeight int64 `json:"block_height"` // BlockHeight that this tx out is generated Version string `json:"version"` // TSS Version, currently is not used , for future-proof WalletAddress string `json:"wallet_address"` // pub key of the pool that we would like to send this message from EncodedTx string `json:"encoded_transaction"` // Transaction Memo string `json:"memo"` // Memo for the outbound tx }
Request request to sign a message
type Response ¶
type Response struct { TxID string `json:"tx_id"` Signature string `json:"signature"` // signature that can be used to proof the outbound Status common.Status `json:"status"` Blame tb.Blame `json:"blame"` }
Response key sign response
type SignatureNotifier ¶
type SignatureNotifier struct {
// contains filtered or unexported fields
}
SignatureNotifier is design to notify all members when a keysign is success
func NewSignatureNotifier ¶
func NewSignatureNotifier(h 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, signedTxHex *TxSendProof, 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, encodedTx, memo string, txProofChecker TxProofChecker, timeout time.Duration, sigChan chan string, threshold int) (*TxSendProof, error)
WaitForSignature wait until keysign finished and signature is available
type TxProofChecker ¶
type TxProofChecker interface { // CheckTxProof request wallet to check a given tx proof to see whether it is legitimate CheckTxProof(proof *wallet.RequestCheckTxProof) (*wallet.ResponseCheckTxProof, error) }
type TxSendProof ¶
TxSendProof information can be used to proof the network sent the outbound
func (TxSendProof) IsEmpty ¶
func (t TxSendProof) IsEmpty() bool
IsEmpty check whether TxSendProof is empty