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 ¶
- Variables
- func AcceptReShare(initiator string, account string, groupid string, tsgroupid string, ...) (string, error)
- func AcceptReqAddr(raw string, initiator string, account string, cointype string, groupid string, ...) (string, error)
- func AcceptSign(raw string, initiator string, account string, pubkey string, msghash []string, ...) (string, error)
- func AccountLoaded() bool
- func AutoPreGenSignData()
- func BinarySearchVacancy(pubkey string, inputcode string, gid string, start int, end int) int
- func Call(msg interface{}, enode string)
- func Call2(msg interface{})
- func CheckAcc(eid string, geteracc string, sigs string) bool
- func CheckAccept(pubkey string, mode string, account string) bool
- func CheckGroupEnode(gid string) bool
- func CheckRaw(raw string) (string, string, string, interface{}, error)
- func CheckReply(l *list.List, rt RPCType, key string) bool
- func CheckReqAddrDulpRawReply(raw string, l *list.List) bool
- func CheckReshareDulpRawReply(raw string, l *list.List) bool
- func CheckSignDulpRawReply(raw string, l *list.List) bool
- func CleanUpAllReqAddrInfo()
- func CleanUpAllReshareInfo()
- func CleanUpAllSignInfo()
- func CleanUpMsgReceiv()
- func Compress(c []byte) (string, error)
- func CompressSignBrocastData(raw string, pickhash []*PickHashKey) (string, error)
- func CompressSignData(raw string, pickdata []*PickHashData) (string, error)
- func CompressSignSubGidBrocastData(raw string, pickhash []*PickHashKey, subgid string) (string, error)
- func CopyAllAccountsFromDb()
- func DECDSASignVerifyRSV(keytype string, r *big.Int, s *big.Int, v int32, message string, pkx *big.Int, ...) bool
- func Decode2(s string, datatype string) (interface{}, error)
- func DecryptMsg(cm string) (string, error)
- func DelPrekeyFromDb(pubkey string, inputcode string, gid string, keytype string) error
- func DeleteAccountDataFromDb(key []byte) error
- func DeletePreSignData(pubkey string, inputcode string, gid string, datakey string) error
- func DeletePubKeyData(key []byte) error
- func DeleteReShareInfoData(key []byte) error
- func DeleteReqAddrInfoData(key []byte) error
- func DeleteSignInfoData(key []byte) error
- func DisAcceptMsg(raw string, workid int)
- func DisMsg(msg string)
- func DoPreSign(pubkey string, gid string, hash string, mode string, keytype string) string
- func DoSign(sbd *SignPickData, workid int, sender string, ch chan interface{}) error
- func DoubleHash(id string, keytype string) *big.Int
- func EdSignGetRealMessage(msg map[string]string) smpclib.Message
- func EdSignProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, ...)
- func Encode2(obj interface{}) (string, error)
- func EncryptMsg(msg string, enodeID string) (string, error)
- func ExcutePreSignData(pre *TxDataPreSignData)
- func ExecApproveKeyGen(raw string, from string, req *TxDataAcceptReqAddr, ac *AcceptReqAddrData, ...)
- func ExecApproveSigning(raw string, from string, sig *TxDataAcceptSign, ac *AcceptSignData, check bool)
- func Find(l *list.List, msg string) bool
- func GetAccountFromDb(key []byte) (bool, interface{})
- func GetAccounts(geteracc, mode string) (interface{}, string, error)
- func GetAccountsBalance(pubkey string, geteracc string) (interface{}, string, error)
- func GetAccountsDir() string
- func GetAddr(pubkey string, cointype string) (string, string, error)
- func GetApproverByReqAddrKey(key string, enodeID string) string
- func GetBalance(account string, cointype string, smpcaddr string) (string, string, error)
- func GetBip32CDir() string
- func GetBip32ChildKey(rootpubkey string, inputcode string, keytype string, mode string) (string, string, error)
- func GetChannelValue(t int, obj interface{}) (string, string, error)
- func GetCmdKey(msg string) string
- func GetCmdReqAddrInfoDb() *ethdb.LDBDatabase
- func GetCurNodeIndex(gid string, subgid string, keytype string) int
- func GetCurNodePaillierSkFromSaveData(save string, gid string, keytype string) *ec2.PrivateKey
- func GetDbDir() string
- func GetENodeByFrom(from string, ac *AcceptReqAddrData) string
- func GetEnodesForSubGroup(id int, gid string) []string
- func GetGroupDir() string
- func GetGroupNodeUIDs(keytype string, gid string, subgid string) smpclib.SortableIDSSlice
- func GetGroupSigsDataByRaw(raw string) (string, error)
- func GetIDReshareByGroupID(msgtoenode map[string]string, groupid string) smpclib.SortableIDSSlice
- func GetIDs(keytype string, groupid string) smpclib.SortableIDSSlice
- func GetKeyFromData(txdata []byte) string
- func GetKeyTypeFromData(txdata []byte) string
- func GetMpcNodeInfo() (string, error)
- func GetMsgSigHash(message []byte) []byte
- func GetMsgToEnode(keytype string, gid string, groupid string) map[string]string
- func GetNodeUID(EnodeID string, keytype string, gid string) (int, *big.Int)
- func GetNtildeByIndexFromSaveData(save string, index int, NodeCnt int) *ec2.NtildeH1H2
- func GetNtildePrivDataByIndexFromSaveData(save string, NodeCnt int) *ec2.NtildePrivData
- func GetPaillierPkByIndexFromSaveData(save string, index int) *ec2.PublicKey
- func GetPreDbDir() string
- func GetPreKeyDir() string
- func GetPrePubGids(pub string) []string
- func GetPreSigal(pub string) bool
- func GetPreSignKey(pubkey string, inputcode string, gid string, index string) (string, error)
- func GetPubKeyData(key []byte) (bool, interface{})
- func GetPubKeyData2(key string, account string, cointype string) (string, string, error)
- func GetRawReply(l *list.List) *common.SafeMap
- func GetRawType(raw string) (string, string)
- func GetReShareInfoData(key []byte) (bool, interface{})
- func GetReShareInfoDir() string
- func GetReShareNonce(account string) (string, string, error)
- func GetReShareStatus(key string) (string, string, error)
- func GetRealMessage(msg map[string]string) smpclib.Message
- func GetRealMessageEDDSA(msg map[string]string) smpclib.Message
- func GetReply(id int) int
- func GetReqAddrInfoData(key []byte) (bool, interface{})
- func GetReqAddrInfoDir() string
- func GetReqAddrKeyByOtherKey(key string, rt RPCType) string
- func GetReqAddrNonce(account string) (string, string, error)
- func GetReqAddrRawValue(raw string) (string, string, string)
- func GetReqAddrStatus(key string) (string, string, error)
- func GetReshareRawValue(raw string) (string, string, string)
- func GetRetErr(err string) error
- func GetSignInfoData(key []byte) (bool, interface{})
- func GetSignInfoDir() string
- func GetSignNonce(account string) (string, string, error)
- func GetSignRawValue(raw string) (string, string, string)
- func GetSignStatus(key string) (string, string, error)
- func GetSignString(r *big.Int, s *big.Int, v int) string
- func GetSkU1Dir() string
- func GetSmpcAccountsDirDb() *ethdb.LDBDatabase
- func GetSmpcAddr(pubkey string) (string, string, error)
- func GetSmpcBip32Db() *ethdb.LDBDatabase
- func GetSmpcDb() *ethdb.LDBDatabase
- func GetSmpcGidDb() *ethdb.LDBDatabase
- func GetSmpcPreDb() *ethdb.LDBDatabase
- func GetSmpcPreKeyDb() *ethdb.LDBDatabase
- func GetSmpcReShareInfoDb() *ethdb.LDBDatabase
- func GetSmpcSignInfoDb() *ethdb.LDBDatabase
- func GetSmpcSkDb() *ethdb.LDBDatabase
- func GetTotalCount(pubkey string, inputcode string, gid string) int
- func GetTxTypeFromData(txdata []byte) string
- func GetUint64FromStr(str string) (uint64, error)
- func GetWorkerID(w *RPCReqWorker) (int, error)
- func Handle(key string, c1data string)
- func HandleC1Data(ac *AcceptReqAddrData, key string)
- func HandleKG(key string, uid *big.Int)
- func HandleRPCSign()
- func HandleRPCSign2(rsd *RPCSignData)
- func HandleSign(key string, uid *big.Int)
- func Init(groupID string)
- func InitChan()
- func InitGroupInfo(groupID string)
- func InitMpcNodeInfo()
- func IsEDSignCmd(raw string) (string, bool)
- func IsGenKeyCmd(raw string) (bool, string)
- func IsInGroup(gid string) bool
- func IsMsg2Peer(msgmap map[string]string) (bool, string, string, string)
- func IsNotFoundErr(err error) bool
- func IsPreGenSignData(raw string) (string, bool)
- func IsReshareCmd(raw string) (bool, string)
- func IsSignDataCmd(raw string) (string, bool)
- func IsValidAccept(gid string, from string, ac *AcceptReqAddrData) bool
- func IsValidReShareAccept(from string, gid string) bool
- func KeyGenerateDECDSA(msgprex string, ch chan interface{}, id int, cointype string) bool
- func KeyGenerateDEDDSA(msgprex string, ch chan interface{}, id int, cointype string) bool
- func MsgRun(raw string, workid int, sender string, ch chan interface{}) error
- func NeedPreSign(pubkey string, inputcode string, gid string) (int, bool)
- func NeedPreSignForBip32(pubkey string, inputcode string, gid string) (int, bool)
- func NeedToStartPreBip32(pub string) bool
- func NowMilliStr() string
- func PreGenSignData(raw string) (string, error)
- func ProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, ...)
- func ProcessInboundMessagesEDDSA(msgprex string, keytype string, finishChan chan struct{}, ...)
- func ProcessOutCh(msgprex string, msg smpclib.Message, keytype string) error
- func PutAccountDataToDb(key []byte, value []byte) error
- func PutPrePubGids(pub string, gids []string)
- func PutPreSigal(pub string, val bool)
- func PutPreSignData(pubkey string, inputcode string, gid string, index int, val *PreSignData, ...) error
- func PutPubKeyData(key []byte, value []byte) error
- func PutReShareInfoData(key []byte, value []byte) error
- func PutReqAddrInfoData(key []byte, value []byte) error
- func PutSignInfoData(key []byte, value []byte) error
- func RPCAcceptReShare(raw string) (string, string, error)
- func RPCAcceptReqAddr(raw string) (string, string, error)
- func RPCAcceptSign(raw string) (string, string, error)
- func ReShare(raw string) (string, string, error)
- func ReShareEC2(raw string, msgprex string, initator string, groupid string, pubkey string, ...)
- func RegP2pBroadcastInGroupOthersCallBack(f func(string, string) (string, error))
- func RegP2pGetGroupCallBack(f func(string) (int, string))
- func RegP2pGetSelfEnodeCallBack(f func() string)
- func RegP2pParseNodeCallBack(f func(string) string)
- func RegP2pSendMsgToPeerCallBack(f func(string, string) error)
- func RegP2pSendToGroupAllNodesCallBack(f func(string, string) (string, error))
- func RegSmpcGetEosAccountCallBack(f func() (string, string, string))
- func ReqKeyGen(raw string) (string, string, error)
- func ReshareGetRealMessage(msg map[string]string) smpclib.Message
- func ReshareProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, ...)
- func ReshareProcessOutCh(msgprex string, groupid string, msg smpclib.Message, keytype string) error
- func SaveAcceptReShareData(ac *AcceptReShareData) error
- func SaveAcceptReqAddrData(ac *AcceptReqAddrData) error
- func SaveAcceptSignData(ac *AcceptSignData) error
- func SavePrekeyToDb(pubkey string, inputcode string, gid string, keytype string) error
- func SendMsgToPeer(enodes string, msg string)
- func SendMsgToPeerWithBrodcast(key string, enodes string, msg string, groupid string)
- func SendMsgToSmpcGroup(msg string, groupid string)
- func SetReShareNonce(account string, nonce string) (string, error)
- func SetReqAddrNonce(account string, nonce string) (string, error)
- func SetSignNonce(account string, nonce string) (string, error)
- func SetUpMsgList(msg string, enode string)
- func SetUpMsgList2(msg string)
- func SetUpMsgList3(msg string, enode string, rch chan interface{})
- func Sign(raw string) (string, string, error)
- func SignEC3(msgprex string, message string, cointype string, save string, pkx *big.Int, ...) string
- func SignED(msgprex string, save string, sku1 *big.Int, message string, cointype string, ...) string
- func SignGetRealMessage(msg map[string]string) smpclib.Message
- func SignProcessInboundMessages(msgprex string, keytype string, finishChan chan struct{}, ...)
- func SignProcessOutCh(msgprex string, keytype string, msgtoenode map[string]string, ...) error
- func Start(params *LunchParams)
- func StartSmpcLocalDb() error
- func SynchronizePreSignData(msgprex string, wid int, success bool) bool
- func ToolDecimalByteSlice2HexString(DecimalSlice []byte) string
- func UnCompress(s string) (string, error)
- type AcceptReShareData
- type AcceptReqAddrData
- type AcceptSignData
- type AccountsBalanceRes
- type AccountsList
- type AddrRes
- type ApprovReply
- type ByteHash
- type CmdReq
- type ECDSASignature
- func (rsv *ECDSASignature) GetR() *big.Int
- func (rsv *ECDSASignature) GetRecoveryParam() int32
- func (rsv *ECDSASignature) GetS() *big.Int
- func (rsv *ECDSASignature) New()
- func (rsv *ECDSASignature) SetR(r *big.Int)
- func (rsv *ECDSASignature) SetRecoveryParam(recoveryParam int32)
- func (rsv *ECDSASignature) SetS(s *big.Int)
- type Err
- type ErrorRet
- type KGLocalDBSaveData
- type KGLocalDBSaveDataED
- type LunchParams
- type MpcNodeInfo
- type MsgSig
- type NodeReply
- type PickHashData
- type PickHashKey
- type PreSign
- type PreSignData
- func BinarySearchPick(pubkey string, inputcode string, gid string, start int, end int) (int, *PreSignData)
- func BinarySearchPreSignData(pubkey string, inputcode string, gid string, datakey string, start int, ...) (int, *PreSignData)
- func GetPreSignData(pubkey string, inputcode string, gid string, datakey string) *PreSignData
- func PickPreSignData(pubkey string, inputcode string, gid string) *PreSignData
- func PreSignEC3(msgprex string, save string, sku1 *big.Int, pkx *big.Int, pky *big.Int, ...) *PreSignData
- type PubAccounts
- type PubKeyData
- type PubKeyInfo
- type PubkeyRes
- type RPCReq
- type RPCReqWorker
- type RPCSignData
- type RPCSmpcRes
- type RPCType
- type RawReply
- type ReShareCurNodeInfo
- type ReShareCurNodeInfoSort
- type ReShareStatus
- type RecvMsg
- type ReqAddrCurNodeInfoSort
- type ReqAddrReply
- type ReqAddrStatus
- type ReqDispatcher
- type ReqSmpcAddr
- func (req *ReqSmpcAddr) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool
- func (req *ReqSmpcAddr) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)
- func (req *ReqSmpcAddr) DisAcceptMsg(raw string, workid int, key string)
- func (req *ReqSmpcAddr) DoReq(raw string, workid int, sender string, ch chan interface{}) bool
- func (req *ReqSmpcAddr) GetGroupSigs(txdata []byte) (string, string, string, string)
- func (req *ReqSmpcAddr) GetRawReply(ret *common.SafeMap, reply *RawReply)
- func (req *ReqSmpcAddr) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply
- func (req *ReqSmpcAddr) GetReqAddrKeyByKey(key string) string
- type ReqSmpcReshare
- func (req *ReqSmpcReshare) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool
- func (req *ReqSmpcReshare) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)
- func (req *ReqSmpcReshare) DisAcceptMsg(raw string, workid int, key string)
- func (req *ReqSmpcReshare) DoReq(raw string, workid int, sender string, ch chan interface{}) bool
- func (req *ReqSmpcReshare) GetGroupSigs(txdata []byte) (string, string, string, string)
- func (req *ReqSmpcReshare) GetRawReply(ret *common.SafeMap, reply *RawReply)
- func (req *ReqSmpcReshare) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply
- func (req *ReqSmpcReshare) GetReqAddrKeyByKey(key string) string
- type ReqSmpcSign
- func (req *ReqSmpcSign) CheckReply(ac *AcceptReqAddrData, l *list.List, key string) bool
- func (req *ReqSmpcSign) CheckTxData(raw string, txdata []byte, from string, nonce uint64) (string, string, string, interface{}, error)
- func (req *ReqSmpcSign) DisAcceptMsg(raw string, workid int, key string)
- func (req *ReqSmpcSign) DoReq(raw string, workid int, sender string, ch chan interface{}) bool
- func (req *ReqSmpcSign) GetGroupSigs(txdata []byte) (string, string, string, string)
- func (req *ReqSmpcSign) GetRawReply(ret *common.SafeMap, reply *RawReply)
- func (req *ReqSmpcSign) GetReplyFromGroup(wid int, gid string, initiator string) []NodeReply
- func (req *ReqSmpcSign) GetReqAddrKeyByKey(key string) string
- type SignBrocastData
- type SignCurNodeInfo
- type SignCurNodeInfoSort
- type SignData
- type SignPickData
- type SignStatus
- type SignSubGidBrocastData
- type SubAddressBalance
- type SyncPreSign
- type TxDataAcceptReShare
- type TxDataAcceptReqAddr
- type TxDataAcceptSign
- type TxDataPreSignData
- type TxDataReShare
- type TxDataReqAddr
- type TxDataSign
- type WorkReq
Constants ¶
This section is empty.
Variables ¶
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
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) )
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) )
var ( // KeyFile bootnode keyfile KeyFile string RelayInPeers bool )
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 )
var (
// PaillierKeyLength paillier key len
PaillierKeyLength = 2048
)
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 ¶
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 CheckAcc ¶
CheckAcc Check whether the account has permission to agree the request(keygen/sign/reshare)
func CheckAccept ¶
CheckAccept judge whether the pubkey account has permission to agree to sign
func CheckGroupEnode ¶
CheckGroupEnode Judge whether there is same enodeID in group
func CheckReply ¶
CheckReply Detect whether all nodes in the group have sent accept data
func CheckReqAddrDulpRawReply ¶
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 ¶
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 ¶
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 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 DelPrekeyFromDb ¶
DelPrekeyFromDb delete pubkey gid information to the specified batabase
func DeleteAccountDataFromDb ¶
DeleteAccountDataFromDb delete value from database for saving all pubkeys
func DeletePreSignData ¶
DeletePreSignData delete pre-sign data from local db under the specified pubkey/gid/inputcode
func DeletePubKeyData ¶
DeletePubKeyData delete value from general database by key
func DeleteReShareInfoData ¶
DeleteReShareInfoData delete value from database for saving data related to reshare command
func DeleteReqAddrInfoData ¶
DeleteReqAddrInfoData delete value from database for saving data related to generate pubkey command
func DeleteSignInfoData ¶
DeleteSignInfoData delete value from database for saving data related to sign command
func DisAcceptMsg ¶
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 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 ¶
DoubleHash The EnodeID is converted into a hash value according to different keytypes
func EdSignGetRealMessage ¶
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 EncryptMsg ¶
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 GetAccountFromDb ¶
GetAccountFromDb get value from database for saving all pubkeys
func GetAccounts ¶
GetAccounts get all accounts generated by special account
func GetAccountsBalance ¶
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 GetApproverByReqAddrKey ¶
func GetBalance ¶
GetBalance get the balance by smpc address
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 ¶
GetChannelValue get channel value within the specified timeout
func GetCmdReqAddrInfoDb ¶
func GetCmdReqAddrInfoDb() *ethdb.LDBDatabase
GetCmdReqAddrInfoDb open database for saving data related to generate pubkey command
func GetCurNodeIndex ¶
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 GetENodeByFrom ¶
func GetENodeByFrom(from string, ac *AcceptReqAddrData) string
func GetEnodesForSubGroup ¶
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 ¶
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 ¶
GetKeyFromData get special tx data type from command data or accept data
func GetKeyTypeFromData ¶
GetKeyTypeFromData get special tx data type from command data or accept data
func GetMpcNodeInfo ¶
func GetMsgSigHash ¶
func GetMsgToEnode ¶
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 ¶
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 ¶
GetPaillierPkByIndexFromSaveData get paillier pubkey by index from saved data that obtained when generating pubkey
func GetPreKeyDir ¶
func GetPreKeyDir() string
GetPreKeyDir get public key group information database dir
func GetPrePubGids ¶
GetPrePubGids get gids by pub pub = hash256(pubkey : gid)
func GetPreSigal ¶
GetPreSigal Return whether to continue generating pre-sign data pub = hash256(pubkey : gid) true yes false no
func GetPreSignKey ¶
GetPreSignKey get the key of level db that saving pre-sign data strings.ToLower(256Hash(pubkey:inputcode:gid:index)) ---> PreSignData
func GetPubKeyData ¶
GetPubKeyData get data by key from general database
func GetPubKeyData2 ¶
GetPubKeyData2 get pubkey data by key/accout/contype pubkey data,such as : account,pubkey,smpc address,cointype
func GetRawReply ¶
GetRawReply Analyze the accept data of nodes in the group map ret: from1 ---> *RawReply{...} from2 ---> *RawReply{...} from3 ---> *RawReply{...} ...
func GetRawType ¶
GetRawType get special tx data type and key from command data or accept data
func GetReShareInfoData ¶
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 ¶
GetReShareNonce get reshare special tx nonce
func GetReShareStatus ¶
GetReShareStatus get the result of the reshare request by key
func GetRealMessage ¶
GetRealMessage get the message data struct by map. (p2p msg ---> map)
func GetRealMessageEDDSA ¶
GetRealMessageEDDSA get the message data struct by map. (p2p msg ---> map)
func GetReqAddrInfoData ¶
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 ¶
GetReqAddrKeyByOtherKey sign key --->AccepSignData -----> pubkey ----->PubKeyData ---->reqaddr key
func GetReqAddrNonce ¶
GetReqAddrNonce get keygen special tx nonce
func GetReqAddrRawValue ¶
GetReqAddrRawValue get from/special tx data type/timestamp from generating pubkey command data
func GetReqAddrStatus ¶
GetReqAddrStatus get the result of the keygen request by key
func GetReshareRawValue ¶
GetReshareRawValue get from/special tx data type/timestamp from reshare command data
func GetSignInfoData ¶
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 ¶
GetSignNonce get sign special tx nonce
func GetSignRawValue ¶
GetSignRawValue get from/special tx data type/timestamp from sign command data
func GetSignStatus ¶
GetSignStatus get the result of the sign request by key
func GetSignString ¶
GetSignString get RSV string
func GetSmpcAccountsDirDb ¶
func GetSmpcAccountsDirDb() *ethdb.LDBDatabase
GetSmpcAccountsDirDb open database for saving all pubkeys
func GetSmpcAddr ¶
GetSmpcAddr Obtain SMPC addresses in different currencies in pubkey
func GetSmpcBip32Db ¶
func GetSmpcBip32Db() *ethdb.LDBDatabase
GetSmpcBip32Db open bip32 c value 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 GetTotalCount ¶
GetTotalCount Gets the number of currently generated pre-sign data under the specified pubkey/gid/inputcode
func GetTxTypeFromData ¶
GetTxTypeFromData get special tx data type from command data or accept data
func GetUint64FromStr ¶
GetUint64FromStr get uint64 from string.
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 HandleRPCSign ¶
func HandleRPCSign()
HandleRPCSign handle sign request,read sign command from the channel and do it!
func HandleRPCSign2 ¶
func HandleRPCSign2(rsd *RPCSignData)
func HandleSign ¶
HandleSign Process pre-save msg for sign
func InitChan ¶
func InitChan()
InitChan init workers,RpcReqQueue,ReqDispatcher and start the worker.
func InitMpcNodeInfo ¶
func InitMpcNodeInfo()
func IsEDSignCmd ¶
IsEDSignCmd Judge whether it is the ed sign command data
func IsGenKeyCmd ¶
IsGenKeyCmd Judge whether it is the command data that generating pubkey
func IsMsg2Peer ¶
IsMsg2Peer Judge whether it is the msg that send to special peer
func IsNotFoundErr ¶
IsNotFoundErr weather it is "Not Found in db" error
func IsPreGenSignData ¶
IsPreGenSignData Judge whether it is the command data that generating pre-sign data
func IsReshareCmd ¶
IsReshareCmd Judge whether it is Reshare command data
func IsSignDataCmd ¶
IsSignDataCmd Judge whether it is the "SignData" data struct
func IsValidAccept ¶
func IsValidAccept(gid string, from string, ac *AcceptReqAddrData) bool
func IsValidReShareAccept ¶
IsValidReShareAccept is valid reshare accept??
func KeyGenerateDECDSA ¶
KeyGenerateDECDSA generate the pubkey ec2 msgprex = hash
func KeyGenerateDEDDSA ¶
KeyGenerateDEDDSA generate the pubkey ed msgprex = hash cointype = keytype // ec || ed25519
func NeedPreSign ¶
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 ¶
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 ¶
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 ¶
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 ¶
ProcessOutCh send message to other node
func PutAccountDataToDb ¶
PutAccountDataToDb put value to database for saving all pubkeys
func PutPrePubGids ¶
PutPrePubGids put gids to map by pub pub = hash256(pubkey : gid)
func PutPreSigal ¶
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 ¶
PutPubKeyData put value to general database
func PutReShareInfoData ¶
PutReShareInfoData put value to database for saving data related to reshare command
func PutReqAddrInfoData ¶
PutReqAddrInfoData put value to database for saving data related to generate pubkey command
func PutSignInfoData ¶
PutSignInfoData put value to database for saving data related to sign command
func RPCAcceptReShare ¶
RPCAcceptReShare Agree to the reshare request raw : accept data, including the key of the reshare request
func RPCAcceptReqAddr ¶
RPCAcceptReqAddr Agree to the keygen request raw : accept data, including the key of the keygen request
func RPCAcceptSign ¶
RPCAcceptSign Agree to the sign request raw : accept data, including the key of the sign request
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 ¶
RegP2pBroadcastInGroupOthersCallBack set p2p callback func BroadcastInGroupOthers
func RegP2pGetGroupCallBack ¶
RegP2pGetGroupCallBack set p2p callback func GetGroup
func RegP2pGetSelfEnodeCallBack ¶
func RegP2pGetSelfEnodeCallBack(f func() string)
RegP2pGetSelfEnodeCallBack set p2p callback func GetSelfEnode
func RegP2pParseNodeCallBack ¶
RegP2pParseNodeCallBack set p2p callback func ParseNode
func RegP2pSendMsgToPeerCallBack ¶
RegP2pSendMsgToPeerCallBack set p2p callback func SendToPeer
func RegP2pSendToGroupAllNodesCallBack ¶
RegP2pSendToGroupAllNodesCallBack set p2p callback func SendToGroupAllNodes
func RegSmpcGetEosAccountCallBack ¶
RegSmpcGetEosAccountCallBack set p2p callback func GetEosAccount
func ReshareGetRealMessage ¶
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 ¶
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 ¶
SavePrekeyToDb save pubkey gid information to the specified batabase
func SendMsgToPeer ¶
SendMsgToPeer send msg to special peer
func SendMsgToPeerWithBrodcast ¶
SendMsgToPeerWithBrodcast send msg to special peer with brodcast
func SendMsgToSmpcGroup ¶
SendMsgToSmpcGroup brodcast msg to group nodes by group id
func SetReShareNonce ¶
SetReShareNonce set reshare special tx nonce
func SetReqAddrNonce ¶
SetReqAddrNonce set keygen special tx nonce
func SetSignNonce ¶
SetSignNonce set sign special tx nonce
func SetUpMsgList ¶
SetUpMsgList set RecvMsg data to RPCReqQueue
func SetUpMsgList3 ¶
SetUpMsgList3 set RecvMsg data to RPCReqQueue
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 ¶
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 SynchronizePreSignData ¶
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 ¶
ToolDecimalByteSlice2HexString transfer Decimal byte to hex string
Types ¶
type AcceptReShareData ¶
type AcceptReShareData struct {}
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 ApprovReply ¶
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 ¶
Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.
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) GetRecoveryParam ¶
func (rsv *ECDSASignature) GetRecoveryParam() int32
GetRecoveryParam get v
func (*ECDSASignature) SetRecoveryParam ¶
func (rsv *ECDSASignature) SetRecoveryParam(recoveryParam int32)
SetRecoveryParam set v
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 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 ¶
GetAllReplyFromGroup get all accept reply from group node
func GetAllReplyFromGroup2 ¶
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 ¶
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 ¶
MarshalJSON marshal PreSign data struct to json byte
func (*PreSign) UnmarshalJSON ¶
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 Comment string }
PubKeyData the data of after keygen,include: pubkey,all nodes's paillier pubkey,paillier privatekey,mpc sk,ntilde data .... etc.
type PubKeyInfo ¶
PubKeyInfo pubkey info
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) 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.
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 ¶
RPCSmpcRes smpc rpc result
type ReShareCurNodeInfo ¶
type ReShareCurNodeInfo struct {}
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 {
}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 RecvMsg ¶
type RecvMsg struct {
// contains filtered or unexported fields
}
RecvMsg msg data by channel or p2p and its sender
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.
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 ¶
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 ¶
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 ¶
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 ¶
MarshalJSON marshal *SignData to json byte
func (*SignData) UnmarshalJSON ¶
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 ¶
SubAddressBalance the balance of smpc addr
type SyncPreSign ¶
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 {}
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 {}
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