arbsep; conf/
This commit is contained in:
17
bin/generate_private_key.py
Normal file
17
bin/generate_private_key.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
from eth_keys import keys
|
||||
|
||||
# Generating a private key
|
||||
private_key_hex = os.urandom(32)
|
||||
private_key = keys.PrivateKey(private_key_hex)
|
||||
|
||||
# Getting the public key
|
||||
public_key = private_key.public_key
|
||||
|
||||
# compute the Ethereum address from the public key
|
||||
address = public_key.to_checksum_address()
|
||||
|
||||
print(f"key='{hex(private_key)[2:]}' # {address}")
|
||||
# print("Private key:", private_key)
|
||||
# print("Public key:", public_key)
|
||||
# print("Address:", address)
|
||||
Reference in New Issue
Block a user