Author

Topic: Need help dumping master private key from wallet. Can offer 0.1 btc for the help (Read 952 times)

newbie
Activity: 13
Merit: 0
So, title! Need help manipulating BitcoinJ's wallet object in order to dump the master private key of a MultibitHD Wallet. 0.1 BTC.

I have the wallet file and password. I would like to be able to get the BIP32 extended private key (xprv) from it.
Additionally, be able to derive it from the wallet seed. I can't figure out the derivation path.

This is as far as I've gotten:

What I do is restore a wallet and then try to get the private key from the Wallet object:

    NetworkParameters PARAMS = MainNetParams.get();
    DeterministicKeyChain kc = wallet.getActiveKeychain();
    DeterministicKey rk = kc.getRootKey();
    String key = rk.getPrivateKeyAsWiF(PARAMS);


I'm getting an exception saying java.lang.IllegalStateException: Private key bytes not available

there is very high chance you used the beta multibit HD wallet if you used it before 2016. it used the incompatible bugged key derivation method. so it cant be dump directly.
there is more details: https://btc2doge.com/multibit-hd-wallet-seed-words-not-work/
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
You sure that's the path?

My bad, the tool I linked to appends the last element on its own, so you should enter a path of just m/0'/0.

Also, is there any chance you created the wallet with a beta version prior to the 0.1 public release? Versions earlier than 0.0.8-beta had a bug that would affect you....
newbie
Activity: 12
Merit: 0
Do you have the seed?

If so, you can use https://dcpos.github.io/bip39/ to generate your extended master private key (your "xprv") from your seed. (Follow the directions to use that tool offline before actually using it, though).

To verify, that tool can also generate your addresses. Select the BIP32 tab, and use a derivation path of m/0'/0/0 for your first address, m/0/0/1 for your second, etc.

If you don't have your seed, you can extract it from your wallet file (assuming you have the password of course) with this: https://github.com/gurnec/decrypt_bitcoinj_seed.

Hello Chris, thanks for the reply.
I tried with that tool, another found here: https://github.com/bip32JP/bip32JP.github.io and deriving manually using NBitcoin, a library for C#, but I can't find an address I know is part of that seed (I can see it in Multibit HD).

I'm trying with the paths "m/0'/0/N" (receiving addresses) and "m/0'/1/N" (for change).

Derived N=100 and haven't found it.
You sure that's the path?
Thanks again.
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
Do you have the seed?

If so, you can use https://dcpos.github.io/bip39/ to generate your extended master private key (your "xprv") from your seed. (Follow the directions to use that tool offline before actually using it, though).

To verify, that tool can also generate your addresses. Select the BIP32 tab, and use a derivation path of m/0'/0/0 for your first address, m/0'/0/1 for your second, etc.

If you don't have your seed, you can extract it from your wallet file (assuming you have the password of course) with this: https://github.com/gurnec/decrypt_bitcoinj_seed.
newbie
Activity: 12
Merit: 0
So, title! Need help manipulating BitcoinJ's wallet object in order to dump the master private key of a MultibitHD Wallet. 0.1 BTC.

I have the wallet file and password. I would like to be able to get the BIP32 extended private key (xprv) from it.
Additionally, be able to derive it from the wallet seed. I can't figure out the derivation path.

This is as far as I've gotten:

What I do is restore a wallet and then try to get the private key from the Wallet object:

    NetworkParameters PARAMS = MainNetParams.get();
    DeterministicKeyChain kc = wallet.getActiveKeychain();
    DeterministicKey rk = kc.getRootKey();
    String key = rk.getPrivateKeyAsWiF(PARAMS);


I'm getting an exception saying java.lang.IllegalStateException: Private key bytes not available
Jump to: