Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
words.append(wordList[w1])
words.append(wordList[w2])
words.append(wordList[w3])
self.seed = ' '.join(words)
if publicKey:
pubKey = base58.b58decode(publicKey)
privKey = ""
else:
seedHash = crypto.hashChain(struct.pack(">L", nonce) + crypto.str2bytes(self.seed))
accountSeedHash = crypto.sha256(seedHash)
if not privateKey:
privKey = curve.generatePrivateKey(accountSeedHash)
else:
privKey = base58.b58decode(privateKey)
pubKey = curve.generatePublicKey(privKey)
unhashedAddress = chr(1) + str(pywaves.CHAIN_ID) + crypto.hashChain(pubKey)[0:20]
addressHash = crypto.hashChain(crypto.str2bytes(unhashedAddress))[0:4]
self.address = base58.b58encode(crypto.str2bytes(unhashedAddress + addressHash))
self.publicKey = base58.b58encode(pubKey)
if privKey != "":
self.privateKey = base58.b58encode(privKey)