Bitcoin Forum
April 23, 2024, 11:24:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Dump private keys from Bitcoin core  (Read 221 times)
scarich (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 5


View Profile
March 06, 2019, 11:53:05 AM
Merited by vapourminer (1)
 #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?
1713871464
Hero Member
*
Offline Offline

Posts: 1713871464

View Profile Personal Message (Offline)

Ignore
1713871464
Reply with quote  #2

1713871464
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Pmalek
Legendary
*
Offline Offline

Activity: 2744
Merit: 7092



View Profile
March 06, 2019, 11:59:22 AM
Merited by OgNasty (1), vapourminer (1)
 #2

Take a look at this thread > https://bitcointalk.org/index.php?topic=4100241.0

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
scarich (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 5


View Profile
March 06, 2019, 01:47:15 PM
Last edit: March 06, 2019, 02:27:25 PM by scarich
 #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?
Abdussamad
Legendary
*
Offline Offline

Activity: 3598
Merit: 1560



View Profile
March 06, 2019, 07:22:21 PM
Merited by HCP (2), OgNasty (1), Welsh (1)
 #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 </path/to/somefile> . open that file in a text editor to see the priv keys.

scarich (OP)
Jr. Member
*
Offline Offline

Activity: 36
Merit: 5


View Profile
March 06, 2019, 08:10:45 PM
 #5

Abdussamad, thanks for explanation! That exactly what I needed  Smiley
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!