TransWikia.com

Mist: how to view private key of an account

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:

  • I made an account with mist that has a a password associated to it
  • I already backed up the JSON file which can be used to import the account into another mist wallet

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.

One Answer

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

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP