Encrypted wallet corrupted, 5000 NMC reward for recovery!

Post Reply
myfault
Posts: 4
Joined: Sun Oct 09, 2016 6:07 pm
os: linux

Encrypted wallet corrupted, 5000 NMC reward for recovery!

Post by myfault »

Hi guys,
i'm trying to recover some of the private keys contained in a corrupted NMC encrypted wallet.
I know the passphrase.
I've already tried with this tool https://github.com/jackjack-jj/pywallet
and the following command:
sudo python ./pywallet.py --recover --namecoin --recov_device /path/to/corrupted_wallet.dat --recov_size 1Mo --recov_outputdir /home/username/Desktop/recovery
No success! :(
I've also tried to open and read the wallet with an hex editor to see if i could somehow understand its structure and isolate some private keys but i couldn't really understand anything of that.
Do i have any chance to get some of my NMC back?
Where can i find informations about how NMC encrypted wallet are built?
I'm willing to reward with 5000 NMC if someone helps me to recover the private key i need.
Thanks
Last edited by myfault on Tue Oct 11, 2016 5:59 am, edited 1 time in total.

cassini
Posts: 336
Joined: Sun May 26, 2013 6:36 pm

Re: NMC encrypted wallet corrupted!

Post by cassini »

As far as I know the wallet encryption is identical to the one in the Bitcoin client. Try https://en.bitcoin.it/wiki/Wallet_encryption

By the way, what error message do you get when you open the wallet using the Namecoin client? Any clues in the debug.log file? Which client version?

Have you already tried Namecoin Core's start param -salvagewallet ?

myfault
Posts: 4
Joined: Sun Oct 09, 2016 6:07 pm
os: linux

Re: NMC encrypted wallet corrupted!

Post by myfault »

A fatal error occurred Namecoin can no longer continue safely and will quit.
EXCEPTION: 22DbRunRecoveryException
Db::exists: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
namecoin in Runaway exception

Wallet version is 0.3.80

I recovered the .dat file from a bad hard disk failure and as i said i tried to open the wallet.dat with an Hex editor, i see only 6 ckey are present and NO mkey, the file looks badly corrupted but only one private key contains namecoin so maybe i can recover that one only.

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by phelix »

I was once able to recover keys with https://github.com/gavinandresen/bitcointools

try fixwallet and/or dbdump
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

myfault
Posts: 4
Joined: Sun Oct 09, 2016 6:07 pm
os: linux

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by myfault »

That is from 5 years ago and for bitcoin, i don't really know how it can help me or how to use those tools to recover some private keys from a badly corrupted and encrypted namecoin wallet.

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by biolizard89 »

myfault wrote:Hi guys,
i'm trying to recover some of the private keys contained in a corrupted NMC encrypted wallet.
I know the passphrase.
I've already tried with this tool https://github.com/jackjack-jj/pywallet
and the following command:
sudo python ./pywallet.py --recover --namecoin --recov_device /path/to/corrupted_wallet.dat --recov_size 1Mo --recov_outputdir /home/username/Desktop/recovery
No success! :(
I've also tried to open and read the wallet with an hex editor to see if i could somehow understand its structure and isolate some private keys but i couldn't really understand anything of that.
Do i have any chance to get some of my NMC back?
Where can i find informations about how NMC encrypted wallet are built?
I'm willing to reward with 5000 NMC if someone helps me to recover the private key i need.
Thanks
Hi.

Sorry for the delayed reply. Try the following procedure:
  1. Make a backup of your Namecoin profile folder (wallet, blockchain, everything) in case anything goes wrong here. Yes, there is a possibility that this will make it worse, in which case you don't want to be without your backup.
  2. Download a recent build of Namecoin Core, or build it yourself from source. The most recent beta that has binaries available is probably nc0.13.99-name-tab-beta1, which has binaries posted at https://github.com/JeremyRand/namecoin. ... -gui-pr-67 . Note that those binaries haven't yet been reproduced by multiple developers, so whether you should use those binaries right now depends on (a) whether you trust me, (b) how inconvenient it would be for you to build from source, and (c) how urgent it is that you recover your wallet immediately.
  3. Run the following (using the Namecoin Core build): ./namecoin-qt -salvagewallet
  4. Namecoin Core will probably exit itself after running the wallet recovery. If it doesn't exit itself, exit it.
  5. Run the following (using the Namecoin Core build): ./namecoin-qt
  6. Most likely, your wallet will appear empty. That's okay. Exit Namecoin Core.
  7. Run the following (using the Namecoin Core build): ./namecoin-qt -rescan
  8. With luck, after this, your wallet will be recovered. It's probably a good idea to not use the recovered wallet with Namecoin 0.3.80 anymore; staying with Namecoin Core is probably safest unless you absolutely need a feature from 0.3.80.
Let me know how it goes.

Best,
-Jeremy
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

phelix
Posts: 1634
Joined: Thu Aug 18, 2011 6:59 am

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by phelix »

myfault wrote:That is from 5 years ago
exactly. this is ancient tech in v0.3.80, it comes from Bitcoin v0.3.xx and had encryption added later on.

Did you try the berkeley db database recovery? Maybe you could retry to get better/more data out of the disk, at least I would store a complete image of the disk just in case NMC gets valuable again.

Somehow I can't find your thread about this over on bitcointalk any more.... ?
thread on bitcointalk: https://bitcointalk.org/index.php?topic=1646255.20

For the record I once managed to recover a badly corrupted Namecoin wallet from v0.3.80. If you still care send me the wallet and I will give it a try (keys are still encrypted).
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

myfault
Posts: 4
Joined: Sun Oct 09, 2016 6:07 pm
os: linux

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by myfault »

Hi phelix,
thanks for your interest but i don't think there's anything we can do to recover some of the private keys.
The user jackjack had a look at the encrypted wallet, he scanned it with an hex editor and didn't find any trace of the "mkey" which is absolutely necessary to decrypt the wallet.
If you still want to try i can send you the corrupted wallet via email.

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: Encrypted wallet corrupted, 5000 NMC reward for recovery

Post by biolizard89 »

@myfault did you try the instructions I posted? How well they'll work depends on how badly the wallet is corrupted, but they've worked before when I was helping someone with a corrupted wallet.

Cheers.
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

Post Reply