Created
March 3, 2021 12:10
-
-
Save brunneis/080656101593d11c6a3aa1401aceb445 to your computer and use it in GitHub Desktop.
Generate an Ethereum account with Python
This file contains 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 easyweb3 import EasyWeb3 | |
import json | |
def generate_private_key(password: str) -> dict: | |
private_key = EasyWeb3().web3.eth.account.create() | |
private_key_dict = private_key.encrypt(password) | |
with open(f'./{private_key.address}.json', 'w') as output_file: | |
json.dump(private_key_dict, output_file) | |
password = '1234' | |
generate_private_key(password) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment