Author

Topic: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) (Read 193 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
Something that also surprised me is that Electrum doesn't operate with BIP39 seeds, it seems, so if I create a seed in Electrum I can't use the seed directly on another wallet, would that be the case? I'd need to grab the xprvs for this.

I searched for a way of converting seeds but don't know if that's possible. Needless to say, it's great that Electrum itself accepts BIP39 seeds.
Yes.
BTW, what's the reason why you need to use another wallet? As another cosigner?
If so, that client should have a "PSBT" feature (Partially Signed Bitcoin Transaction), without it, it wont be able to sign the exported unsigned/partially-signed transactions from Electrum and vice versa.
legendary
Activity: 2268
Merit: 18711
No problem.

The issue is that both BIP39 and Electrum pass your seed phrase through HMAC-SHA512 to derive the master seed for your wallet. There is also a salt used in the function. Both use a word concatenated with any additional passphrase, but BIP39 uses the word "mnemonic" while Electrum uses the word "electrum". Therefore, even if you used the same seed phrase or some otherwise equivalent seed phrase, the salt of the function will always be different and so the output (and therefore the resulting wallet) will also be different.

Theoretically, it would be possible to find a seed phrase which generates the same wallet, but it would involve you brute-forcing a passphrase which gives a SHA512 collision, which is obviously impossible.

If you want to import an Electrum wallet somewhere else, then generally you'll need to use the master private key.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
However, there are ways to convert Electrum seed into normal BIP39 seed if need be.
No, there aren't. Or at least, if you convert an Electrum seed phrase to a BIP39 seed phrase, it will restore an entirely different set of wallets. They both use different salts for turning seed phrase in to keys, so even if you had one set of words which was both a valid Electrum seed phrase and a valid BIP39 seed phrase, it would generate different wallets.

I was not expecting to use the same seed, I was expecting to get some sort of equivalent seed. Different words, because of the different identifier electrum/mnemonic and the version, but the result to be the same zpub/addresses.
But I know that you know it better, which means that I was wrong. I've fixed that post too. Thanks for correcting me.
legendary
Activity: 2268
Merit: 18711
I'm still getting a hang of all the different types of xpubs out there.
You'll find a list of the different formats and their purposes here: https://github.com/satoshilabs/slips/blob/master/slip-0132.md#registered-hd-version-bytes

However, there are ways to convert Electrum seed into normal BIP39 seed if need be.
No, there aren't. Or at least, if you convert an Electrum seed phrase to a BIP39 seed phrase, it will restore an entirely different set of wallets. They both use different salts for turning seed phrase in to keys, so even if you had one set of words which was both a valid Electrum seed phrase and a valid BIP39 seed phrase, it would generate different wallets.
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
Something that also surprised me is that Electrum doesn't operate with BIP39 seeds, it seems, so if I create a seed in Electrum I can't use the seed directly on another wallet, would that be the case?

Indeed, Electrum adds some more information there, hence its seed (as it is) is for Electrum only, although the wordlist they use is the same as for BIP39.

Starting with version 2.0, Electrum seed phrases include a version number, whose purpose is to indicate which derivation should be followed in order to derive private keys and addresses.

However, there are ways to convert Electrum seed into normal BIP39 seed if need be. (Update: Sorry, it looks like I was wrong with this.)
newbie
Activity: 4
Merit: 14
Thanks so much, sirs, the UTXO is free! 🙌🏼🙌🏼🙌🏼

I'm still getting a hang of all the different types of xpubs out there.

Something that also surprised me is that Electrum doesn't operate with BIP39 seeds, it seems, so if I create a seed in Electrum I can't use the seed directly on another wallet, would that be the case? I'd need to grab the xprvs for this.

I searched for a way of converting seeds but don't know if that's possible. Needless to say, it's great that Electrum itself accepts BIP39 seeds.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
I'll follow the steps described and report back when the UTXO is free again 🙏🏼🍻
Take note: the steps I've provided is only for recovering the 1000 satoshi that you've already sent to the wallet, it's not the right way to create a MultiSig wallet.
And you shouldn't use the recovered wallet(s) after sending the funds out, create a new MultiSig wallet the right way: https://bitcoinelectrum.com/creating-a-multisig-wallet/
legendary
Activity: 2268
Merit: 18711
For future reference, Electrum has a built in wizard specifically for creating multi-sig wallets which you should use instead. Just create a new wallet, select "Multi-signature wallet", choose 2-of-3 or some other m-of-n set up, and create a new seed phrase. You'll need to repeat the whole process another two times to get three seed phrases in total. Electrum will automatically give you the relevant Zpub to import to the other wallets. Ideally, you'll want to create the wallets on separate devices for security reasons.

I wouldn't go manually converting keys between Zpubs and xpubs or similar in the future as you increase the chance of running in to problems and losing access to your coins. And when creating your seed phrase back ups, be aware that you also need to back up the Zpubs from the other shares at the same time.

newbie
Activity: 4
Merit: 14
This is great, thanks so much! These are my first steps with multisig so I appreciate the help a lot.

I'll follow the steps described and report back when the UTXO is free again 🙏🏼🍻
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
It's easy to recover with the console command: convert_xkey:

  • First, open the console tab ("View->Show Console" to enable the tab) of the two cosigners which you'd want to get the "master private key" from.
  • Type getmasterprivate() on each console to get each wallet's master private key (you'll get 'zprv' since it's p2wpkh based from the screenshot).
  • Type convert_xkey("zprv.......................","standard") to convert it into an "xprv" key, then copy the converted keys of the two cosigners.
  • Lastly, create a new multisig wallet(s) using those two xprv and one xpub, just make sure that the xpub that you'll use isn't the xpub of the already-given xprv.
  • Or Alternatively, create two cosigners using 1 xprv and 2 xpubs.

Notes from my test (testnet: vprv=zprv | tprv=xprv):
Code:
2-of-2_Multisig_from_StandardSegwit_to_MultisigLegacy
-----------------------------------------------------------------------------------------------------------------------
SEED1: dwarf mixture waste width duck survey custom need dash erosion grit gap
vprv1: vprv9FvME8ocMUz3qdq2sF5tPUMJyT3cVKhuWMZpb7jtf68vhkVYMMz7ydixsdQtc9huXq1gtgNKypodofi9hYf4phck6CGT6bgqqeFfNJD5qBG
vpub1: vpub5UuhdeLWBrYM47uVyGctkcJ3XUt6tnRksaVRPW9WDRfuaYpgtuJNXS3SiwgNKiCqYa5RX6LS1VHjADm43jiy7ySFjTDu5rtQNwbH2qPTExX
tpub1: tpubD8wrmDW2CVam2WUb6BBENhpRCYGemQupFS8AJqzRKMBZS37rUSUav12Z1PgKr2Tv9kqwdd3RTupscyUnszQEbtFkXjN3wDBcWMJya4ExRWA

convert_xkey("vprv9FvME8ocMUz3qdq2sF5tPUMJyT3cVKhuWMZpb7jtf68vhkVYMMz7ydixsdQtc9huXq1gtgNKypodofi9hYf4phck6CGT6bgqqeFfNJD5qBG","standard")

tprv1: tprv8cFpcoTn47u693SoCXWdyJAJdWkic5iug8XP2Kx7u5PAbYs5r3ezjWQgqDVicLQ4iYn5PjBD4W6Y36V2G9q3EEFYMWsbvn3sJC8NbBS61jA
-----------------------------------------------------------------------------------------------------------------------
SEED2: effort pipe ask skate father decline desk deal fuel frown shoe shine
vprv2: vprv9GUMt1Grqo1in3GbqXJMn4c7YX7tZM2Bdch4xL5EjE6F7NAXTYWnbMqMn4dAwZJXRtyASBGx5Pi7aN6zetpiHw9HZXaXxfYcNqGT1rHGEz6
vpub2: vpub5VTiHWokgAa1zXM4wYqN9CYr6YxNxok2zqcfkiUrHZdDzAVg15q39A9qdKuPoqga3KDbz321gXxMTySZqNfBz9ppHSMSnYYay2UgQpvttyz
tpub2: tpubD9VsR5yGgocRxuvA4TPhmJ5DmcLvqSE6NhFQg4KmPV8sqenqad1FXj8wumuML9weeVz86Zj18xVVvjAJfdLTU4eK5iVbdtqo6SCNwx31qVD

convert_xkey("vprv9GUMt1Grqo1in3GbqXJMn4c7YX7tZM2Bdch4xL5EjE6F7NAXTYWnbMqMn4dAwZJXRtyASBGx5Pi7aN6zetpiHw9HZXaXxfYcNqGT1rHGEz6","standard")

tprv2: tprv8coqGfw2YRvm5StNAoj7MtR7Capzg73BoPedPYHTyDLV1AY4xEBfMEX5jehzwjzgccjYwE5qA511onssDVzghTn5prBgnqudqP9AEcPNEgF
-----------------------------------------------------------------------------------------------------------------------
1st address: 2N3sdmPzgVzY2P6ZpDN3tWcrC8wu2APFbax
-----------------------------------------------------------------------------------------------------------------------
legendary
Activity: 3472
Merit: 10611
The wallet type that is barely visible in the background is saying "Standard" and ""P2WPKH" which indicates that it is not a multi-sig wallet so obviously Electrum doesn't recognize the output coming from a multi-sig script.

P.S. If you want to test stuff you should use testnet, it doesn't cost a thing and even if you mess up and lose the coins you are not losing "money".
HCP
legendary
Activity: 2086
Merit: 4361
It is hard to tell because the screenshot is small, but it looks like you are trying to use the "single sig" wallet to sign the transaction... is that correct? Huh

If so, that won't work. You can't sign the multisig from the original single sig wallet (even though it technically contains the correct private key)... you need to "recreate" the multisig (using your single sig xprv and the other 2 xpubs)... then it will recognise the transaction as being related to the wallet and allow you to sign it.


EDIT:
should mention that to fully sign the transaction, you would need to either:

a. create 2 "copies" of the Multisig... using (xprvA + xpubB + xpubC) and/or (xpubA + xprvB + xpubC) and/or (xpubA + xpubB + xprvC)... and then sign the transaction with each wallet.

or

b. create 1 copy of the multisig that includes at least 2 of the xprv's and/or the remaining xpub (xprvA + xprvB + xpubC) or (xpubA + xprvB + xprvC) or (xprvA + xpubB + xrpvC) or (xprvA + xprvB + xprvC)

newbie
Activity: 4
Merit: 14
Quick note - the three wallets I used to create the multisig were originally singlesig wallets created on Electrum. Is that where the problem is? I thought any wallet could be used to sign a multisig transaction, but maybe that's where my lesson is. Smiley
newbie
Activity: 4
Merit: 14
Hi,

Bitcoin Client Software and Version Number: Electrum 4.1.5
Operating System: MacOS 10.15.7
System Hardware Specs: iMac 27"


Description of Problem: I'm practicing setting up a multisig and created a 3-of-2 multisig wallet on Electrum.

I used 3 xpubs that I previously converted from Electrum's Zpubs using jlopp's extended key converter (https://jlopp.github.io/xpub-converter/).

I have the three private keys sent 1000 sats to the wallet - https://mempool.space/address/323CcA727ghg4t36sv6LEizodZqcNzenBQ

When I create a transaction on the multisig wallet and open it in one of the signing wallets, it says the transaction is unrelated to the wallet. Screenshot below.

What would be the approach to recover these sats? Obviously not worried about the value, just don't want to leave the UTXO abandoned...

I'll paste the xpubs below but happy to share the seed and/or the Electrum file if that would help. I recreated this wallet on Specter and the 1000 sats didn't come up.

xpub68QRZLuNHWNZTsuNXrCVSQc18uP9x9hKyRLqxqXw9rZydDJfSjQ2TZMFADpVfGC3nuCsZs2fNCF 6nH58qCDE4SfxhPqf3ynnHoB7Hxb22DD
xpub69jsLCyxYn9d3vq3Czs7zns9z7miB8MfDW4mbSAUKctshDxz5EVvn6RQNs3oxsTpXAywXaFJAHP ehUUTiLo3fiwHAoJyv7AHNjNJY9TV9oh
xpub68MjjH2hpCLB4ih95mNTFsTzW2M223YAJKQytafxow9CWjhXxP8kc3hABSc44UtbP7F6u7sqc2F 1vT71pdBghMuFixA9i2kxpWyjecj1r7W

Does using the converted xpubs to create the multisig lead to an irretrievable wallet, by any chance?

Thanks! Any help is appreciated in my multisig learning journey! All the best

https://i.ibb.co/r2Pn1rD/2022-01-22-at-7-15-PM.png
Jump to: