Ethereum Asked by Webeng on December 12, 2020
Question:
How do I use Mist to extract the Raw private key of an account. The account is password protected (if that makes a difference I don’t know).
Elaborating:
What I want however is the RAW private key. I understand I don’t need it since I have the JSON file, though I still want to at least know how to get it if I do want it.
Ideally there would be some easy UI option in Mist, though I recognize that there might be a geth command as well. All help is really appreciated.
just a few hours ago i tried to find an easy solution. the python way is not extremely easy but easy enough.
you can use web3.py
http://web3py.readthedocs.io/en/stable/web3.eth.account.html#extract-private-key-from-geth-keyfile
from web3.auto import w3
with open('~/.ethereum/keystore/UTC--...--5ce9454909639D2D17A3F753ce7d93fa0b9aB12E') as keyfile:
encrypted_key = keyfile.read()
private_key = w3.eth.account.decrypt(encrypted_key, 'correcthorsebatterystaple')
# tip: do not save the key or password anywhere, especially into a shared source file
in mist go to file->backup->accounts
to copy paste the location of the keyfile
note for windows:
installing web3.py on windows can be a bit tricky i suggest using precompiled whls for lru_cache and cytoolz
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Answered by swisswiss on December 12, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP