Arkadaşlar şöyle bir kod oluşturduk
import bitcoin
dosya1 = open('C:/denemeliste.txt', "r")
dosya2 = open('C:/sonuclar.txt', "w")
valid_private_key = False
while not valid_private_key:
while True:
line = dosya1.readline()
if not line:
break
Kod = line.strip()
private_key = (Kod)
decoded_private_key = bitcoin.decode_privkey(private_key, 'hex')
valid_private_key = 0 < decoded_private_key < bitcoin.N
print("Hex: {}".format(private_key), file=dosya2, flush=True)
#print("Private key in decimal is {}".format(decoded_private_key), file=dosya2, flush=True)
wif_encoded_private_key = bitcoin.encode_privkey(decoded_private_key, 'wif')
#print("Private key in WIF is {}".format(wif_encoded_private_key), file=dosya2, flush=True)
compressed_private_key = private_key + '01'
#print("Private key compressed in hexadecimal {}".format(compressed_private_key), file=dosya2, flush=True)
wif_compressed_private_key = bitcoin.encode_privkey(bitcoin.decode_privkey(compressed_private_key, 'hex'), 'wif')
#print("Private key WIF compressed is {}".format(wif_compressed_private_key), file=dosya2, flush=True)
public_key = bitcoin.fast_multiply(bitcoin.G, decoded_private_key)
#print("Public key (x,y) coordinates is".format(public_key), file=dosya2, flush=True)
hex_encoded_public_key = bitcoin.encode_pubkey(public_key, 'hex')
#print("Hex encoded public key is {}".format(hex_encoded_public_key), file=dosya2, flush=True)
(public_key_x, public_key_y) = public_key
if (public_key_y % 2) == 0:
compressed_prefix = '02'
else:
compressed_prefix = '03'
hex_compressed_public_key = compressed_prefix + bitcoin.encode(public_key_x, 16)
#print("Compressed Public Key (hex) is {}".format(hex_compressed_public_key), file=dosya2, flush=True)
print("{}".format(bitcoin.pubkey_to_address(public_key)), file=dosya2, flush=True)
print("{}".format(bitcoin.pubkey_to_address(hex_compressed_public_key)), file=dosya2, flush=True)
Bu kodumuz deneme listesindeki hex kodlarımız 20 satır ise problemsiz çalışıyor
ama 20 den fazla ise hata veriyor
ama en sondaki print komutunu iptal edersek satır sayısı ne olursa olsun hata vermeden çalışmaya devam eder
deneme liste:
9831101116020117
9831101110120118
9831101116020119
983110111602011A
983110111610011B
983110111610011C
983110111610011D
983110111610011E
983110111610011F
9831101116100160
9831101116100161
9831101117100117
9831101117100118
9831101117100119
983110111710011A
983110111710011B
983110111710011C
983110111710011D
983110111710011E
983110111702011F
9831101117020160
9831101117020161
983110111A020117
983110111A020118
983110111A020119
983110111A02011A
983110111A02011B
983110111A02011C
983110111A02011D
983110111A10011E
983110111A10011F
983110111A100160
983110111A100161
983110111C100117
983110111C100118
983110111C100119
983110111C10011A
983110111C10011B
983110111C10011C
983110111C10011D