Created
July 3, 2023 00:35
-
-
Save asluchevskiy/720ce4e8139c986fb2e7f416ba0ce9a3 to your computer and use it in GitHub Desktop.
Ethereum private keys generator using python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from eth_account import Account | |
import sys | |
import secrets | |
def get_private_key(): | |
return "0x" + secrets.token_hex(32) | |
if __name__ == '__main__': | |
try: | |
count = int(sys.argv[1]) | |
except Exception: | |
count = 1 | |
for i in range(count): | |
private_key = get_private_key() | |
account = Account.from_key(private_key) | |
print(f'{private_key},{account.address}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment