Decode ethereum's account keystore file by Python

in python3 •  7 years ago  (edited)

Step 1:
pip install web3 //my web3 version is 3.16.5
pip install ethereum

Step 2:
import ethereum.tools.keys as keys

       with open(keystorepath) as file_object:
               contents = file_object.read()
       privatekey = keys.decode_keystore_json(json.loads(contents),accountpassword)

Now you can sendRawTransaction with privatekey

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!