1

I've just found an old HD with a multibit wallet with a little bit of content and I want to open it in bitcoin core since multibit is deprecated nowadays. I have the private key for the wallet, how to do this in bitcoin core? being the gui interface or the command line interface? Thanks in advance.

EDIT

I keep getting the error key 'XXXXXXXXXX' is not valid (code -5) when running getdescriptorinfo, I think it is as mentioned in my commets below, maybe the encoding used in multibit legacy is different from bitcoin's... Btw, I'm using the key in multibit.key which contains a string of 237 characters and when outputted to cat multibit.key | base64 has 329 characters. Is it really the private key?

Also, my question is not duplicate as mentioned in the comments below...

3
  • 1
    Does this answer your question? How do I import a private key into Bitcoin-Core? Aug 29, 2021 at 18:18
  • no because the encoding used to store the multibit key seems to be different, I've tried simply outputting it to base64 too to import to core but didnt worked also... any idea?
    – Fnr
    Aug 29, 2021 at 22:48
  • 1
    I vote to leave this question open as importing a private key is a legacy and footguny way of recovering a wallet on Bitcoin Core. Aug 30, 2021 at 7:37

1 Answer 1

1

You can use the importdescriptors RPC command of Bitcoin Core, given you can find the derivation path(s) used by this wallet.

Start by creating a descriptor-enabled wallet on bitcoind (unfortunately not yet the default, you have to set descriptors to true in the createwallet call).

For example if you were looking for native segwit v0 outputs you would import a wpkh descriptor: wpkh(yourxpriv/deriv/path/*).
Here is a concrete example with xpriv xprv9s21ZrQH143K2CewR4LfKvC1Liw16RxrUMSUAiiHs4eqyMPE6UNxKmtKKTG7jFWSUhzDP2YT45ej8ratyi2TjL9UVKDVSCj5BDZiBiP91ew and derivation path m/0/1/*:

wpkh(xprv9s21ZrQH143K2CewR4LfKvC1Liw16RxrUMSUAiiHs4eqyMPE6UNxKmtKKTG7jFWSUhzDP2YT45ej8ratyi2TjL9UVKDVSCj5BDZiBiP91ew/0/1/*)

Now, bitcoind mandates the use of a checksum for the import. Therefore if you don't already have one, you can request it using the getdescriptorinfo command (keeping the same dummy values as above):

getdescriptorinfo "wpkh(xprv9s21ZrQH143K2CewR4LfKvC1Liw16RxrUMSUAiiHs4eqyMPE6UNxKmtKKTG7jFWSUhzDP2YT45ej8ratyi2TjL9UVKDVSCj5BDZiBiP91ew/0/1/*)"

You will get a desc#checksum out of it.
For this call it was wpkh(xpub661MyMwAqRbcEgjQX5sfh48jtkmVVtghqaN4y77uRQBpr9iNe1hCsaCoAkV14nksbcNSWWXH8tr9eKrPTLBpGifS8TMG8toqgtVRP6NWZpT/0/1/*)#78f39hv7.

Finally, you can import the descriptor to bitcoind and rescan the block chain from the timestamp at which you created your wallet (here again an instance with the above dummy values):

importdescriptors '[{"desc":"wpkh(xprv9s21ZrQH143K2CewR4LfKvC1Liw16RxrUMSUAiiHs4eqyMPE6UNxKmtKKTG7jFWSUhzDP2YT45ej8ratyi2TjL9UVKDVSCj5BDZiBiP91ew/0/1/*)","range":1000,"next_index":0,"timestamp":1630308659}]'

The same goes for other scriptPubKey types, you can find a reference of the syntax to use here.

5
  • I keep getting the error key 'XXXXXXXXXX' is not valid (code -5) when running getdescriptorinfo, I think it is as mentioned in my commets above, maybe the encoding used in multibit legacy is different from bitcoin's.. any idea?
    – Fnr
    Aug 30, 2021 at 21:20
  • btw, I'm using the key in multibit.key which contains a string of 237 characters and when outputted to base64 has 329 characters...
    – Fnr
    Aug 30, 2021 at 21:30
  • Is it an xpub/xpriv similar to the one in my answer? Aug 31, 2021 at 6:08
  • no, it doesn't begin with xpub/xpriv and it ends with =, so I guess it's ciphered?
    – Fnr
    Aug 31, 2021 at 12:48
  • You can't know whether it's ciphered just based on the encoding. You should look into how to get an xpriv from a multibit wallet. Aug 31, 2021 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.