Versions in this module Expand all Collapse all v0 v0.4.1 Dec 28, 2018 Changes in this version + const BITCOIN_BASE58_TABLE + const P2PKHOutputSize + const P2PKHPkScriptSize + const P2WPKHOutputSize + const P2WPKHPkScriptSize + const PASSWD + const RPCCLIENT_TIMEOUT + const RedeemNestedP2WPKHInputSize + const RedeemNestedP2WPKHScriptSize + const RedeemP2PKHInputSize + const RedeemP2PKHSigScriptSize + const RedeemP2WPKHInputSize + const RedeemP2WPKHInputWitnessWeight + const RedeemP2WPKHScriptSize + const SERVER_HOST + const SERVER_PORT + const USER + const USESSL + const VERSION + const WALLET_PASSPHRASE + var BTC_BLOCK_CONFIRMS int64 + var CHAIN_ID = 4 + var DcrmDataMaxQueue = 10 + var DcrmDataQueue chan DcrmData + var ETH_SERVER = "http://54.183.185.30:8018" + var FSN Backend + var MPK = generateMasterPK() + var NodeCnt = 4 + var RpcMaxNonDcrmQueue = 20000 + var RpcMaxNonDcrmWorker = 20000 + var RpcMaxQueue = 20000 + var RpcMaxWorker = 20000 + var RpcReqNonDcrmQueue chan RpcReq + var RpcReqQueue chan RpcReq + var SecureRnd = rand.New(rand.NewSource(rnd_num)) + var ZKParams *PublicParameters + func Base58Decode(bitcoin_net int, input []byte) []byte + func Btc_createTransaction(msgprex string, dcrmaddr string, toAddr string, changeAddress string, ...) string + func CalcKgKey(msgprex string, encXShare *big.Int, kgx0 *big.Int, kgy0 *big.Int, id int) bool + func CheckCmt(msgprex string, id int) bool + func CheckCmt2(msgprex string, id int) bool + func CheckCmt3(msgprex string, id int) bool + func ChooseDcrmAddrForLockoutByValue(dcrmaddr string, lockoutto string, value float64) bool + func ChooseRealFusionAccountForLockout(amount string, lockoutto string, cointype string) (string, string, error) + func Coinbase() (eb common.Address, err error) + func Dcrm_ConfirmAddr(wr WorkReq) (string, error) + func Dcrm_GetAccountList(pubkey string) (string, error) + func Dcrm_LiLoReqAddress(wr WorkReq) (string, error) + func Dcrm_LockIn(tx string, txhashs []string) (string, error) + func Dcrm_NodeInfo() (string, error) + func Dcrm_ReqAddress(wr WorkReq) (string, error) + func Dcrm_Sign(wr WorkReq) (string, error) + func DecryptSplitPrivKey(cDPrivKey string, enodeID string) (dPrivKey *big.Int, err error) + func DefaultDataDir() string + func DisMsg(msg string) + func DispenseSplitPrivKey(enode interface{}) + func EncryptSplitPrivKey(dPrivKey *big.Int, pub *ecies.PublicKey) (cDPrivKey string, err error) + func Erc20_newUnsignedTransaction(client *ethclient.Client, dcrmAddress string, toAddressHex string, ...) (*types.Transaction, *common.Hash, error) + func Erc20_sendTx(client *ethclient.Client, signedTx *types.Transaction) (string, error) + func EstimateSerializeSize(inputCount int, txOuts []*wire.TxOut, addChangeOutput bool) int + func EstimateVirtualSize(numP2PKHIns, numP2WPKHIns, numNestedP2WPKHIns int, txOuts []*wire.TxOut, ...) int + func GenerateBTC() (string, string, error) + func GenerateBTCTest(pubkey []byte) (string, string, error) + func GetBTCTxFee(dcrmaddr string, lockoutto string, value float64) (float64, error) + func GetChannelValue(obj interface{}) (string, error) + func GetDbDir() string + func GetDbDirForLockin() string + func GetDbDirForLockoutInfo() string + func GetDbDirForNodeInfoSave() string + func GetDbDirForWriteDcrmAddr() string + func GetDcrmAddr(hash string, cointype string) string + func GetEnodePrivKey(enodeID string) (prv *ecies.PrivateKey, err error) + func GetEnodesInfo() + func GetFee(cointype string) float64 + func GetLockoutInfoFromLocalDB(hashkey string) (string, error) + func GetPaillierKey(rnd io.Reader, bitlen int, paillier_dprivkey *big.Int, tmp string) + func GetPublicParams(BitCurve *secp256k1.BitCurve, primeCertainty int32, kPrime int32, ...) + func GetRawTransactionHash(decode string) string + func GetSignString(r *big.Int, s *big.Int, v int32, i int) string + func GetTxHashForLockout(realfusionfrom string, realdcrmfrom string, to string, value string, ...) (string, string, error) + func HashPubKey(pubKey []byte) []byte + func Init(tmp string, paillier_dprivkey *big.Int, nodecnt int) + func InitChan() + func InitDcrmData() + func InitNonDcrmChan() + func IsDcrmAddr(addr string) bool + func IsExsitDcrmValidateData(data string) bool + func IsFusionAccountExsitDcrmAddr(fusion string, cointype string, dcrmaddr string) (bool, string, error) + func IsHashkeyExsitInLocalDB(hashkey string) (bool, error) + func IsInGroup() bool + func IsNodeInfoExsitInLocalDB(nodeinfo string) (bool, error) + func IsValidDcrmAddr(s string, cointype string) bool + func IsValidFusionAddr(s string) bool + func KeyGenerate(msgprex string, ch chan interface{}, id int) bool + func MakeSignedTransaction(client *ethclient.Client, tx *types.Transaction, rsv string) (*types.Transaction, error) + func ManuallySplitPrivKey(privKey *big.Int, userCnt int) (dPrivKeyList []*big.Int) + func NewClient(host string, port int, user, passwd string, useSSL bool) (c *rpcClient, err error) + func PathExists(path string) (bool, error) + func ReadDcrmAddrFromLocalDBByIndex(fusion string, cointype string, index int) (string, error) + func ReadNodeInfoFromLocalDB(nodeinfo string) (string, error) + func RestoreNodeInfo() + func SendMsgToDcrmGroup(msg string) + func SendReqToGroup(msg string, rpctype string) (string, error) + func SendTxForLockout(realfusionfrom string, realdcrmfrom string, to string, value string, ...) (string, error) + func SetBackend(e Backend) + func SetDatadir(data string) + func SetPaillierThresholdIndex(d int) + func SetUpMsgList(msg string) + func Sign(msgprex string, encX *big.Int, message string, tokenType string, pkx *big.Int, ...) + func SumOutputSerializeSizes(outputs []*wire.TxOut) (serializeSize int) + func SumOutputValues(outputs []*wire.TxOut) (totalOutput btcutil.Amount) + func ToWIF(priv []byte) (wif string) + func Tool_DecimalByteSlice2HexString(DecimalSlice []byte) string + func ValidBTCTx(returnJson string, txhash string, realdcrmfrom string, realdcrmto string, ...) + func ValidateAddress(bitcoin_net int, address string) bool + func ValidateDcrm(txhash string) bool + func Validate_Lockout(wr WorkReq) (string, error) + func Validate_Txhash(wr WorkReq) (string, error) + func Verify(r *big.Int, s *big.Int, v int32, message string, pkx *big.Int, pky *big.Int) bool + func WriteDcrmAddrToLocalDB(fusion string, cointype string, dcrmaddr string) (bool, error) + func WriteHashkeyToLocalDB(hashkey string, value string) (bool, error) + func WriteLockoutInfoToLocalDB(hashkey string, value string) (bool, error) + func WriteNodeInfoToLocalDB(nodeinfo string, value string) (bool, error) + func ZkpSignOneVerify(msgprex string, encX *big.Int, id int) bool + func ZkpSignTwoVerify(msgprex string, u *big.Int, id int) bool + func ZkpVerify(msgprex string, id int) bool + type AccountListInfo struct + COINTYPE string + DCRMADDRESS string + DCRMPUBKEY string + type AccountListJson struct + ACCOUNTLIST []AccountListInfo + type AddrApiResult struct + Address string + Balance float64 + Final_balance float64 + Final_n_tx int64 + N_tx int64 + Total_received float64 + Tx_url string + Txrefs []Txref + Unconfirmed_balance uint64 + Unconfirmed_n_tx int64 + type AuthoredTx struct + ChangeIndex int + PrevInputValues []btcutil.Amount + PrevScripts [][]byte + TotalInput btcutil.Amount + Tx *wire.MsgTx + type Backend interface + ChainDb func() ethdb.Database + Etherbase func() (eb common.Address, err error) + type BtcTxResInfo struct + Error error + Id int + Result GetTransactionResult + type BtcTxResInfoNoInputs struct + Error error + Id int + Result GetTransactionResultNoInputs + type CheckHashkeySendMsgToDcrm struct + Hashkey string + Tx string + Txhash string + func (self *CheckHashkeySendMsgToDcrm) Run(workid int, ch chan interface{}) bool + type CmtMasterPublicKey struct + func (cmpk *CmtMasterPublicKey) New(g *pbc.Element, q *big.Int, h *pbc.Element, pairing *pbc.Pairing) + type Commitment struct + func (ct *Commitment) New(pubkey *pbc.Element, a *pbc.Element) + type ConfirmAddrSendMsgToDcrm struct + Cointype string + DcrmAddr string + FusionAddr string + Hashkey string + Tx string + Txhash string + func (self *ConfirmAddrSendMsgToDcrm) Run(workid int, ch chan interface{}) bool + type DcrmConfirmAddr struct + Cointype string + DcrmAddr string + FusionAddr string + Hashkey string + Tx string + Txhash string + func (self *DcrmConfirmAddr) Run(workid int, ch chan interface{}) bool + type DcrmData struct + type DcrmLiLoReqAddress struct + Cointype string + Fusionaddr string + Pub string + func (self *DcrmLiLoReqAddress) Run(workid int, ch chan interface{}) bool + type DcrmLockin struct + Hashkey string + LockinAddr string + RealDcrmFrom string + Tx string + func (self *DcrmLockin) Run(workid int, ch chan interface{}) bool + type DcrmLockout struct + Cointype string + DcrmFrom string + FusionFrom string + Lockoutto string + RealDcrmFrom string + RealFusionFrom string + Tx string + Txhash string + Value string + func (self *DcrmLockout) Run(workid int, ch chan interface{}) bool + type DcrmReqAddress struct + Cointype string + Pub string + func (self *DcrmReqAddress) Run(workid int, ch chan interface{}) bool + type DcrmSign struct + Cointype string + DcrmAddr string + Sig string + Txhash string + func (self *DcrmSign) Run(workid int, ch chan interface{}) bool + type DcrmValidateRes struct + DcrmCnt int + DcrmEnodes string + DcrmParms string + Enode string + Tx string + Txhash string + ValidateRes string + Workid string + type ECDSASignature struct + func (this *ECDSASignature) GetR() *big.Int + func (this *ECDSASignature) GetRecoveryParam() int32 + func (this *ECDSASignature) GetS() *big.Int + func (this *ECDSASignature) New() + func (this *ECDSASignature) New2(r *big.Int, s *big.Int) + func (this *ECDSASignature) New3(r *big.Int, s *big.Int, recoveryParam int32) + type Err struct + func (e Err) Error() string + type GetTransactionResult struct + BlockTime int64 + Blockhash string + Confirmations int64 + Hash string + Hex string + Locktime int64 + Size int64 + Time int64 + Txid string + Version int64 + Vin []Vinparm + Vout []Voutparm + Vsize int64 + Weight int64 + type GetTransactionResultNoInputs struct + BlockTime int64 + Blockhash string + Confirmations int64 + Hash string + Hex string + Locktime int64 + Size int64 + Time int64 + Txid string + Version int64 + Vin []VinparmNoInputs + Vout []Voutparm + Vsize int64 + Weight int64 + type LockInSendMsgToDcrm struct + Cointype string + Fusionaddr string + Hashkey string + LockinAddr string + RealDcrmFrom string + Tx string + Txhash string + Value string + func (self *LockInSendMsgToDcrm) Run(workid int, ch chan interface{}) bool + type LockoutSendMsgToDcrm struct + Cointype string + DcrmFrom string + FusionFrom string + Lockoutto string + RealDcrmFrom string + RealFusionFrom string + Tx string + Txhash string + Value string + func (self *LockoutSendMsgToDcrm) Run(workid int, ch chan interface{}) bool + type MTDCommitment struct + func (mtdct *MTDCommitment) New(commitment *Commitment, open *Open) + type NodeInfo struct + IP string + NAME string + RPCPORT string + type NodeJson struct + ARRAY []NodeInfo + type NodeWorkId struct + type Open struct + func (open *Open) New(randomness *pbc.Element, secrets []*big.Int) + type Output struct + Addresses []string + Script string + type PublicParameters struct + func (this *PublicParameters) New(BitCurve *secp256k1.BitCurve, nTilde *big.Int, kPrime int32, h1 *big.Int, ...) + type RPCTransaction struct + BlockHash common.Hash + BlockNumber *hexutil.Big + From common.Address + Gas hexutil.Uint64 + GasPrice *hexutil.Big + Hash common.Hash + Input hexutil.Bytes + Nonce hexutil.Uint64 + R *hexutil.Big + S *hexutil.Big + To *common.Address + TransactionIndex hexutil.Uint + V *hexutil.Big + Value *hexutil.Big + type RecvMsg struct + func (self *RecvMsg) Run(workid int, ch chan interface{}) bool + type ReqAddrSendMsgToDcrm struct + Cointype string + Fusionaddr string + Pub string + func (self *ReqAddrSendMsgToDcrm) Run(workid int, ch chan interface{}) bool + type ReqDispatcher struct + WorkerPool chan chan RpcReq + func NewReqDispatcher(maxWorkers int) *ReqDispatcher + func (d *ReqDispatcher) Run() + type ReqNonDcrmDispatcher struct + WorkerPool chan chan RpcReq + func NewReqNonDcrmDispatcher(maxWorkers int) *ReqNonDcrmDispatcher + func (d *ReqNonDcrmDispatcher) Run() + type RpcDcrmRes struct + type RpcReq struct + type RpcReqNonDcrmWorker struct + RpcReqChannel chan RpcReq + RpcReqWorkerPool chan chan RpcReq + func NewRpcReqNonDcrmWorker(workerPool chan chan RpcReq) RpcReqNonDcrmWorker + func (w RpcReqNonDcrmWorker) Start() + func (w RpcReqNonDcrmWorker) Stop() + type RpcReqWorker struct + RpcReqChannel chan RpcReq + RpcReqWorkerPool chan chan RpcReq + func NewRpcReqWorker(workerPool chan chan RpcReq) RpcReqWorker + func (w RpcReqWorker) Start() + func (w RpcReqWorker) Stop() + type SafeMap struct + KeyMap map[string]string + type ScriptSigParam struct + Asm string + Hex string + type Scriptparm struct + Addresses []string + Asm string + Hex string + ReqSigs int64 + Type string + type SendRawTxRes struct + Err error + Hash common.Hash + type TxApiResult struct + Outputs []Output + TxHash string + type Txref struct + Block_height int64 + Confirmations int64 + Confirmed string + Double_spend bool + Ref_balance float64 + Spent bool + Tx_hash string + Tx_input_n int32 + Tx_output_n int32 + Value float64 + type User struct + func (this *User) GetEncX() *big.Int + func (this *User) GetPk_x() *big.Int + func (this *User) GetPk_y() *big.Int + type UtxoLsRes struct + Unspent_outputs []UtxoRes + type UtxoRes struct + Confirmations int64 + Script string + Tx_hash_big_endian string + Tx_output_n uint32 + Value float64 + type Vinparm struct + ScriptSig ScriptSigParam + Sequence int64 + Txid string + Vout int64 + type VinparmNoInputs struct + Coinbase string + Sequence int64 + type Voutparm struct + N int64 + ScriptPubKey Scriptparm + Value float64 + type Wallet struct + PrivateKey []byte + PublicKey []byte + func NewWallet() *Wallet + func (w Wallet) GetAddress(bitcoin_net int) (address string) + type WorkReq interface + Run func(workid int, ch chan interface{}) bool + type ZkpKG struct + func (this *ZkpKG) New(params *PublicParameters, eta *big.Int, rand *rand.Rand, cx *big.Int, ...) + type ZkpSignOne struct + func (this *ZkpSignOne) New(params *PublicParameters, eta *big.Int, rand *rand.Rand, r *big.Int, ...) + type ZkpSignTwo struct + func (this *ZkpSignTwo) New(params *PublicParameters, eta1 *big.Int, eta2 *big.Int, rand *rand.Rand, ...)