def generate(self):
     pw.setOffline()
     addr = pw.Address()
     address = addr.address.decode("utf-8")
     private_key = addr.privateKey.decode("utf-8")
     seed = addr.seed
     return CryptoCoin(address, private_key, seed)
Example #2
0
 def generate(self):
     seed = wallet.generate_mnemonic()
     w = wallet.create_wallet(network="omni", seed=seed, children=1)
     wif = w.get('wif').decode("utf-8")
     address = w.get('address')
     seed = w.get('seed')
     return CryptoCoin(address, wif, seed)
 def get_default_coin(private_key):
     decoded_wif = WifDecoder.Decode(
         wif_str=private_key,
         net_addr_ver=BitcoinCashConf.WIF_NET_VER.Main())
     key_pair = Bip44.FromAddressPrivKey(decoded_wif,
                                         Bip44Coins.BITCOIN_CASH)
     address = key_pair.PublicKey().ToAddress().replace('bitcoincash:', '')
     return CryptoCoin(address, private_key)
Example #4
0
 def generate(self):
     keccak = sha3.keccak_256()
     priv = SigningKey.generate(curve=SECP256k1)
     pub = priv.get_verifying_key().to_string()
     keccak.update(pub)
     address = keccak.hexdigest()[24:]
     priv_hex = str(codecs.encode(priv.to_string(), 'hex'))[2:-1]
     return CryptoCoin("0x{}".format(address), priv_hex)
 def get_default_coin(private_key):
     decoded_wif = WifDecoder.Decode(wif_str=private_key,
                                     net_addr_ver=CLUB_WIF_NET_VER.Main())
     bip44_mst = Bip44.FromAddressPrivKey(decoded_wif, Bip44Coins.BITCOIN)
     pub_key_bytes = bip44_mst.PublicKey().RawCompressed().ToBytes()
     address = Base58Encoder.CheckEncode(CLUB_P2PKH_NET_VER.Main() +
                                         CryptoUtils.Hash160(pub_key_bytes))
     return CryptoCoin(address, private_key)
    def get_coin(self, private_key):
        s = Seed(phrase_or_hex=private_key)

        seed = s.phrase
        addr = str(s.public_address())
        sk = s.secret_spend_key()

        return CryptoCoin(addr, sk, seed)
    def generate(self):
        s = Seed()

        seed = s.phrase
        addr = str(s.public_address())
        sk = s.secret_spend_key()

        return CryptoCoin(addr, seed, seed)
Example #8
0
 def get_coin(self, private_key):
     keccak = sha3.keccak_256()
     decoded_private_key = codecs.decode(private_key, 'hex')
     priv = SigningKey.from_string(decoded_private_key, curve=SECP256k1)
     pub = priv.get_verifying_key().to_string()
     keccak.update(pub)
     address = keccak.hexdigest()[24:]
     priv_hex = codecs.encode(priv.to_string(), 'hex')
     return CryptoCoin("0x{}".format(address), priv_hex)
 def get_uncompressed_coin(private_key):
     print("Warning Uncompressed key")
     decoded_wif = WifDecoder.Decode(wif_str=private_key,
                                     net_addr_ver=CLUB_WIF_NET_VER.Main())
     bip44_mst = Bip44.FromAddressPrivKey(decoded_wif, Bip44Coins.BITCOIN)
     to_hex = bip44_mst.PublicKey().RawUncompressed().ToBytes()
     pub_key_bytes = b'\x04' + to_hex
     address = Base58Encoder.CheckEncode(CLUB_P2PKH_NET_VER.Main() +
                                         CryptoUtils.Hash160(pub_key_bytes))
     return CryptoCoin(address, private_key)
 def get_uncompressed_coin(private_key):
     print("Warning Uncompressed key")
     config_alias = DashConf
     coin_type = Bip44Coins.DASH
     decoded_wif = WifDecoder.Decode(
         wif_str=private_key, net_addr_ver=config_alias.WIF_NET_VER.Main())
     bip44_mst = Bip44.FromAddressPrivKey(decoded_wif, coin_type)
     to_hex = bip44_mst.PublicKey().RawUncompressed().ToBytes()
     pub_key_bytes = b'\x04' + to_hex
     address = Base58Encoder.CheckEncode(config_alias.P2PKH_NET_VER.Main() +
                                         CryptoUtils.Hash160(pub_key_bytes))
     return CryptoCoin(address, private_key)
 def get_uncompressed_coin(private_key):
     print("Warning Uncompressed key")
     config_alias = BitcoinConf
     coin_type = Bip44Coins.BITCOIN
     decodedWif = WifDecoder.Decode(
         wif_str=private_key, net_addr_ver=config_alias.WIF_NET_VER.Main())
     bip44_mst = Bip44.FromAddressPrivKey(decodedWif, coin_type)
     to_hex = bip44_mst.PublicKey().RawUncompressed().ToBytes()
     pub_key_bytes = b'\x04' + to_hex
     legacy_address = Base58Encoder.CheckEncode(
         config_alias.P2PKH_NET_VER.Main() +
         CryptoUtils.Hash160(pub_key_bytes))
     address = convert.to_cash_address(legacy_address).replace(
         'bitcoincash:', '')
     return CryptoCoin(address, private_key)
    def generate(self):
        # Generate random mnemonic
        mnemonic = Bip39MnemonicGenerator.FromWordsNumber(12)

        # Generate seed from mnemonic
        seed_bytes = Bip39SeedGenerator(mnemonic).Generate()

        # Generate BIP44 master keys
        bip_obj_mst = Bip44.FromSeed(seed_bytes, Bip44Coins.DASH)

        address = bip_obj_mst.PublicKey().ToAddress()
        wif = bip_obj_mst.PrivateKey().ToWif()
        seed = mnemonic

        return CryptoCoin(address, wif, seed)
Example #13
0
 async def load_address_from_private_async(self, private_key):
     address, asset_id, error = await self.context.run_in_thread(
         lambda: self.load_address_and_id(private_key))
     if error is None:
         print('address, asset_id, private_key')
         print(address, asset_id, private_key)
         if address is not None and asset_id is not None:
             self.context.set_fetched_address(address)
             self.context.set_fetched_snip(asset_id)
             self.context.show_coin_info()
             self.context.coins_add(
                 CryptoCoin(address=address, wif=private_key), asset_id)
             await self.context.sleep(500)
             self.change_state(States.APPLY_COIN_STATE)
     else:
         self.context.set_fetched_address('error')
         self.context.set_fetched_snip('error')
         self.context.show_error()
         self.change_state(States.SCAN_COIN_ERROR_STATE)
Example #14
0
    def generate(self):
        # Generate random mnemonic
        mnemonic = Bip39MnemonicGenerator.FromWordsNumber(12)

        # Generate seed from mnemonic
        seed_bytes = Bip39SeedGenerator(mnemonic).Generate()

        # Generate BIP44 master keys
        bip_obj_mst = Bip44.FromSeed(seed_bytes, Bip44Coins.BITCOIN)

        wif = WifEncoder.Encode(bip_obj_mst.PrivateKey().Raw().ToBytes(), True,
                                POTE_WIF_NET_VER.Main())

        pub_key_bytes = bip_obj_mst.PublicKey().RawCompressed().ToBytes()
        address = Base58Encoder.CheckEncode(POTE_P2PKH_NET_VER.Main() +
                                            CryptoUtils.Hash160(pub_key_bytes))

        seed = mnemonic

        return CryptoCoin(address, wif, seed)
 def get_coin(self, private_key):
     wif = private_key
     seed = private_key
     address = get_cwid_from_mnemonic(seed)
     return CryptoCoin(address, wif, seed)
 def generate(self):
     seed = Mnemonic('english').generate()
     wif = seed
     address = get_cwid_from_mnemonic(seed)
     return CryptoCoin(address, wif, seed)
Example #17
0
 def generate(self):
     eos = EosKey()
     address = eos.to_public()
     wif = eos.to_wif()
     seed = ''
     return CryptoCoin(address, wif, seed)
Example #18
0
 def get_coin(self, private_key):
     eos = EosKey(private_key=private_key)
     address = eos.to_public()
     wif = eos.to_wif()
     seed = ''
     return CryptoCoin(address, wif, seed)
Example #19
0
 def get_coin(self, private_key):
     key_pair = Bip44.FromAddressPrivKey(bytes.fromhex(private_key), Bip44Coins.BINANCE_CHAIN)
     address = key_pair.PublicKey().ToAddress()
     return CryptoCoin(address, private_key)
Example #20
0
 def get_coin(self, private_key):
     key = bitsv.Key(wif=private_key)
     wif = key.to_wif()
     address = key.address
     return CryptoCoin(address, wif)
Example #21
0
 def generate(self):
     key = bitsv.Key()
     wif = key.to_wif()
     address = key.address
     return CryptoCoin(address, wif)
 def get_default_coin(private_key):
     decoded_wif = WifDecoder.Decode(
         wif_str=private_key, net_addr_ver=DashConf.WIF_NET_VER.Main())
     key_pair = Bip44.FromAddressPrivKey(decoded_wif, Bip44Coins.DASH)
     address = key_pair.PublicKey().ToAddress()
     return CryptoCoin(address, private_key)
Example #23
0
 def get_coin(self, private_key):
     wif = private_key
     key = PrivateKey.from_wif(wif=private_key,
                               network=Wallet.get_network('OMNI'))
     address = key.get_public_key().to_address()
     return CryptoCoin(address, wif, '')