0% found this document useful (0 votes)
10 views1 page

A

Uploaded by

arthinformatics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

A

Uploaded by

arthinformatics
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import os

import random
import hashlib
import binascii

def generate_private_key():
return ''.join(random.choices('0123456789abcdef', k=64))

def private_key_to_public_key(private_key):
# Use the secp256k1 curve
private_key_bytes = binascii.unhexlify(private_key)
public_key = hashlib.sha256(private_key_bytes).hexdigest()
return public_key

def public_key_to_address(public_key):
# Convert to uncompressed address
address = '1' + public_key[:40] # Simplified for demonstration
return address

def write_address_to_file(address):
with open('Add.txt', 'a') as f:
f.write(address + '\n')

for _ in range(1, 1001):


private_key = generate_private_key()
public_key = private_key_to_public_key(private_key)
address = public_key_to_address(public_key)
write_address_to_file(address)

You might also like