smpc

package
v0.0.0-...-4f94b01 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-2.0, GPL-3.0 Imports: 52 Imported by: 0

Documentation

Overview

Package smpc Keygen/Sign/Reshare,The complete implementation process includes receiving commands, selecting data packets, receiving and analyzing consent data, executing MPC process, database processing, P2P message analysis and processing, result return, etc

Index

Constants

This section is empty.

Variables

View Source
var (
	//err code 1
	ErrEncodeSendMsgFail      = `{Code:1,Error:"encode send msg fail."}`
	ErrParamError             = `{Code:2,Error:"parameters error."}`
	ErrGetOtherNodesDataFail  = `{Code:3,Error:"NetWork Error,Get Data From Other Node Fail."}`
	ErrUnknownChType          = `{Code:4,Error:"unknown channel type."}`
	ErrGetChValueFail         = `{Code:5,Error:"get channel value fail."}`
	ErrNoFindWorker           = `{Code:7,Error:"can not find worker."}`
	ErrGetWorkerIDError       = `{Code:10,Error:"get worker id error."}`
	ErrGetPrexDataError       = `{Code:11,Error:"get msg prefix data error."}`
	ErrSendDataToGroupFail    = `{Code:15,Error:"send data to group fail."}`
	ErrInternalMsgFormatError = `{Code:16,Error:"msg data format error."}`
	ErrGetNoResFromGroupMem   = `{Code:17,Error:"no get any result from other group node."}`
	ErrCoinTypeNotSupported   = `{Code:18,Error:"coin type is not supported."}`
	ErrGroupNotReady          = `{Code:23,Error:"the group is not ready.please try again."}`
	ErrGetGenPubkeyFail       = `{Code:24,Error:"get generate pubkey fail."}`
	ErrGetGenSaveDataFail     = `{Code:25,Error:"get generate save data fail."}`
	ErrCreateDbFail           = `{Code:26,Error:"create db fail."}`
	ErrSmpcSigWrongSize       = `{Code:28,Error:"wrong size for smpc sig."}`
	ErrSmpcSigFail            = `{Code:29,Error:"smpc sign fail."}`
	ErrInvalidSmpcAddr        = `{Code:30,Error:"invalid smpc address."}`
	ErrGetRealEosUserFail     = `{Code:27,Error:"cannot get real eos account."}`
	ErrSendTxToNetFail        = `{Code:14,Error:"send tx to outside net fail."}`
	ErrGetC1Timeout           = `{Code:31,Error:"get C1 timeout."}`
	ErrGetEnodeByUIDFail      = `{Code:32,Error:"can not find proper enodes by uid."}`
	ErrGetD1Timeout           = `{Code:33,Error:"get D1 timeout."}`
	ErrGetSHARE1Timeout       = `{Code:34,Error:"get SHARE1 timeout."}`
	ErrGetAllSHARE1Fail       = `{Code:35,Error:"get all SHARE1 msg fail."}`
	ErrGetAllD1Fail           = `{Code:36,Error:"get all D1 msg fail."}`
	ErrVerifySHARE1Fail       = `{Code:37,Error:"verify SHARE1 fail."}`
	ErrGetAllC1Fail           = `{Code:38,Error:"get all C1 msg fail."}`
	ErrKeyGenVerifyCommitFail = `{Code:39,Error:"verify commit in keygenerate fail."}`
	ErrGetZKFACTPROOFTimeout  = `{Code:40,Error:""get ZKFACTPROOF timeout."}`
	ErrGetZKUPROOFTimeout     = `{Code:41,Error:""get ZKUPROOF timeout."}`
	ErrGetAllZKFACTPROOFFail  = `{Code:42,Error:"get all ZKFACTPROOF msg fail."}`
	ErrVerifyZKFACTPROOFFail  = `{Code:43,Error:"verify ZKFACTPROOF fail."}`
	ErrGetAllZKUPROOFFail     = `{Code:44,Error:"get all ZKUPROOF msg fail."}`
	ErrVerifyZKUPROOFFail     = `{Code:45,Error:"verify ZKUPROOF fail."}`
	ErrGetC11Timeout          = `{Code:46,Error:"get C11 timeout."}`
	ErrGetMTAZK1PROOFTimeout  = `{Code:47,Error:"get MTAZK1PROOF timeout."}`
	ErrGetKCTimeout           = `{Code:48,Error:"get KC timeout."}`
	ErrGetAllKCFail           = `{Code:49,Error:"get all KC msg fail."}`
	ErrGetAllMTAZK1PROOFFail  = `{Code:50,Error:"get all MTAZK1PROOF msg fail."}`
	ErrVerifyMTAZK1PROOFFail  = `{Code:51,Error:"verify MTAZK1PROOF fail.""}`
	ErrGetMKGTimeout          = `{Code:52,Error:"get MKG timeout."}`
	ErrGetAllMKGFail          = `{Code:53,Error:"get all MKG msg fail."}`
	ErrGetMKWTimeout          = `{Code:54,Error:"get MKW timeout."}`
	ErrGetAllMKWFail          = `{Code:55,Error:"get all MKW msg fail."}`
	ErrVerifyMKGFail          = `{Code:56,Error:"verify MKG fail.""}`
	ErrVerifyMKWFail          = `{Code:57,Error:"verify MKW fail.""}`
	ErrGetPaillierPrivKeyFail = `{Code:58,Error:"get paillier privkey fail.""}`
	ErrGetDELTA1Timeout       = `{Code:59,Error:"get DELTA1 timeout."}`
	ErrGetAllDELTA1Fail       = `{Code:60,Error:"get all DELTA1 msg fail."}`
	ErrGetD11Timeout          = `{Code:61,Error:"get D11 timeout."}`
	ErrGetAllD11Fail          = `{Code:62,Error:"get all D11 msg fail."}`
	ErrGetAllC11Fail          = `{Code:63,Error:"get all C11 msg fail."}`
	ErrSignVerifyCommitFail   = `{Code:64,Error:"verify commit in smpc sign fail."}`
	ErrREqualZero             = `{Code:65,Error:"sign error: r equal zero."}`
	ErrGetS1Timeout           = `{Code:66,Error:"get S1 timeout."}`
	ErrGetAllS1Fail           = `{Code:67,Error:"get all S1 msg fail."}`
	ErrVerifySAllFail         = `{Code:68,Error:"verify SAll != m*G + r*PK in smpc sign ec2."}`
	ErrGetSS1Timeout          = `{Code:69,Error:"get SS1 timeout."}`
	ErrGetAllSS1Fail          = `{Code:70,Error:"get all SS1 msg fail."}`
	ErrSEqualZero             = `{Code:71,Error:"sign error: s equal zero."}`
	ErrSmpcSignVerifyFail     = `{Code:72,Error:"smpc sign verify fail."}`
)

smpc erros

View Source
var (

	//ec keygen timeout
	EcKeygenTimeout = 600

	//ed keygen timeout
	EdKeygenTimeout = 600

	//ec sign timeout
	EcSignTimeout = 600

	//ed sign timeout
	EdSignTimeout = 600

	//wait for subgid sign data
	SubGidSignDataTimeOut = 180

	//wait for creating signing subgid
	CreatingSignSubGidTimeOut = 8

	// WaitMsgTimeGG20 wait msg timeout
	WaitMsgTimeGG20 = 300

	// MaxAcceptTime agree timeout
	MaxAcceptTime = 406800 // second

	// C1Data the data arrive before cmd by p2p
	C1Data = common.NewSafeMap(10)

	// GetGroup p2p callback
	GetGroup func(string) (int, string)

	// SendToGroupAllNodes p2p callback
	SendToGroupAllNodes func(string, string) (string, error)

	// GetSelfEnode p2p callback
	GetSelfEnode func() string

	// BroadcastInGroupOthers p2p callback
	BroadcastInGroupOthers func(string, string) (string, error)

	// SendToPeer p2p callback
	SendToPeer func(string, string) error

	// ParseNode p2p callback
	ParseNode func(string) string

	// GetEosAccount p2p callback
	GetEosAccount func() (string, string, string)

	// Msg2Peer save the msg that send to special peer
	Msg2Peer = common.NewSafeMap(10)

	// MsgReceiv save the msg that receive from special peer
	MsgReceiv = common.NewSafeMap(10)
)
View Source
var (
	// PrePubDataCount the max count of pre-sign data of special groupid and pubkey
	PrePubDataCount = 2000

	// PreBip32DataCount the max count of pre-sign data of special groupid and pubkey for bip32
	PreBip32DataCount = 4

	// PreSigal map
	PreSigal = common.NewSafeMap(10)

	// PrePubGids map
	PrePubGids = common.NewSafeMap(10)
)
View Source
var (

	// KeyFile bootnode keyfile
	KeyFile string

	RelayInPeers bool
)
View Source
var (
	// RPCReqQueueCache the queue of RPCReq
	RPCReqQueueCache = make(chan RPCReq, RPCMaxQueue)

	// RPCMaxWorker  max worker nums
	RPCMaxWorker = 10000

	// RPCMaxQueue max counts of RPCReq in queue
	RPCMaxQueue = 10000

	// RPCReqQueue the channel of RPCReq
	RPCReqQueue chan RPCReq
)
View Source
var (
	// PaillierKeyLength paillier key len
	PaillierKeyLength = 2048
)
View Source
var (
	// SignChan the channel of RPCSignData
	SignChan = make(chan *RPCSignData, 10000)
)

Functions

func AcceptReShare

func AcceptReShare(initiator string, account string, groupid string, tsgroupid string, pubkey string, threshold string, mode string, deal string, accept string, status string, newsk string, tip string, errinfo string, allreply []NodeReply, workid int) (string, error)

AcceptReShare set the status of reshare request if the status is not "Pending",move the Corresponding data to General database,otherwise stay the database for saving data related to reshare command

func AcceptReqAddr

func AcceptReqAddr(raw string, initiator string, account string, cointype string, groupid string, nonce string, threshold string, mode string, deal string, accept string, status string, pubkey string, tip string, errinfo string, allreply []NodeReply, workid int, sigs string) (string, error)

AcceptReqAddr set the status of generating pubkey request if the status is not "Pending",move the Corresponding data to General database,otherwise stay the database for saving data related to application address command

func AcceptSign

func AcceptSign(raw string, initiator string, account string, pubkey string, msghash []string, keytype string, groupid string, nonce string, threshold string, mode string, deal string, accept string, status string, rsv string, tip string, errinfo string, allreply []NodeReply, workid int) (string, error)

AcceptSign set the status of signing request if the status is not "Pending",move the Corresponding data to General database,otherwise stay the database for saving data related to sign command

func AccountLoaded

func AccountLoaded() bool

AccountLoaded Determine whether the database has been loaded

func AutoPreGenSignData

func AutoPreGenSignData()

AutoPreGenSignData Automatically generate pre-sign data based on database that saving public key group information.

func BinarySearchVacancy

func BinarySearchVacancy(pubkey string, inputcode string, gid string, start int, end int) int

BinarySearchVacancy Binary search the unused key among the set of hash(pubkey:inputcode:gid:i), (i = start,start + 1,start + 2, .... , end) [start,end] mid = (end + 1 - start)/2 left = [start,start - 1 + mid] right = [start + mid,end]

func Call

func Call(msg interface{}, enode string)

Call receive msg from p2p

func Call2

func Call2(msg interface{})

Call2 use for receiving the group info from p2p

func CheckAcc

func CheckAcc(eid string, geteracc string, sigs string) bool

CheckAcc Check whether the account has permission to agree the request(keygen/sign/reshare)

func CheckAccept

func CheckAccept(pubkey string, mode string, account string) bool

CheckAccept judge whether the pubkey account has permission to agree to sign

func CheckGroupEnode

func CheckGroupEnode(gid string) bool

CheckGroupEnode Judge whether there is same enodeID in group

func CheckRaw

func CheckRaw(raw string) (string, string, string, interface{}, error)

CheckRaw check command data or accept data

func CheckReply

func CheckReply(l *list.List, rt RPCType, key string) bool

CheckReply Detect whether all nodes in the group have sent accept data

func CheckReqAddrDulpRawReply

func CheckReqAddrDulpRawReply(raw string, l *list.List) bool

CheckReqAddrDulpRawReply Filter duplicate accept data (command data is also a kind of accept data), Take the latest accept data as the final data

func CheckReshareDulpRawReply

func CheckReshareDulpRawReply(raw string, l *list.List) bool

CheckReshareDulpRawReply Filter duplicate accept data (command data is also a kind of accept data), Take the latest accept data as the final data

func CheckSignDulpRawReply

func CheckSignDulpRawReply(raw string, l *list.List) bool

CheckSignDulpRawReply Filter duplicate accept data (command data is also a kind of accept data), Take the latest accept data as the final data

func CleanUpAllReqAddrInfo

func CleanUpAllReqAddrInfo()

CleanUpAllReqAddrInfo Delete the data related to generating pubkey command from the corresponding sub database, and correspondingly change the status of the command data to timeout in the general database.

func CleanUpAllReshareInfo

func CleanUpAllReshareInfo()

CleanUpAllReshareInfo Delete the data related to reshare command from the corresponding sub database, and correspondingly change the status of the command data to timeout in the general database.

func CleanUpAllSignInfo

func CleanUpAllSignInfo()

CleanUpAllSignInfo Delete the data related to sign command from the corresponding sub database, and correspondingly change the status of the command data to timeout in the general database.

func CleanUpMsgReceiv

func CleanUpMsgReceiv()

func Compress

func Compress(c []byte) (string, error)

Compress compress the bytes,and return the result

func CompressSignBrocastData

func CompressSignBrocastData(raw string, pickhash []*PickHashKey) (string, error)

CompressSignBrocastData marshal *SignBrocastData to json string

func CompressSignData

func CompressSignData(raw string, pickdata []*PickHashData) (string, error)

CompressSignData marshal *SignPickData to json string

func CompressSignSubGidBrocastData

func CompressSignSubGidBrocastData(raw string, pickhash []*PickHashKey, subgid string) (string, error)

CompressSignSubGidBrocastData marshal *SignSubGidBrocastData to json string

func CopyAllAccountsFromDb

func CopyAllAccountsFromDb()

CopyAllAccountsFromDb Load the pubkeys generated by history,execute it only once

func DECDSASignVerifyRSV

func DECDSASignVerifyRSV(keytype string, r *big.Int, s *big.Int, v int32, message string, pkx *big.Int, pky *big.Int) bool

DECDSASignVerifyRSV verify RSV

func Decode2

func Decode2(s string, datatype string) (interface{}, error)

Decode2 decode string to obj by data type

func DecryptMsg

func DecryptMsg(cm string) (string, error)

DecryptMsg decrypt msg

func DelPrekeyFromDb

func DelPrekeyFromDb(pubkey string, inputcode string, gid string, keytype string) error

DelPrekeyFromDb delete pubkey gid information to the specified batabase

func DeleteAccountDataFromDb

func DeleteAccountDataFromDb(key []byte) error

DeleteAccountDataFromDb delete value from database for saving all pubkeys

func DeletePreSignData

func DeletePreSignData(pubkey string, inputcode string, gid string, datakey string) error

DeletePreSignData delete pre-sign data from local db under the specified pubkey/gid/inputcode

func DeletePubKeyData

func DeletePubKeyData(key []byte) error

DeletePubKeyData delete value from general database by key

func DeleteReShareInfoData

func DeleteReShareInfoData(key []byte) error

DeleteReShareInfoData delete value from database for saving data related to reshare command

func DeleteReqAddrInfoData

func DeleteReqAddrInfoData(key []byte) error

DeleteReqAddrInfoData delete value from database for saving data related to generate pubkey command

func DeleteSignInfoData

func DeleteSignInfoData(key []byte) error

DeleteSignInfoData delete value from database for saving data related to sign command

func DisAcceptMsg

func DisAcceptMsg(raw string, workid int)

DisAcceptMsg Collect accept data of nodes in the group, after collection, continue the MPC process

func DisMsg

func DisMsg(msg string)

DisMsg msg: key-enode:C1:X1:X2...:Xn msg: key-enode1:NoReciv:enode2:C1

func DoPreSign

func DoPreSign(pubkey string, gid string, hash string, mode string, keytype string) string

func DoSign

func DoSign(sbd *SignPickData, workid int, sender string, ch chan interface{}) error

DoSign execute sign sbd : sign command data + key of picked pre-sign data workid : current worker id sender : send node's enodeID ch : the channel to save the sign result or error info.

func DoubleHash

func DoubleHash(id string, keytype string) *big.Int

DoubleHash The EnodeID is converted into a hash value according to different keytypes

func EdSignGetRealMessage

func EdSignGetRealMessage(msg map[string]string) smpclib.Message

EdSignGetRealMessage get the message data struct by map. (p2p msg ---> map)

func EdSignProcessInboundMessages

func EdSignProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, errChan chan struct{}, wg *sync.WaitGroup, ch chan interface{})

EdSignProcessInboundMessages Analyze the obtained P2P messages and enter next round

func Encode2

func Encode2(obj interface{}) (string, error)

Encode2 encode obj to string

func EncryptMsg

func EncryptMsg(msg string, enodeID string) (string, error)

EncryptMsg encrypt msg

func ExcutePreSignData

func ExcutePreSignData(pre *TxDataPreSignData)

ExcutePreSignData generate the pre-sign data under the specified pubkey/gid

func ExecApproveKeyGen

func ExecApproveKeyGen(raw string, from string, req *TxDataAcceptReqAddr, ac *AcceptReqAddrData, check bool)

func ExecApproveSigning

func ExecApproveSigning(raw string, from string, sig *TxDataAcceptSign, ac *AcceptSignData, check bool)

func Find

func Find(l *list.List, msg string) bool

Find find msg in list

func GetAccountFromDb

func GetAccountFromDb(key []byte) (bool, interface{})

GetAccountFromDb get value from database for saving all pubkeys

func GetAccounts

func GetAccounts(geteracc, mode string) (interface{}, string, error)

GetAccounts get all accounts generated by special account

func GetAccountsBalance

func GetAccountsBalance(pubkey string, geteracc string) (interface{}, string, error)

GetAccountsBalance Obtain SMPC addresses in different currencies in pubkey, and then obtain its balance

func GetAccountsDir

func GetAccountsDir() string

GetAccountsDir get dir of the database for saving all pubkeys

func GetAddr

func GetAddr(pubkey string, cointype string) (string, string, error)

GetAddr Obtain SMPC addresses in different currencies in pubkey

func GetApproverByReqAddrKey

func GetApproverByReqAddrKey(key string, enodeID string) string

func GetBalance

func GetBalance(account string, cointype string, smpcaddr string) (string, string, error)

GetBalance get the balance by smpc address

func GetBip32CDir

func GetBip32CDir() string

GetBip32CDir get bip32 c value database dir

func GetBip32ChildKey

func GetBip32ChildKey(rootpubkey string, inputcode string, keytype string, mode string) (string, string, error)

GetBip32ChildKey rootpubkey is the total public key of the root node the inputcode format is "m / X1 / x2 /... / xn", where x1,..., xn is the index number of the child node of each level, which is in decimal format, for example: "m / 1234567890123456789012345678901234567890123456789012323455678901234" the return value is the sub public key of the X1 / x2 /... / xn sub node of the total public key of the root node.

func GetChannelValue

func GetChannelValue(t int, obj interface{}) (string, string, error)

GetChannelValue get channel value within the specified timeout

func GetCmdKey

func GetCmdKey(msg string) string

GetCmdKey get the key of various of command datas

func GetCmdReqAddrInfoDb

func GetCmdReqAddrInfoDb() *ethdb.LDBDatabase

GetCmdReqAddrInfoDb open database for saving data related to generate pubkey command

func GetCurNodeIndex

func GetCurNodeIndex(gid string, subgid string, keytype string) int

GetCurNodeIndex get the serial number of uid of current node in group. gid is the `keygen gid`

func GetCurNodePaillierSkFromSaveData

func GetCurNodePaillierSkFromSaveData(save string, gid string, keytype string) *ec2.PrivateKey

GetCurNodePaillierSkFromSaveData get current node's paillier private key from saved data that obtained when generating pubkey gid is not the sub-gid

func GetDbDir

func GetDbDir() string

GetDbDir get general database dir

func GetENodeByFrom

func GetENodeByFrom(from string, ac *AcceptReqAddrData) string

func GetEnodesForSubGroup

func GetEnodesForSubGroup(id int, gid string) []string

func GetGroupDir

func GetGroupDir() string

GetGroupDir get P2P group info database dir

func GetGroupNodeUIDs

func GetGroupNodeUIDs(keytype string, gid string, subgid string) smpclib.SortableIDSSlice

GetGroupNodeUIDs get the uids of node in group subgid gid is the `keygen gid`

func GetGroupSigsDataByRaw

func GetGroupSigsDataByRaw(raw string) (string, error)

GetGroupSigsDataByRaw get account sigs data from special tx data(raw data) account sigs data: Signatures generated by respective accounts,the signature object is the pubkey of eNode,that is,enodeID. account sigs data: sig1 | sig2 | ... | sigN (N is the count of nodes in group.)

func GetIDReshareByGroupID

func GetIDReshareByGroupID(msgtoenode map[string]string, groupid string) smpclib.SortableIDSSlice

GetIDReshareByGroupID get uid of node in group by groupid,and sort the uids

func GetIDs

func GetIDs(keytype string, groupid string) smpclib.SortableIDSSlice

GetIDs Convert each ID into a hash value according to different keytypes and put it into an array for sorting

func GetKeyFromData

func GetKeyFromData(txdata []byte) string

GetKeyFromData get special tx data type from command data or accept data

func GetKeyTypeFromData

func GetKeyTypeFromData(txdata []byte) string

GetKeyTypeFromData get special tx data type from command data or accept data

func GetMpcNodeInfo

func GetMpcNodeInfo() (string, error)

func GetMsgSigHash

func GetMsgSigHash(message []byte) []byte

func GetMsgToEnode

func GetMsgToEnode(keytype string, gid string, groupid string) map[string]string

GetMsgToEnode get uid of node in group by groupid,and put it to the map. map: uid ----> enodeID gid is the `keygen gid`

func GetNodeUID

func GetNodeUID(EnodeID string, keytype string, gid string) (int, *big.Int)

GetNodeUID get current node uid,gid is the `keygen gid` return (index,UID)

func GetNtildeByIndexFromSaveData

func GetNtildeByIndexFromSaveData(save string, index int, NodeCnt int) *ec2.NtildeH1H2

GetNtildeByIndexFromSaveData get ntilde data by index from saved data that obtained when generating pubkey

func GetNtildePrivDataByIndexFromSaveData

func GetNtildePrivDataByIndexFromSaveData(save string, NodeCnt int) *ec2.NtildePrivData

GetNtildePrivDataByIndexFromSaveData get ntilde priv data by index from saved data that obtained when generating pubkey

func GetPaillierPkByIndexFromSaveData

func GetPaillierPkByIndexFromSaveData(save string, index int) *ec2.PublicKey

GetPaillierPkByIndexFromSaveData get paillier pubkey by index from saved data that obtained when generating pubkey

func GetPreDbDir

func GetPreDbDir() string

GetPreDbDir get pre-sign data database dir

func GetPreKeyDir

func GetPreKeyDir() string

GetPreKeyDir get public key group information database dir

func GetPrePubGids

func GetPrePubGids(pub string) []string

GetPrePubGids get gids by pub pub = hash256(pubkey : gid)

func GetPreSigal

func GetPreSigal(pub string) bool

GetPreSigal Return whether to continue generating pre-sign data pub = hash256(pubkey : gid) true yes false no

func GetPreSignKey

func GetPreSignKey(pubkey string, inputcode string, gid string, index string) (string, error)

GetPreSignKey get the key of level db that saving pre-sign data strings.ToLower(256Hash(pubkey:inputcode:gid:index)) ---> PreSignData

func GetPubKeyData

func GetPubKeyData(key []byte) (bool, interface{})

GetPubKeyData get data by key from general database

func GetPubKeyData2

func GetPubKeyData2(key string, account string, cointype string) (string, string, error)

GetPubKeyData2 get pubkey data by key/accout/contype pubkey data,such as : account,pubkey,smpc address,cointype

func GetRawReply

func GetRawReply(l *list.List) *common.SafeMap

GetRawReply Analyze the accept data of nodes in the group map ret: from1 ---> *RawReply{...} from2 ---> *RawReply{...} from3 ---> *RawReply{...} ...

func GetRawType

func GetRawType(raw string) (string, string)

GetRawType get special tx data type and key from command data or accept data

func GetReShareInfoData

func GetReShareInfoData(key []byte) (bool, interface{})

GetReShareInfoData get value by key from database for saving data related to reshare command

func GetReShareInfoDir

func GetReShareInfoDir() string

GetReShareInfoDir get dir of database for saving data related to reshare command

func GetReShareNonce

func GetReShareNonce(account string) (string, string, error)

GetReShareNonce get reshare special tx nonce

func GetReShareStatus

func GetReShareStatus(key string) (string, string, error)

GetReShareStatus get the result of the reshare request by key

func GetRealMessage

func GetRealMessage(msg map[string]string) smpclib.Message

GetRealMessage get the message data struct by map. (p2p msg ---> map)

func GetRealMessageEDDSA

func GetRealMessageEDDSA(msg map[string]string) smpclib.Message

GetRealMessageEDDSA get the message data struct by map. (p2p msg ---> map)

func GetReply

func GetReply(id int) int

GetReply 0 accept 1 reject 2 uncertain

func GetReqAddrInfoData

func GetReqAddrInfoData(key []byte) (bool, interface{})

GetReqAddrInfoData get value by key from database for saving data related to generate pubkey command

func GetReqAddrInfoDir

func GetReqAddrInfoDir() string

GetReqAddrInfoDir get dir of database for saving data related to generate pubkey command

func GetReqAddrKeyByOtherKey

func GetReqAddrKeyByOtherKey(key string, rt RPCType) string

GetReqAddrKeyByOtherKey sign key --->AccepSignData -----> pubkey ----->PubKeyData ---->reqaddr key

func GetReqAddrNonce

func GetReqAddrNonce(account string) (string, string, error)

GetReqAddrNonce get keygen special tx nonce

func GetReqAddrRawValue

func GetReqAddrRawValue(raw string) (string, string, string)

GetReqAddrRawValue get from/special tx data type/timestamp from generating pubkey command data

func GetReqAddrStatus

func GetReqAddrStatus(key string) (string, string, error)

GetReqAddrStatus get the result of the keygen request by key

func GetReshareRawValue

func GetReshareRawValue(raw string) (string, string, string)

GetReshareRawValue get from/special tx data type/timestamp from reshare command data

func GetRetErr

func GetRetErr(err string) error

GetRetErr get error form error info

func GetSignInfoData

func GetSignInfoData(key []byte) (bool, interface{})

GetSignInfoData get value by key from database for saving data related to sign command

func GetSignInfoDir

func GetSignInfoDir() string

GetSignInfoDir get dir of database for saving data related to sign command

func GetSignNonce

func GetSignNonce(account string) (string, string, error)

GetSignNonce get sign special tx nonce

func GetSignRawValue

func GetSignRawValue(raw string) (string, string, string)

GetSignRawValue get from/special tx data type/timestamp from sign command data

func GetSignStatus

func GetSignStatus(key string) (string, string, error)

GetSignStatus get the result of the sign request by key

func GetSignString

func GetSignString(r *big.Int, s *big.Int, v int) string

GetSignString get RSV string

func GetSkU1Dir

func GetSkU1Dir() string

GetSkU1Dir get private key database dir

func GetSmpcAccountsDirDb

func GetSmpcAccountsDirDb() *ethdb.LDBDatabase

GetSmpcAccountsDirDb open database for saving all pubkeys

func GetSmpcAddr

func GetSmpcAddr(pubkey string) (string, string, error)

GetSmpcAddr Obtain SMPC addresses in different currencies in pubkey

func GetSmpcBip32Db

func GetSmpcBip32Db() *ethdb.LDBDatabase

GetSmpcBip32Db open bip32 c value database

func GetSmpcDb

func GetSmpcDb() *ethdb.LDBDatabase

GetSmpcDb open general database

func GetSmpcGidDb

func GetSmpcGidDb() *ethdb.LDBDatabase

GetSmpcGidDb open database for group db

func GetSmpcPreDb

func GetSmpcPreDb() *ethdb.LDBDatabase

GetSmpcPreDb open pre-sign data database

func GetSmpcPreKeyDb

func GetSmpcPreKeyDb() *ethdb.LDBDatabase

GetSmpcPreKeyDb open public key group information database

func GetSmpcReShareInfoDb

func GetSmpcReShareInfoDb() *ethdb.LDBDatabase

GetSmpcReShareInfoDb open database for saving data related to reshare command

func GetSmpcSignInfoDb

func GetSmpcSignInfoDb() *ethdb.LDBDatabase

GetSmpcSignInfoDb open database for saving data related to sign command

func GetSmpcSkDb

func GetSmpcSkDb() *ethdb.LDBDatabase

GetSmpcSkDb open private key database dir

func GetTotalCount

func GetTotalCount(pubkey string, inputcode string, gid string) int

GetTotalCount Gets the number of currently generated pre-sign data under the specified pubkey/gid/inputcode

func GetTxTypeFromData

func GetTxTypeFromData(txdata []byte) string

GetTxTypeFromData get special tx data type from command data or accept data

func GetUint64FromStr

func GetUint64FromStr(str string) (uint64, error)

GetUint64FromStr get uint64 from string.

func GetWorkerID

func GetWorkerID(w *RPCReqWorker) (int, error)

GetWorkerID get worker's id

func Handle

func Handle(key string, c1data string)

Handle send pre-save msg to SmpcMsg channel delete pre-save msg from C1Data map

func HandleC1Data

func HandleC1Data(ac *AcceptReqAddrData, key string)

HandleC1Data C1Data Key, Three formats are included: 1. key-enodefrom, for reshare only, enodefrom get from enodeID 2. key-uid-msgtype, for example: key-uid-"KGRound0Message" 3. key-accout,for accept reply

func HandleKG

func HandleKG(key string, uid *big.Int)

HandleKG Process pre-save msg for keygen

func HandleRPCSign

func HandleRPCSign()

HandleRPCSign handle sign request,read sign command from the channel and do it!

func HandleRPCSign2

func HandleRPCSign2(rsd *RPCSignData)

func HandleSign

func HandleSign(key string, uid *big.Int)

HandleSign Process pre-save msg for sign

func Init

func Init(groupID string)

Init smpc node with the msg receive from group by Call2

func InitChan

func InitChan()

InitChan init workers,RpcReqQueue,ReqDispatcher and start the worker.

func InitGroupInfo

func InitGroupInfo(groupID string)

InitGroupInfo get current node enodeID etc.

func InitMpcNodeInfo

func InitMpcNodeInfo()

func IsEDSignCmd

func IsEDSignCmd(raw string) (string, bool)

IsEDSignCmd Judge whether it is the ed sign command data

func IsGenKeyCmd

func IsGenKeyCmd(raw string) (bool, string)

IsGenKeyCmd Judge whether it is the command data that generating pubkey

func IsInGroup

func IsInGroup(gid string) bool

func IsMsg2Peer

func IsMsg2Peer(msgmap map[string]string) (bool, string, string, string)

IsMsg2Peer Judge whether it is the msg that send to special peer

func IsNotFoundErr

func IsNotFoundErr(err error) bool

IsNotFoundErr weather it is "Not Found in db" error

func IsPreGenSignData

func IsPreGenSignData(raw string) (string, bool)

IsPreGenSignData Judge whether it is the command data that generating pre-sign data

func IsReshareCmd

func IsReshareCmd(raw string) (bool, string)

IsReshareCmd Judge whether it is Reshare command data

func IsSignDataCmd

func IsSignDataCmd(raw string) (string, bool)

IsSignDataCmd Judge whether it is the "SignData" data struct

func IsValidAccept

func IsValidAccept(gid string, from string, ac *AcceptReqAddrData) bool

func IsValidReShareAccept

func IsValidReShareAccept(from string, gid string) bool

IsValidReShareAccept is valid reshare accept??

func KeyGenerateDECDSA

func KeyGenerateDECDSA(msgprex string, ch chan interface{}, id int, cointype string) bool

KeyGenerateDECDSA generate the pubkey ec2 msgprex = hash

func KeyGenerateDEDDSA

func KeyGenerateDEDDSA(msgprex string, ch chan interface{}, id int, cointype string) bool

KeyGenerateDEDDSA generate the pubkey ed msgprex = hash cointype = keytype // ec || ed25519

func MsgRun

func MsgRun(raw string, workid int, sender string, ch chan interface{}) error

MsgRun 1.Parse the command data and implement the process 2.analyze the accept data

func NeedPreSign

func NeedPreSign(pubkey string, inputcode string, gid string) (int, bool)

NeedPreSign Binary search the unused key among the set of hash(pubkey:inputcode:gid:i), (i = start,start + 1,start + 2, .... , end) if this value index is found,return (index,true),otherwise return (-1,false)

func NeedPreSignForBip32

func NeedPreSignForBip32(pubkey string, inputcode string, gid string) (int, bool)

NeedPreSignForBip32 find the unused key among the set of hash(pubkey:inputcode:gid:i), (i = start,start + 1,start + 2, .... , end) if this value index is found,return (index,true),otherwise return (-1,false)

func NeedToStartPreBip32

func NeedToStartPreBip32(pub string) bool

NeedToStartPreBip32 need to generate pre-sign data for bip32 ??

func NowMilliStr

func NowMilliStr() string

NowMilliStr returns now timestamp in miliseconds of string format.

func PreGenSignData

func PreGenSignData(raw string) (string, error)

PreGenSignData generate the pre-sign data under the specified pubkey/gid

func ProcessInboundMessages

func ProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, errChan chan struct{}, wg *sync.WaitGroup, ch chan interface{})

ProcessInboundMessages Analyze the obtained P2P messages and enter next round

func ProcessInboundMessagesEDDSA

func ProcessInboundMessagesEDDSA(msgprex string, keytype string, finishChan chan struct{}, errChan chan struct{}, wg *sync.WaitGroup, ch chan interface{})

ProcessInboundMessagesEDDSA Analyze the obtained P2P messages and enter next round

func ProcessOutCh

func ProcessOutCh(msgprex string, msg smpclib.Message, keytype string) error

ProcessOutCh send message to other node

func PutAccountDataToDb

func PutAccountDataToDb(key []byte, value []byte) error

PutAccountDataToDb put value to database for saving all pubkeys

func PutPrePubGids

func PutPrePubGids(pub string, gids []string)

PutPrePubGids put gids to map by pub pub = hash256(pubkey : gid)

func PutPreSigal

func PutPreSigal(pub string, val bool)

PutPreSigal set the value "true" or "false" to map to decide whether to continue generating pre-sign data

func PutPreSignData

func PutPreSignData(pubkey string, inputcode string, gid string, index int, val *PreSignData, force bool) error

PutPreSignData put pre-sign data to local db under the specified pubkey/gid/inputcode

func PutPubKeyData

func PutPubKeyData(key []byte, value []byte) error

PutPubKeyData put value to general database

func PutReShareInfoData

func PutReShareInfoData(key []byte, value []byte) error

PutReShareInfoData put value to database for saving data related to reshare command

func PutReqAddrInfoData

func PutReqAddrInfoData(key []byte, value []byte) error

PutReqAddrInfoData put value to database for saving data related to generate pubkey command

func PutSignInfoData

func PutSignInfoData(key []byte, value []byte) error

PutSignInfoData put value to database for saving data related to sign command

func RPCAcceptReShare

func RPCAcceptReShare(raw string) (string, string, error)

RPCAcceptReShare Agree to the reshare request raw : accept data, including the key of the reshare request

func RPCAcceptReqAddr

func RPCAcceptReqAddr(raw string) (string, string, error)

RPCAcceptReqAddr Agree to the keygen request raw : accept data, including the key of the keygen request

func RPCAcceptSign

func RPCAcceptSign(raw string) (string, string, error)

RPCAcceptSign Agree to the sign request raw : accept data, including the key of the sign request

func ReShare

func ReShare(raw string) (string, string, error)

ReShare execute the reshare command raw : reshare command data

func ReShareEC2

func ReShareEC2(raw string, msgprex string, initator string, groupid string, pubkey string, account string, mode string, sigs string, ch chan interface{}, id int, keytype string)

ReShareEC2 execute reshare msgprex = hash return value is the backup for the smpc sig

func RegP2pBroadcastInGroupOthersCallBack

func RegP2pBroadcastInGroupOthersCallBack(f func(string, string) (string, error))

RegP2pBroadcastInGroupOthersCallBack set p2p callback func BroadcastInGroupOthers

func RegP2pGetGroupCallBack

func RegP2pGetGroupCallBack(f func(string) (int, string))

RegP2pGetGroupCallBack set p2p callback func GetGroup

func RegP2pGetSelfEnodeCallBack

func RegP2pGetSelfEnodeCallBack(f func() string)

RegP2pGetSelfEnodeCallBack set p2p callback func GetSelfEnode

func RegP2pParseNodeCallBack

func RegP2pParseNodeCallBack(f func(string) string)

RegP2pParseNodeCallBack set p2p callback func ParseNode

func RegP2pSendMsgToPeerCallBack

func RegP2pSendMsgToPeerCallBack(f func(string, string) error)

RegP2pSendMsgToPeerCallBack set p2p callback func SendToPeer

func RegP2pSendToGroupAllNodesCallBack

func RegP2pSendToGroupAllNodesCallBack(f func(string, string) (string, error))

RegP2pSendToGroupAllNodesCallBack set p2p callback func SendToGroupAllNodes

func RegSmpcGetEosAccountCallBack

func RegSmpcGetEosAccountCallBack(f func() (string, string, string))

RegSmpcGetEosAccountCallBack set p2p callback func GetEosAccount

func ReqKeyGen

func ReqKeyGen(raw string) (string, string, error)

ReqKeyGen Request to generate pubkey raw : keygen command data

func ReshareGetRealMessage

func ReshareGetRealMessage(msg map[string]string) smpclib.Message

ReshareGetRealMessage get the message data struct by map. (p2p msg ---> map)

func ReshareProcessInboundMessages

func ReshareProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, errChan chan struct{}, wg *sync.WaitGroup, ch chan interface{})

ReshareProcessInboundMessages Analyze the obtained P2P messages and enter next round

func ReshareProcessOutCh

func ReshareProcessOutCh(msgprex string, groupid string, msg smpclib.Message, keytype string) error

ReshareProcessOutCh send message to other node

func SaveAcceptReShareData

func SaveAcceptReShareData(ac *AcceptReShareData) error

SaveAcceptReShareData save the reshare command data to local db

func SaveAcceptReqAddrData

func SaveAcceptReqAddrData(ac *AcceptReqAddrData) error

SaveAcceptReqAddrData save the reqaddr command data to local db

func SaveAcceptSignData

func SaveAcceptSignData(ac *AcceptSignData) error

SaveAcceptSignData save the sign command data to local db

func SavePrekeyToDb

func SavePrekeyToDb(pubkey string, inputcode string, gid string, keytype string) error

SavePrekeyToDb save pubkey gid information to the specified batabase

func SendMsgToPeer

func SendMsgToPeer(enodes string, msg string)

SendMsgToPeer send msg to special peer

func SendMsgToPeerWithBrodcast

func SendMsgToPeerWithBrodcast(key string, enodes string, msg string, groupid string)

SendMsgToPeerWithBrodcast send msg to special peer with brodcast

func SendMsgToSmpcGroup

func SendMsgToSmpcGroup(msg string, groupid string)

SendMsgToSmpcGroup brodcast msg to group nodes by group id

func SetReShareNonce

func SetReShareNonce(account string, nonce string) (string, error)

SetReShareNonce set reshare special tx nonce

func SetReqAddrNonce

func SetReqAddrNonce(account string, nonce string) (string, error)

SetReqAddrNonce set keygen special tx nonce

func SetSignNonce

func SetSignNonce(account string, nonce string) (string, error)

SetSignNonce set sign special tx nonce

func SetUpMsgList

func SetUpMsgList(msg string, enode string)

SetUpMsgList set RecvMsg data to RPCReqQueue

func SetUpMsgList2

func SetUpMsgList2(msg string)

SetUpMsgList2 receive group info

func SetUpMsgList3

func SetUpMsgList3(msg string, enode string, rch chan interface{})

SetUpMsgList3 set RecvMsg data to RPCReqQueue

func Sign

func Sign(raw string) (string, string, error)

Sign execute the sign command raw : sign command data

func SignEC3

func SignEC3(msgprex string, message string, cointype string, save string, pkx *big.Int, pky *big.Int, ch chan interface{}, id int, pre *PreSignData) string

SignEC3 execute sign with gg20 MPC algorithm msgprex = hash return value is the backup for the smpc sign

func SignED

func SignED(msgprex string, save string, sku1 *big.Int, message string, cointype string, pk string, ch chan interface{}, id int) string

SignED execute the sign command with ed algorithm msgprex = hash return value is the backup for the smpc sign

func SignGetRealMessage

func SignGetRealMessage(msg map[string]string) smpclib.Message

SignGetRealMessage get the message data struct by map. (p2p msg ---> map)

func SignProcessInboundMessages

func SignProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, errChan chan struct{}, wg *sync.WaitGroup, ch chan interface{})

SignProcessInboundMessages Analyze the obtained P2P messages and enter next round

func SignProcessOutCh

func SignProcessOutCh(msgprex string, keytype string, msgtoenode map[string]string, msg smpclib.Message, gid string) error

SignProcessOutCh send message to other node

func Start

func Start(params *LunchParams)

Start init gsmpc 1. Initialization: local database (including general database, private key database, bip32 c value database,bip32 pre-sign data database, pre-sign data database, public key group information database, database for saving data related to generate pubkey command, database for saving data related to signature command, database for saving data related to resare command, pubkey), P2P callback function, Crypto coins configuration, startup parameters (including the number of pre generated packets, the timeout waiting for P2P information, the number of automatic retries after failed address application or signature, the timeout agreed by the nodes, whether to synchronize pre generated packets between nodes, etc.), and the enodeid of the local node. 2. Load the pubkeys generated by history and execute it only once. 3. Generate 4 large prime numbers 4. Execute automatic pre generation of data packets. 5. Listen for the arrival of the sign command. 6. Delete the data related to generating pubkey command, the signature command and the restore command from the corresponding sub database, and correspondingly change the status of the command data to timeout in the general database.

func StartSmpcLocalDb

func StartSmpcLocalDb() error

StartSmpcLocalDb open all database

func SynchronizePreSignData

func SynchronizePreSignData(msgprex string, wid int, success bool) bool

SynchronizePreSignData Every node broadcast own status tells other nodes whether their pre-sign data are pre generated and successfully written into the local database, and receives the corresponding status information of other nodes, so as to judge whether all nodes in the group are in the successful state. If so, keep the pre-sign data, otherwise the pre-sign data needs to be deleted.

func ToolDecimalByteSlice2HexString

func ToolDecimalByteSlice2HexString(DecimalSlice []byte) string

ToolDecimalByteSlice2HexString transfer Decimal byte to hex string

func UnCompress

func UnCompress(s string) (string, error)

UnCompress uncompress the string

Types

type AcceptReShareData

type AcceptReShareData struct {
	Initiator  string //enode id
	Account    string
	GroupID    string
	TSGroupID  string
	PubKey     string
	LimitNum   string
	PubAccount string
	Mode       string
	Sigs       string
	TimeStamp  string

	Deal   string
	Accept string

	Status string
	NewSk  string
	Tip    string
	Error  string

	AllReply []NodeReply
	WorkID   int

	FixedApprover []string
	Comment       string
	Keytype       string
}

AcceptReShareData the data of reshare cmd,include:weather initiator,from accout,gid,reshare sub-gid,pubkey,threshold,accept or reject the reshare .. and so on.

type AcceptReqAddrData

type AcceptReqAddrData struct {
	Raw           string
	Initiator     string //enode id
	Account       string
	Cointype      string
	GroupID       string
	Nonce         string
	LimitNum      string
	Mode          string
	TimeStamp     string
	FixedApprover []string
	PubKeySig     []string

	Deal   string
	Accept string

	Status string
	PubKey string
	Tip    string
	Error  string

	AllReply []NodeReply

	WorkID int

	Sigs    string //5:enodeid1:account1:enodeid2:account2:enodeid3:account3:enodeid4:account4:enodeid5:account5
	Comment string
}

AcceptReqAddrData the data of keygen cmd,include:weather initiator,from accout,gid,keygen sub-gid,pubkey,threshold,accept or reject the keygen .. and so on.

type AcceptSignData

type AcceptSignData struct {
	Raw        string
	Initiator  string //enode id
	Account    string
	GroupID    string
	Nonce      string
	PubKey     string
	MsgHash    []string
	MsgContext []string
	Keytype    string
	LimitNum   string
	Mode       string
	TimeStamp  string

	Deal   string
	Accept string

	Status string
	Rsv    string // rsv1:rsv2:....:rsvn:NULL
	Tip    string
	Error  string

	AllReply []NodeReply
	WorkID   int

	FixedApprover []string
	Comment       string
}

AcceptSignData the data of sign cmd,include:weather initiator,from accout,gid,sign sub-gid,pubkey,threshold,accept or reject the sign .. and so on.

type AccountsBalanceRes

type AccountsBalanceRes struct {
	PubKey   string
	Balances []SubAddressBalance
}

AccountsBalanceRes the balance of all smpc addr by pubkey

type AccountsList

type AccountsList struct {
	GroupID  string
	Accounts []PubKeyInfo
}

AccountsList gid --- > generated in this group

type AddrRes

type AddrRes struct {
	Account  string
	PubKey   string
	SmpcAddr string
	Cointype string
}

AddrRes accout ---> pubkey ---> smpc addr by special cointype

type ApprovReply

type ApprovReply struct {
	ENode     string
	From      string
	Accept    string
	TimeStamp string
}

ApprovReply the reply of node,including enode,accept or reject the keygen/sign/reshare cmd request

type ByteHash

type ByteHash [32]byte

ByteHash bytehash type define

func Keccak256Hash

func Keccak256Hash(data ...[]byte) (h ByteHash)

Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.

func (ByteHash) Hex

func (h ByteHash) Hex() string

Hex hash to hex string

type CmdReq

type CmdReq interface {
	GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply
	GetReqAddrKeyByKey(key string) string
	GetRawReply(ret *common.SafeMap, reply *RawReply)
	CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool
	DoReq(raw string, workid int, sender string, ch chan interface{}) bool
	GetGroupSigs(txdata []byte) (string, string, string, string)
	CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)
	DisAcceptMsg(raw string, workid int, key string)
}

CmdReq interface of request keygen/sign/reshare

type ECDSASignature

type ECDSASignature struct {
	// contains filtered or unexported fields
}

ECDSASignature (r,s,v)

func (*ECDSASignature) GetR

func (rsv *ECDSASignature) GetR() *big.Int

GetR get r

func (*ECDSASignature) GetRecoveryParam

func (rsv *ECDSASignature) GetRecoveryParam() int32

GetRecoveryParam get v

func (*ECDSASignature) GetS

func (rsv *ECDSASignature) GetS() *big.Int

GetS get s

func (*ECDSASignature) New

func (rsv *ECDSASignature) New()

New new a *ECDSASignature

func (*ECDSASignature) SetR

func (rsv *ECDSASignature) SetR(r *big.Int)

SetR set r

func (*ECDSASignature) SetRecoveryParam

func (rsv *ECDSASignature) SetRecoveryParam(recoveryParam int32)

SetRecoveryParam set v

func (*ECDSASignature) SetS

func (rsv *ECDSASignature) SetS(s *big.Int)

SetS set s

type Err

type Err struct {
	Info string
}

Err error info

func (Err) Error

func (e Err) Error() string

Error error string

type ErrorRet

type ErrorRet struct {
	Code  int
	Error string
}

ErrorRet error return code

type KGLocalDBSaveData

type KGLocalDBSaveData struct {
	Save       *keygen.LocalDNodeSaveData
	MsgToEnode map[string]string
}

KGLocalDBSaveData keygen save data

func GetKGLocalDBSaveData

func GetKGLocalDBSaveData(data map[string]string) *KGLocalDBSaveData

GetKGLocalDBSaveData get KGLocalDBSaveData data struct from map

func (*KGLocalDBSaveData) OutMap

func (kgsave *KGLocalDBSaveData) OutMap() map[string]string

OutMap Convert KGLocalDBSaveData data struct to map

type KGLocalDBSaveDataED

type KGLocalDBSaveDataED struct {
	Save       *edkeygen.LocalDNodeSaveData
	MsgToEnode map[string]string
}

KGLocalDBSaveDataED ed keygen save data

func GetKGLocalDBSaveDataED

func GetKGLocalDBSaveDataED(data map[string]string) *KGLocalDBSaveDataED

GetKGLocalDBSaveDataED get KGLocalDBSaveDataED data struct from map

func (*KGLocalDBSaveDataED) OutMap

func (kgsave *KGLocalDBSaveDataED) OutMap() map[string]string

OutMap Convert KGLocalDBSaveDataED data struct to map

type LunchParams

type LunchParams struct {
	WaitMsg       uint64
	TryTimes      uint64
	PreSignNum    uint64
	Jobs          uint64
	MaxAcceptTime uint64
	Bip32Pre      uint64
	SyncPreSign   string
	RelayInPeers  bool
	AutoPreSign   bool
	TestNet       bool
	NeighRelay    bool
}

LunchParams lunch params

type MpcNodeInfo

type MpcNodeInfo struct {
	GidNum        int
	KeyGenNum     int
	KeyGenFailNum int
	SignNum       int
	SignFailNum   int
}

type MsgSig

type MsgSig struct {
	Rsv     string
	MsgType string
	Msg     string
}

type NodeReply

type NodeReply struct {
	Enode     string
	Approver  string
	Status    string
	TimeStamp string
	Initiator string // "1"/"0"
}

NodeReply node accept or not accept the keygen/sign/reshare

func GetAllReplyFromGroup

func GetAllReplyFromGroup(wid int, gid string, rt RPCType, initiator string) []NodeReply

GetAllReplyFromGroup get all accept reply from group node

func GetAllReplyFromGroup2

func GetAllReplyFromGroup2(wid int, initiator string) []NodeReply

GetAllReplyFromGroup2 get all accept reply from group node

type PickHashData

type PickHashData struct {
	Hash string
	Pre  *PreSignData
}

PickHashData hash -- > pre-sign data that be picked

func HandleRPCSign3

func HandleRPCSign3(gid string, sig *TxDataSign, key string, raw string) ([]*PickHashData, error)

func HandleRPCSign4

func HandleRPCSign4(sig *TxDataSign, gid string, key string, raw string) ([]*PickHashData, error)

func (*PickHashData) MarshalJSON

func (Phd *PickHashData) MarshalJSON() ([]byte, error)

MarshalJSON marshal *PickHashData to json byte

func (*PickHashData) UnmarshalJSON

func (Phd *PickHashData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to *PiskHashData

type PickHashKey

type PickHashKey struct {
	Hash    string
	PickKey string
}

PickHashKey hash --- > the key of picked pre-sign data

func (*PickHashKey) MarshalJSON

func (Phk *PickHashKey) MarshalJSON() ([]byte, error)

MarshalJSON marshal *PickHashKey to json byte

func (*PickHashKey) UnmarshalJSON

func (Phk *PickHashKey) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to *PickHashKey

type PreSign

type PreSign struct {
	Pub       string
	InputCode string //for bip32
	Gid       string
	Nonce     string
	Index     int // pre-sign data index
	KeyType   string
}

PreSign the data of presign cmd

func (*PreSign) MarshalJSON

func (ps *PreSign) MarshalJSON() ([]byte, error)

MarshalJSON marshal PreSign data struct to json byte

func (*PreSign) UnmarshalJSON

func (ps *PreSign) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to PreSign data struct

type PreSignData

type PreSignData struct {
	Key    string
	K1     *big.Int
	R      *big.Int
	Ry     *big.Int
	Sigma1 *big.Int
	Gid    string
	Used   bool
	Index  int
}

PreSignData the pre-sign data

func BinarySearchPick

func BinarySearchPick(pubkey string, inputcode string, gid string, start int, end int) (int, *PreSignData)

BinarySearchPick Pick the pre-sign data from local db under the specified pubkey/gid/inputcode [start,end] mid = (end + 1 - start)/2 left = [start,start - 1 + mid] right = [start + mid,end]

func BinarySearchPreSignData

func BinarySearchPreSignData(pubkey string, inputcode string, gid string, datakey string, start int, end int) (int, *PreSignData)

BinarySearchPreSignData binary search pre-sign data by datakey under the specified pubkey/gid/inputcode from local db [start,end] mid = (end + 1 - start)/2 left = [start,start - 1 + mid] right = [start + mid,end]

func GetPreSignData

func GetPreSignData(pubkey string, inputcode string, gid string, datakey string) *PreSignData

GetPreSignData binary search pre-sign data by datakey under the specified pubkey/gid/inputcode from local db

func PickPreSignData

func PickPreSignData(pubkey string, inputcode string, gid string) *PreSignData

PickPreSignData Pick the pre-sign data from local db under the specified pubkey/gid/inputcode

func PreSignEC3

func PreSignEC3(msgprex string, save string, sku1 *big.Int, pkx *big.Int, pky *big.Int, cointype string, ch chan interface{}, id int) *PreSignData

PreSignEC3 execute the action of generating the pre-sign data. msgprex = hash

the return value is the generated pre-sign data.

func (*PreSignData) MarshalJSON

func (psd *PreSignData) MarshalJSON() ([]byte, error)

MarshalJSON marshal PreSignData data struct to json byte

func (*PreSignData) UnmarshalJSON

func (psd *PreSignData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to PreSignData data struct

type PubAccounts

type PubAccounts struct {
	Group []AccountsList
}

PubAccounts all accounts generate by all group

type PubKeyData

type PubKeyData struct {
	Key            string
	Account        string
	Pub            string
	Save           string
	Nonce          string
	GroupID        string
	LimitNum       string
	Mode           string
	KeyGenTime     string
	RefReShareKeys string //key1:key2...
	Comment        string
}

PubKeyData the data of after keygen,include: pubkey,all nodes's paillier pubkey,paillier privatekey,mpc sk,ntilde data .... etc.

type PubKeyInfo

type PubKeyInfo struct {
	PubKey    string
	ThresHold string
	TimeStamp string
}

PubKeyInfo pubkey info

type PubkeyRes

type PubkeyRes struct {
	Account     string
	PubKey      string
	SmpcAddress map[string]string
}

PubkeyRes account --> pubkey --> smpc addrs

type RPCReq

type RPCReq struct {
	// contains filtered or unexported fields
}

RPCReq rpc req or p2p data

type RPCReqWorker

type RPCReqWorker struct {
	RPCReqWorkerPool chan chan RPCReq
	RPCReqChannel    chan RPCReq

	SmpcFrom  string
	NodeCnt   int
	ThresHold int

	PickHash []*PickHashKey

	//for smpc lib
	SmpcMsg        chan string
	DNode          smpclib.DNode
	MsgToEnode     map[string]string
	PreSaveSmpcMsg []string
	Msg2Peer       []string
	ApprovReplys   []*ApprovReply
	//Msg56     map[string]bool
	Msg56 *common.SafeMap
	// contains filtered or unexported fields
}

RPCReqWorker worker

func FindWorker

func FindWorker(sid string) (*RPCReqWorker, error)

FindWorker find worker by sid(key) that uniquely identifies the keygen/sign/reshare command

func NewRPCReqWorker

func NewRPCReqWorker(workerPool chan chan RPCReq) *RPCReqWorker

NewRPCReqWorker new a RPCReqWorker

func (*RPCReqWorker) Clear

func (w *RPCReqWorker) Clear()

Clear reset RPCReqWorker object

func (*RPCReqWorker) Clear2

func (w *RPCReqWorker) Clear2()

Clear2 reset RPCReqWorker object in some elements

func (*RPCReqWorker) Start

func (w *RPCReqWorker) Start()

Start start the worker register the current worker into the worker queue. get job from channel and run! reset the worker object or stop the work.

func (*RPCReqWorker) Stop

func (w *RPCReqWorker) Stop()

Stop stop the work

type RPCSignData

type RPCSignData struct {
	Raw       string
	PubKey    string
	InputCode string
	GroupID   string
	MsgHash   []string
	Key       string
	KeyType   string
}

RPCSignData the sign data of put into the channel to handle

type RPCSmpcRes

type RPCSmpcRes struct {
	Ret string
	Tip string
	Err error
}

RPCSmpcRes smpc rpc result

type RPCType

type RPCType int32

RPCType rpc cmd type

const (
	// RPCREQADDR keygen
	RPCREQADDR RPCType = 0

	// RPCSIGN sign
	RPCSIGN RPCType = 2

	// RPCRESHARE reshare
	RPCRESHARE RPCType = 3
)

type RawReply

type RawReply struct {
	From      string
	Accept    string
	TimeStamp string
}

RawReply the reply of node,accept or reject the keygen/sign/reshare cmd request

type ReShareCurNodeInfo

type ReShareCurNodeInfo struct {
	Key       string
	PubKey    string
	GroupID   string
	TSGroupID string
	ThresHold string
	Account   string
	Mode      string
	TimeStamp string
}

ReShareCurNodeInfo the data of current node's approve list

func GetCurNodeReShareInfo

func GetCurNodeReShareInfo() ([]*ReShareCurNodeInfo, string, error)

GetCurNodeReShareInfo Get current node's reshare command approval list

type ReShareCurNodeInfoSort

type ReShareCurNodeInfoSort struct {
	Info []*ReShareCurNodeInfo
}

ReShareCurNodeInfoSort sort the info of current node's approve list

func (*ReShareCurNodeInfoSort) Len

func (r *ReShareCurNodeInfoSort) Len() int

Len get the count of arrary elements

func (*ReShareCurNodeInfoSort) Less

func (r *ReShareCurNodeInfoSort) Less(i, j int) bool

Less weather r.Info[i] < r.Info[j]

func (*ReShareCurNodeInfoSort) Swap

func (r *ReShareCurNodeInfoSort) Swap(i, j int)

Swap swap value of r.Info[i] and r.Info[j]

type ReShareStatus

type ReShareStatus struct {
	KeyID     string
	From      string
	GroupID   string
	ThresHold string
	Status    string
	Pubkey    string
	Tip       string
	Error     string
	AllReply  []NodeReply
	TimeStamp string
}

ReShareStatus reshare result

type RecvMsg

type RecvMsg struct {
	// contains filtered or unexported fields
}

RecvMsg msg data by channel or p2p and its sender

func (*RecvMsg) Run

func (recv *RecvMsg) Run(workid int, ch chan interface{}) bool

Run Implement keygen/sign/reshare command and Process accept data

type ReqAddrCurNodeInfoSort

type ReqAddrCurNodeInfoSort struct {
	Info []*ReqAddrReply
}

ReqAddrCurNodeInfoSort sort the info of current node's approve list

func (*ReqAddrCurNodeInfoSort) Len

func (r *ReqAddrCurNodeInfoSort) Len() int

Len get the count of arrary elements

func (*ReqAddrCurNodeInfoSort) Less

func (r *ReqAddrCurNodeInfoSort) Less(i, j int) bool

Less weather r.Info[i] < r.Info[j]

func (*ReqAddrCurNodeInfoSort) Swap

func (r *ReqAddrCurNodeInfoSort) Swap(i, j int)

Swap swap value of r.Info[i] and r.Info[j]

type ReqAddrReply

type ReqAddrReply struct {
	Key       string
	Account   string
	Cointype  string
	GroupID   string
	Nonce     string
	ThresHold string
	Mode      string
	TimeStamp string
}

ReqAddrReply the accept data of keygen

func GetCurNodeReqAddrInfo

func GetCurNodeReqAddrInfo(geteracc string) ([]*ReqAddrReply, string, error)

GetCurNodeReqAddrInfo Get current node's keygen command approval list

type ReqAddrStatus

type ReqAddrStatus struct {
	KeyID     string
	From      string
	GroupID   string
	Status    string
	PubKey    string
	ThresHold string
	Tip       string
	Error     string
	AllReply  []NodeReply
	TimeStamp string

	Initiator     string //enode id
	Keytype       string
	Mode          string
	FixedApprover []string
	PubKeySig     []string
	Sigs          string //5:enodeid1:account1:enodeid2:account2:enodeid3:account3:enodeid4:account4:enodeid5:account5
	Comment       string
}

ReqAddrStatus keygen result

type ReqDispatcher

type ReqDispatcher struct {
	// A pool of workers channels that are registered with the dispatcher
	WorkerPool chan chan RPCReq
}

ReqDispatcher worker pool

func NewReqDispatcher

func NewReqDispatcher(maxWorkers int) *ReqDispatcher

NewReqDispatcher new a worker pool.

func (*ReqDispatcher) Run

func (d *ReqDispatcher) Run()

Run start the worker

type ReqSmpcAddr

type ReqSmpcAddr struct {
}

ReqSmpcAddr keygen cmd request

func (*ReqSmpcAddr) CheckReply

func (req *ReqSmpcAddr) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool

CheckReply Detect whether all nodes in the group have sent accept data

func (*ReqSmpcAddr) CheckTxData

func (req *ReqSmpcAddr) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)

CheckTxData check generating pubkey command data and accept data

func (*ReqSmpcAddr) DisAcceptMsg

func (req *ReqSmpcAddr) DisAcceptMsg(raw string, workid int, key string)

DisAcceptMsg Collect accept data of nodes in the group, after collection, continue the MPC process

func (*ReqSmpcAddr) DoReq

func (req *ReqSmpcAddr) DoReq(raw string, workid int, sender string, ch chan interface{}) bool

DoReq 1.Parse the generated pubkey command and implement the process 2.analyze the accept data

func (*ReqSmpcAddr) GetGroupSigs

func (req *ReqSmpcAddr) GetGroupSigs(txdata []byte) (string, string, string, string)

GetGroupSigs get account sigs data from all node in group account sigs data: Signatures generated by respective accounts,the signature object is the pubkey of eNode,that is,enodeID. account sigs data: sig1 | sig2 | ... | sigN (N is the count of nodes in group.)

func (*ReqSmpcAddr) GetRawReply

func (req *ReqSmpcAddr) GetRawReply(ret *common.SafeMap, reply *RawReply)

GetRawReply put the reply to map, select the reply sent at the latest time reply.From ---> reply

func (*ReqSmpcAddr) GetReplyFromGroup

func (req *ReqSmpcAddr) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply

GetReplyFromGroup Get the current reply status of the nodes in the group. About this command request

func (*ReqSmpcAddr) GetReqAddrKeyByKey

func (req *ReqSmpcAddr) GetReqAddrKeyByKey(key string) string

GetReqAddrKeyByKey No need for reqaddr

type ReqSmpcReshare

type ReqSmpcReshare struct {
}

ReqSmpcReshare reshare cmd request

func (*ReqSmpcReshare) CheckReply

func (req *ReqSmpcReshare) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool

CheckReply Detect whether all nodes in the group have sent accept data

func (*ReqSmpcReshare) CheckTxData

func (req *ReqSmpcReshare) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)

CheckTxData check reshare command data and accept data

func (*ReqSmpcReshare) DisAcceptMsg

func (req *ReqSmpcReshare) DisAcceptMsg(raw string, workid int, key string)

DisAcceptMsg Collect accept data of nodes in the group, after collection, continue the MPC process

func (*ReqSmpcReshare) DoReq

func (req *ReqSmpcReshare) DoReq(raw string, workid int, sender string, ch chan interface{}) bool

DoReq 1.Parse the reshare command and implement the process 2.analyze the accept data

func (*ReqSmpcReshare) GetGroupSigs

func (req *ReqSmpcReshare) GetGroupSigs(txdata []byte) (string, string, string, string)

GetGroupSigs get account sigs data from all node in group account sigs data: Signatures generated by respective accounts,the signature object is the pubkey of eNode,that is,enodeID. account sigs data: sig1 | sig2 | ... | sigN (N is the count of nodes in group.)

func (*ReqSmpcReshare) GetRawReply

func (req *ReqSmpcReshare) GetRawReply(ret *common.SafeMap, reply *RawReply)

GetRawReply put the reply to map, select the reply sent at the latest time reply.From ---> reply

func (*ReqSmpcReshare) GetReplyFromGroup

func (req *ReqSmpcReshare) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply

GetReplyFromGroup Get the current reply status of the nodes in the group. About this command request

func (*ReqSmpcReshare) GetReqAddrKeyByKey

func (req *ReqSmpcReshare) GetReqAddrKeyByKey(key string) string

GetReqAddrKeyByKey No need for reshare

type ReqSmpcSign

type ReqSmpcSign struct {
}

ReqSmpcSign sign cmd request

func (*ReqSmpcSign) CheckReply

func (req *ReqSmpcSign) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool

CheckReply Detect whether all nodes in the group have sent accept data

func (*ReqSmpcSign) CheckTxData

func (req *ReqSmpcSign) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)

CheckTxData check sign/pre-sign command data and sign accept data

func (*ReqSmpcSign) DisAcceptMsg

func (req *ReqSmpcSign) DisAcceptMsg(raw string, workid int, key string)

DisAcceptMsg Collect accept data of nodes in the group, after collection, continue the MPC process

func (*ReqSmpcSign) DoReq

func (req *ReqSmpcSign) DoReq(raw string, workid int, sender string, ch chan interface{}) bool

DoReq 1.Parse the sign or pre-sign command and implement the process 2.analyze the accept data

func (*ReqSmpcSign) GetGroupSigs

func (req *ReqSmpcSign) GetGroupSigs(txdata []byte) (string, string, string, string)

GetGroupSigs No need for signing

func (*ReqSmpcSign) GetRawReply

func (req *ReqSmpcSign) GetRawReply(ret *common.SafeMap, reply *RawReply)

GetRawReply put the reply to map, select the reply sent at the latest time reply.From ---> reply

func (*ReqSmpcSign) GetReplyFromGroup

func (req *ReqSmpcSign) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply

GetReplyFromGroup Get the current reply status of the nodes in the group. About this command request

func (*ReqSmpcSign) GetReqAddrKeyByKey

func (req *ReqSmpcSign) GetReqAddrKeyByKey(key string) string

GetReqAddrKeyByKey sign key --->AccepSignData -----> pubkey ----->PubKeyData ---->reqaddr key

type SignBrocastData

type SignBrocastData struct {
	Raw      string
	PickHash []*PickHashKey
}

SignBrocastData the data (sign raw + the key of picked pre-sign data ) brocast to group

func UnCompressSignBrocastData

func UnCompressSignBrocastData(data string) (*SignBrocastData, error)

UnCompressSignBrocastData unmarshal json string to *SignBrocastData

func (*SignBrocastData) MarshalJSON

func (Sbd *SignBrocastData) MarshalJSON() ([]byte, error)

MarshalJSON marshal *SignBrocastData to json byte

func (*SignBrocastData) UnmarshalJSON

func (Sbd *SignBrocastData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to *SignBrocastData

type SignCurNodeInfo

type SignCurNodeInfo struct {
	Raw        string
	Key        string
	Account    string
	PubKey     string
	MsgHash    []string
	MsgContext []string
	KeyType    string
	GroupID    string
	Nonce      string
	ThresHold  string
	Mode       string
	TimeStamp  string
}

SignCurNodeInfo the info of the current node's approve list

func GetCurNodeSignInfo

func GetCurNodeSignInfo(geteracc string) ([]*SignCurNodeInfo, string, error)

GetCurNodeSignInfo Get current node's sign command approval list

type SignCurNodeInfoSort

type SignCurNodeInfoSort struct {
	Info []*SignCurNodeInfo
}

SignCurNodeInfoSort sort the info that get from current node's approve list

func (*SignCurNodeInfoSort) Len

func (s *SignCurNodeInfoSort) Len() int

Len get the count of arrary elements

func (*SignCurNodeInfoSort) Less

func (s *SignCurNodeInfoSort) Less(i, j int) bool

Less weather r.Info[i] < r.Info[j]

func (*SignCurNodeInfoSort) Swap

func (s *SignCurNodeInfoSort) Swap(i, j int)

Swap swap value of r.Info[i] and r.Info[j]

type SignData

type SignData struct {
	MsgPrex    string
	Key        string
	InputCodeT string
	Save       string
	Sku1       *big.Int
	Txhash     string
	GroupID    string
	NodeCnt    int
	ThresHold  int
	SmpcFrom   string
	Keytype    string
	Cointype   string
	Pkx        *big.Int
	Pky        *big.Int
	Pre        *PreSignData
}

SignData the data refer to sign

func (*SignData) MarshalJSON

func (sd *SignData) MarshalJSON() ([]byte, error)

MarshalJSON marshal *SignData to json byte

func (*SignData) UnmarshalJSON

func (sd *SignData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json string to *SignData

type SignPickData

type SignPickData struct {
	Raw      string
	PickData []*PickHashData
}

SignPickData raw + (hash,picked pre-sign data)

func UnCompressSignData

func UnCompressSignData(data string) (*SignPickData, error)

UnCompressSignData unmarshal json string to *SignPickData

func (*SignPickData) MarshalJSON

func (Spd *SignPickData) MarshalJSON() ([]byte, error)

MarshalJSON marshal *SignPickData to json byte

func (*SignPickData) UnmarshalJSON

func (Spd *SignPickData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to *SignPickData

type SignStatus

type SignStatus struct {
	KeyID      string
	From       string
	GroupID    string
	ThresHold  string
	MsgHash    []string
	MsgContext []string
	Status     string
	Rsv        []string
	Tip        string
	Error      string
	AllReply   []NodeReply
	TimeStamp  string

	Initiator     string //enode id
	PubKey        string
	Keytype       string
	Mode          string
	FixedApprover []string
	Comment       string
}

SignStatus sign result

type SignSubGidBrocastData

type SignSubGidBrocastData struct {
	Raw      string
	PickHash []*PickHashKey
	SubGid   string
}

SignSubGidBrocastData the data (sign raw + the key of picked pre-sign data ) brocast to group

func UnCompressSignSubGidBrocastData

func UnCompressSignSubGidBrocastData(data string) (*SignSubGidBrocastData, error)

UnCompressSignSubGidBrocastData unmarshal json string to *SignBrocastData

func (*SignSubGidBrocastData) MarshalJSON

func (Sbd *SignSubGidBrocastData) MarshalJSON() ([]byte, error)

MarshalJSON marshal *SignSubGidBrocastData to json byte

func (*SignSubGidBrocastData) UnmarshalJSON

func (Sbd *SignSubGidBrocastData) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal json byte to *SignSubGidBrocastData

type SubAddressBalance

type SubAddressBalance struct {
	Cointype string
	SmpcAddr string
	Balance  string
}

SubAddressBalance the balance of smpc addr

type SyncPreSign

type SyncPreSign struct {
	MsgPrex string
	EnodeID string
	Msg     string // "success" or "fail"
}

SyncPreSign the status of pre-generating sign data

func (*SyncPreSign) MarshalJSON

func (sps *SyncPreSign) MarshalJSON() ([]byte, error)

MarshalJSON marshal SyncPreSign data struct

func (*SyncPreSign) UnmarshalJSON

func (sps *SyncPreSign) UnmarshalJSON(raw []byte) error

UnmarshalJSON unmarshal to SyncPreSign data struct

type TxDataAcceptReShare

type TxDataAcceptReShare struct {
	TxType        string
	Account       string
	Nonce         string
	Key           string
	Accept        string
	TimeStamp     string
	FixedApprover []string
	Comment       string
}

TxDataAcceptReShare the data of the special tx of accepting reshare

type TxDataAcceptReqAddr

type TxDataAcceptReqAddr struct {
	TxType        string
	Account       string
	Nonce         string
	Key           string
	Accept        string
	TimeStamp     string
	FixedApprover []string
	Comment       string
}

TxDataAcceptReqAddr the data of the special tx of accepting keygen

type TxDataAcceptSign

type TxDataAcceptSign struct {
	TxType        string
	Account       string
	Nonce         string
	Key           string
	MsgHash       []string
	MsgContext    []string
	Accept        string
	TimeStamp     string
	FixedApprover []string
	Comment       string
}

TxDataAcceptSign the data of the special tx of accepting sign

type TxDataPreSignData

type TxDataPreSignData struct {
	TxType  string
	Account string
	Nonce   string
	PubKey  string
	SubGid  []string
	KeyType string
}

TxDataPreSignData the data of the special tx of pre-generating sign data

type TxDataReShare

type TxDataReShare struct {
	TxType        string
	Nonce         string
	PubKey        string
	GroupID       string
	TSGroupID     string
	ThresHold     string
	Account       string
	Mode          string
	AcceptTimeOut string
	Sigs          string
	TimeStamp     string
	FixedApprover []string
	Comment       string
	Keytype       string
}

TxDataReShare the data of the special tx of reshare

type TxDataReqAddr

type TxDataReqAddr struct {
	TxType        string
	Account       string
	Nonce         string
	Keytype       string
	GroupID       string
	ThresHold     string
	Mode          string
	FixedApprover []string
	AcceptTimeOut string
	TimeStamp     string
	Sigs          string
	Comment       string
}

TxDataReqAddr the data of the special tx of keygen

type TxDataSign

type TxDataSign struct {
	TxType        string
	Account       string
	Nonce         string
	PubKey        string
	InputCode     string
	MsgHash       []string
	MsgContext    []string
	Keytype       string
	GroupID       string
	ThresHold     string
	Mode          string
	AcceptTimeOut string
	TimeStamp     string
	FixedApprover []string
	Comment       string
}

TxDataSign the data of the special tx of sign

type WorkReq

type WorkReq interface {
	Run(workid int, ch chan interface{}) bool
}

WorkReq base type of work request

Jump to

Keyboard shortcuts

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