June 25, 2023
MetaMask Wallets
And now, we will show you a very simple script that will help you create an unlimited number of wallets with just one click.
So, first of all, open VS Code and open the "Terminal" tab, then select "New Terminal". Next, in the newly opened window at the bottom, type: → python -m pip install eth-account
from eth_account import Account
import secrets
for i in range (10):
priv = secrets.token_hex(32)
private_key = "0x" + priv
print ("SAVE BUT DO NOT SHARE THIS:", private_key)
acct = Account.from_key(private_key)
print("Address:", acct.address)
with open('out.txt', 'a') as f:
print('PRIVATE:', private_key, file=f)
print('Address:', acct.address, file=f)
Now click on "New Text File" and paste the code that we copied earlier.
Click on "Run" and save the code. You will be prompted to save the file, so go ahead and save it.
So, as a result, we get a text document that contains all our wallets and their corresponding private keys! Very important note: in line 4 of the code, the value in parentheses represents the number of wallets you want to generate!