0

I am far from programming, I found this convenient script, it just has an input - a text file with a HEX list in a column and the output of the result - a text file with a WIF list in a stack. I would like to get another output - a text file with the Base58check list in a column. I have this Hex to wif converter python script

import binascii, hashlib, base58, sys

arq = open('list-WIF.txt', 'w')

def convert(z):

private_key_static = z

extended_key = "80"+private_key_static+"01"

first_sha256 = hashlib.sha256(binascii.unhexlify(extended_key)).hexdigest()

second_sha256 = hashlib.sha256(binascii.unhexlify(first_sha256)).hexdigest()

final_key = extended_key+second_sha256[:8]

WIF = base58.b58encode(binascii.unhexlify(final_key)).decode ('ascii')

print ("Private Key on WIF Compressed format below")
print (WIF)
arq.write("%s \n" % WIF)

with open("brute-pvks.txt") as file: for line in file: print (str.strip(line)) convert(str.strip(line))

How to modify this for convert Hex to Base58check?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.