Title: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: pleblira on January 23, 2022, 12:23:29 AM 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 Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: pleblira on January 23, 2022, 12:47:41 AM 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. :)
Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: HCP on January 23, 2022, 01:01:32 AM 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? ???
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) Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: pooya87 on January 23, 2022, 04:07:33 AM 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". Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: nc50lc on January 23, 2022, 04:54:02 AM -snip- It's easy to recover with the console command: convert_xkey:
Notes from my test (testnet: vprv=zprv | tprv=xprv): Code: 2-of-2_Multisig_from_StandardSegwit_to_MultisigLegacy Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: pleblira on January 26, 2022, 03:08:40 AM 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 🙏🏼🍻 Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: o_e_l_e_o on January 26, 2022, 11:09:14 AM 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. Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: nc50lc on January 26, 2022, 01:23:01 PM 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/ (https://bitcoinelectrum.com/creating-a-multisig-wallet/) Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: pleblira on January 27, 2022, 02:45:30 PM 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. Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: NeuroticFish on January 27, 2022, 02:57:59 PM 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. Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: o_e_l_e_o on January 27, 2022, 05:25:41 PM 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-bytesHowever, 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.Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: NeuroticFish on January 27, 2022, 05:51:24 PM 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. Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: o_e_l_e_o on January 27, 2022, 06:48:27 PM 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. Title: Re: Recovering 1000 sats on a 2-of-3 multisig (have all private keys) Post by: nc50lc on January 28, 2022, 03:13:07 AM -snip- Yes.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. 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. |