Author

Topic: Dump private keys from Bitcoin core (Read 241 times)

jr. member
Activity: 36
Merit: 5
March 06, 2019, 03:10:45 PM
#5
Abdussamad, thanks for explanation! That exactly what I needed  Smiley
legendary
Activity: 3710
Merit: 1586
March 06, 2019, 02:22:21 PM
#4
Core addresses are not multisig by default. Those are p2sh segwit addresses. When importing in electrum you have to prepend p2wpkh-p2sh: to the private key. For example:

Code:
pw2pkh-p2sh:Lflkdlkj....

To dump all the private keys use the dumpwallet command in core debug console. dumpwallet . open that file in a text editor to see the priv keys.

jr. member
Activity: 36
Merit: 5
March 06, 2019, 08:47:15 AM
#3
Pmalek, thank you very much, it is very useful! But how can I see all the private and public keys (I mean of all participants) of the current multisig address in Bitcoin core? If a use command "dumpprivkey " address" I see only one private key. Which command I should use?
legendary
Activity: 2730
Merit: 7065
March 06, 2019, 06:59:22 AM
#2
Take a look at this thread > https://bitcointalksearch.org/topic/how-to-import-a-multi-sig-wallet-to-electrum-from-private-keys-of-participants-4100241

Try this:
If it's a 3 of 3 multisig, in order to import it into Electrum, you'd need all three xprivs (master private keys)
Go to file->New/Restore
Enter a name for your wallet
Select "multisig wallet"
Choose the multisig scheme (eg 2 of 2, 2 of 3, 3 of 3,)
Select "use a master key) if you have the xprivs or "use an existing seed" if you have the seed phrases
Enter the first xpriv, click next
Save the xpub , click next
enter the xpriv or seed of second cosigner, click next
repeat the procedure for the last cosigner
enter a password for the wallet for security, click next
And your multisig is restored.

Or this:
I have the 3 private keys of the 3 participants (3-of-3). Is it possible to import the BTC from the multi-sig address to Electrum wallet?
As Abdussamad has said, if the "private keys" that you have are NOT Master Private Keys (ie. xprivs) then you cannot recreate the MultiSig in Electrum.

However, you can certainly get the funds to your Electrum wallet if you have the 3 private keys... One possible option would be to use a service like coinb.in to:

1. Replicate the 3-of-3 MultiSig using the "New -> MultiSig Address" feature of Coinb.in:
  • Enter the 3 public keys for the 3 private keys into the boxes provided
  • Set "Amount of Signatures required" to 3
  • Click Submit
  • Double check that the address generated matches the 3-of-3 MultiSig address
  • If the address does NOT match, alter the order of the public keys and try again. Continue trying different combinations until you get the correct MultiSig address generated
  • Once you have the correct address, make a copy the RedeemScript

and then you can...

2. Create a transaction that spends from that MultiSig Address
  • Copy/Paste the "RedeemScript" from Step 1. into the box and click "Load"
  • All available "Inputs" (ie. UTXOs) for that address should be loaded (see "Inputs" tab)
  • On the "Outputs" tab, enter the destination address (ie. the address from your Electrum wallet) into the Address Box and the amount you want to send
  • NOTE: Coinb.in simply uses whatever is NOT sent to Addresses as the fee, so you have to calculate manually. This also means that if you're not wanting to spend EVERYTHING from the MultiSig, you NEED to explicitly specify a Change Address as any unspent funds will be used as a fee!!! Shocked
  • Once you're happy with your Inputs and Outputs, click "Submit" and you'll get the unsigned transaction hex.
  • Copy the unsigned transaction hex
  • (Optional, but Recommended) You can input the unsigned hex on the "Verify" page to make sure it is sending the correct amount of coins to the correct addresses and paying the correct fee
  • Once you're satifisied, goto the "Sign" page and paste the unsigned hex into the box, and enter the first of your 3 private keys
  • Click submit and you'll get a "partially" signed transaction hex
  • Copy the partially signed hex
  • Again, goto the "Sign" page, but this time, put in the partially signed hex and the second of your 3 private keys
  • Click submit and you'll get a second "partially" signed transaction hex
  • Copy the second partially signed hex
  • Again, goto the "Sign" page, this time, put in the second partially signed hex and the last of your 3 private keys
  • Click submit and you'll get a fully signed transaction hex
  • (Optional, but Recommended) Double check the fully signed transaction hex on the "Verify" page once more
  • Once satisfied that all is OK, goto the "Broadcast" page, enter your fully signed transaction hex and click "Submit"
  • congrats, you just created, signed and broadcast a MultiSig transaction Wink


NOTES: You should consider the MultiSig Address (and the 3 private keys used) compromised if you do this... I would not recommend using that address or the private keys again.
jr. member
Activity: 36
Merit: 5
March 06, 2019, 06:53:05 AM
#1
Hello! Could you clarify, please, one issue for me. All of the addresses which Bitcoin core generates are the multisig addresses (starts on 3). There is no problem for me to dump the private key or the whole wallet from Bitcoin core, and after import it in Bitcoin core. But if I try to dump that private key and import it to another wallet (eg Electrum) I get the empty balance, address is differ and it is not multisig. How can I import the private key of multisig address?
Jump to: