def __init__(self, passphrase="", type=0): self.passphrase = passphrase self.address = None self.public_key = None self.private_key = None try: if type == '1': keypair = BitcoinKeypair.from_private_key( self.passphrase.encode('ascii')) elif type == '2': keypair = BitcoinKeypair.from_private_key( deterministic.electrum_stretch( self.passphrase.encode('utf-8'))) else: keypair = BitcoinKeypair.from_passphrase( self.passphrase.encode('utf-8')) self.address = keypair.address() self.public_key = keypair.public_key() self.private_key = keypair.private_key() self.wif = keypair.wif_pk() except Exception as e: logging.warning( u"Failed to generate keypair for passphrase '{}'. Error: {}". format(passphrase, e.args)) raise
def __init__(self, passphrase): self.passphrase = passphrase self.address = None self.public_key = None self.private_key = None try: keypair = BitcoinKeypair.from_passphrase(self.passphrase) self.address = keypair.address() self.public_key = keypair.public_key() self.private_key = keypair.private_key() except Exception as e: logging.warning("Failed to generate keypair for passphrase '{}'. Error: {}".format(passphrase, e.args))
def __init__(self, passphrase, private_key=False): self.passphrase = passphrase if private_key: self.keypair = BitcoinKeypair.from_private_key( self.passphrase.encode('ascii')) else: try: self.keypair = BitcoinKeypair.from_passphrase(self.passphrase) except Exception: LOG.exception(u'Failed to generate keypair from {0}'.format( self.passphrase)) raise
def __init__(self, passphrase): self.passphrase = passphrase self.address = None self.public_key = None self.private_key = None try: keypair = BitcoinKeypair.from_passphrase(self.passphrase) self.address = keypair.address() self.public_key = keypair.public_key() self.private_key = keypair.private_key() except Exception as e: logging.warning( u"Failed to generate keypair for passphrase '{}'. Error: {}". format(passphrase, e.args)) raise
def __init__(self, passphrase = "", type = 0): self.passphrase = passphrase self.address = None self.public_key = None self.private_key = None try: if type == '1': keypair = BitcoinKeypair.from_private_key(self.passphrase.encode('ascii')) elif type == '2': keypair = BitcoinKeypair.from_private_key(deterministic.electrum_stretch(self.passphrase.encode('utf-8'))) else: keypair = BitcoinKeypair.from_passphrase(self.passphrase.encode('utf-8')) self.address = keypair.address() self.public_key = keypair.public_key() self.private_key = keypair.private_key() self.wif = keypair.wif_pk() except Exception as e: logging.warning(u"Failed to generate keypair for passphrase '{}'. Error: {}".format(passphrase, e.args)) raise
def findVanityInDic(fileName, prefix, maxTries = 0, length = 3, ignoreCase = False): if maxTries == 0: maxTries = 60**len(prefix) dictionary_encoding = "utf-8" info("Opening dictionary file {} and validating encoding is {}".format(fileName, dictionary_encoding)) try: f_dictionary = io.open(fileName, 'rt', encoding=dictionary_encoding) words = f_dictionary.readlines() f_dictionary.close() except Exception as e: error("Failed to open dictionary file {}. Make sure file is {} encoded.".format( fileName, dictionary_encoding)) exit(1) info("finished reading file {}, starting bruteforce...".format(fileName)) for i in range(maxTries): guess = ''.join(sample(words, length)).replace('\n', ' ') if isVanity(guess, prefix, ignoreCase): return guess, BitcoinKeypair.from_passphrase(guess).address() return None
def findVanityInDic(fileName, prefix, maxTries=0, length=3, ignoreCase=False): if maxTries == 0: maxTries = 60**len(prefix) dictionary_encoding = "utf-8" info("Opening dictionary file {} and validating encoding is {}".format( fileName, dictionary_encoding)) try: f_dictionary = io.open(fileName, 'rt', encoding=dictionary_encoding) words = f_dictionary.readlines() f_dictionary.close() except Exception as e: error( "Failed to open dictionary file {}. Make sure file is {} encoded.". format(fileName, dictionary_encoding)) exit(1) info("finished reading file {}, starting bruteforce...".format(fileName)) for i in range(maxTries): guess = ''.join(sample(words, length)).replace('\n', ' ') if isVanity(guess, prefix, ignoreCase): return guess, BitcoinKeypair.from_passphrase(guess).address() return None
def isVanity(seed, prefix, ignoreCase=False): key = BitcoinKeypair.from_passphrase(seed) if ignoreCase: return key.address().lower().startswith(prefix) else: return key.address().startswith(prefix)
def isVanity(seed, prefix, ignoreCase = False): key = BitcoinKeypair.from_passphrase(seed) if ignoreCase: return key.address().lower().startswith(prefix) else: return key.address().startswith(prefix)