4

I mistakenly sent a small amount of ETH from an online exchange to my local wallet address on Ropsten testnet. Obviously main net to test net will not work. Thus my ETHs are lost.

I think of a way of recovering my ETHs. I use Parity as my wallet software. Since Parity generated the test net address in the beginning, if I can generate the same address on the main net, I can get my ETHs back.

To generate an address, there should be an algorithm and a private key. Since Parity generated the test net address, the private key is probably stored somewhere in my machine. I guess the private key is probably some sort of encoding of my password.

If I look through the source code, I should be able to find what is the algorithm and where is the private key (or how my password should be encoded)

Is this thinking right? If there are mistakes in my thinking, I might not as well go for it. It might cost a lot of time.

2

Since Parity generated the test net address, the private key is probably stored somewhere in my machine.

Yes, you can find them in:

  • On Windows: C:\Users\You\AppData\Roaming\Parity\Ethereum\

  • On MacOS: /Users/you/Library/Application Support/io.parity.ethereum/keys

  • On Linux: /home/you/.local/share/io.parity.ethereum/keys

Check for a subdirectory called keys/test or keys/ropsten depending on which version of Parity you are using.

Copy these UTC--* files to keys/ethereum or import them via the Parity Wallet UI. (Accounts > Create > Import).

  • Very great! I did exactly this and got the ETHs back – Bigman Mar 15 '17 at 19:05
  • I am glad the author found a solution to his problem, but I come from Google, I’d like to know if I “Can I generate an identical address on main net as in test net?” (this question’s current title), and this answer doesn’t answer this. Whyyyy! – Diti Oct 14 '17 at 12:44
  • @Diti yes you can :) – Afr Oct 16 '17 at 12:12
  • @5chdn Does that mean there's no different way of creating Livenet address and Testnet, say Ropsten address, in Ethereum? You know in Bitcoin they do differ on Address Version. (0x00 for livenet, 0x6f for testnet) – Lee Han Kyeol Jan 3 '18 at 6:48
  • 1
    There are no different addresses, indeed. @LeeHanKyeol – Afr Jan 16 '18 at 8:57
3

Did you create your Parity testnet address with a normal account management command? If so it should be stored in your parity directories, and you should simply be able to copy the key over from the testnet keys directory to the mainnet keys directory. My Parity keys live under ~/.local/share/io.parity.ethereum/keys/. (I haven't tried this with Parity, but I've confirmed it works with Geth, and the keys seem to be of the same format.)

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.