Bitcoin Forum
June 23, 2024, 02:41:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help dumping master private key from wallet. Can offer 0.1 btc for the help  (Read 928 times)
martinblack (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 26, 2016, 10:58:05 PM
 #1

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
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 26, 2016, 11:54:04 PM
Last edit: September 27, 2016, 05:04:26 PM by btchris
 #2

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.
martinblack (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 27, 2016, 01:04:58 AM
 #3

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.
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
September 27, 2016, 05:06:00 PM
 #4

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....
btc2doge
Newbie
*
Offline Offline

Activity: 13
Merit: 0


View Profile WWW
February 22, 2023, 06:33:01 AM
 #5

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/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!