ethereum/keystore2priv.py: getting geth private key
https://ethereum.stackexchange.com/questions/12830/how-to-get-private-key-from-account-address-and-password Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
dc13f22088
commit
81a4ecac81
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import binascii
|
||||
from web3.auto import w3
|
||||
|
||||
keystore_password = sys.argv[1]
|
||||
keystore_file_path = sys.argv[2]
|
||||
|
||||
with open(keystore_file_path) as keyfile:
|
||||
encrypted_key = keyfile.read()
|
||||
private_key = w3.eth.account.decrypt(encrypted_key, keystore_password)
|
||||
|
||||
print(binascii.b2a_hex(private_key).decode('utf-8'))
|
Loading…
Reference in New Issue