1

I have 17k ethereum addresses. I want to change passphrase all of them. Are there any way to change all addresses passphrase?

geth account update 0x... It is really hard to change 17k addresses password. I need suggestion.

1

You could make a python script that take all the files in a folder,

def find_keystores():
        onlyfiles = [f for f in listdir(keystorepath) if isfile(join(keystorepath, f))]
        counter = 0
        accounts = []
        for file in onlyfiles:
            accounts.append(onlyfiles[counter])
            counter = counter + 1
        return accounts

then iterate through them and decrypt it with the current passphrase using web3py

onlyfiles = [f for f in listdir(keystorepath) if isfile(join(keystorepath, f))]
with open(keystorepath + "/" +onlyfiles[0]) as keyfile:
        encrypted_key = keyfile.read()
        private_key = w3.eth.account.decrypt(encrypted_key, passphrase)

After you have extracted the private key, you recreate the keystore

keystore = w3.eth.account.encrypt(private_key, new_passphrase)

This is valid also in other languages (nodejs, rust), the concept is the same. Just know that the decryption and the encryption of keystore files consume a lot of cpu resources.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.