Skip to content

Instantly share code, notes, and snippets.

@asluchevskiy
Created July 3, 2023 00:35
Show Gist options
  • Save asluchevskiy/720ce4e8139c986fb2e7f416ba0ce9a3 to your computer and use it in GitHub Desktop.
Save asluchevskiy/720ce4e8139c986fb2e7f416ba0ce9a3 to your computer and use it in GitHub Desktop.
Ethereum private keys generator using python
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