Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: thenastynorth on January 31, 2020, 09:33:23 PM



Title: Master Public Key, no zpub prefix
Post by: thenastynorth on January 31, 2020, 09:33:23 PM
Wallet - Information
Master Public Key does not have a "zpub", "xpub", or any prefix. This is required for multi-sig transactions.

Version 3.8.8, recently downloaded directly from the Electrum site and installed.
Is there a way to resolve this?

Thanks.


Title: Re: Master Public Key, no zpub prefix
Post by: BitMaxz on January 31, 2020, 10:04:49 PM
Where did you make your multi-sig wallet?
Is it from a different wallet?

It shows fine to me when I tried to check my Multi-Sig wallet on wallet information it shows xpub.

It seems it's a bug if you created it from Electrum wallet.

How many consigners and signature did you set?


Title: Re: Master Public Key, no zpub prefix
Post by: thenastynorth on January 31, 2020, 10:15:43 PM
I'm just working off of my Electrum wallet.
3.8.8
The Master Public Key displayed should start with "xpub" followed by a series of numbers.
Mine does not.
It just displays a series of numbers.


Title: Re: Master Public Key, no zpub prefix
Post by: AdolfinWolf on January 31, 2020, 10:27:26 PM
I'm just working off of my Electrum wallet.
3.8.8
The Master Public Key displayed should start with "xpub" followed by a series of numbers.
Mine does not.
It just displays a series of numbers.
Where are you getting your master public key from, (Wallet -> Information?) How old is your wallet file?
If you upgrade electrum while you still have a wallet file that uses < 2.9.3 wallet formats, the master pubkey (might be?) different (Read link below.).


Is that the case here?

Does it look like this:
https://i.imgur.com/W7xo4tH.png

https://www.reddit.com/r/Electrum/comments/79rucr/my_master_public_key_doesnt_start_with_xpub/


If not, please verify your electrum.org binaries - https://electrum.org/#download , otherwise; have you tried creating a new wallet? (Although, - if the xpub is just "some numbers", the wallet itself should be invalid. that would've been obvious..


Title: Re: Master Public Key, no zpub prefix
Post by: thenastynorth on January 31, 2020, 10:40:29 PM
I'm just working off of my Electrum wallet.
3.8.8
The Master Public Key displayed should start with "xpub" followed by a series of numbers.
Mine does not.
It just displays a series of numbers.
Where are you getting your master public key from? How old is your wallet file?
If you upgrade electrum while you still have a wallet file that uses < 2.9.3 wallet formats, the master pubkey (might be?) different.


Is that the case here?

Does it look like this:
https://i.imgur.com/W7xo4tH.png

https://www.reddit.com/r/Electrum/comments/79rucr/my_master_public_key_doesnt_start_with_xpub/


If not, please verify your electrum.org binaries - https://electrum.org/#download , otherwise; have you tried creating a new wallet?

It kind of looks like that, but the version shows as 3.8.8.
The Key looks just like that.
I always just use the default wallet.
I guess I could uninstall and reinstall.
A little worried about losing bitcoin, but if I use my seed, it should be ok, right?


Title: Re: Master Public Key, no zpub prefix
Post by: AdolfinWolf on January 31, 2020, 10:45:44 PM
It kind of looks like that, but the version shows as 3.8.8.
The Key looks just like that.
I always just use the default wallet.
I guess I could uninstall and reinstall.
A little worried about losing bitcoin, but if I use my seed, it should be ok, right?
The wallet (software) version is/can be different from your wallet FILE version.

Also : there's no reason to delete/uninstall anything really.
Here's what you should try, in my opinion;

1. You should import your seed first to see if you actually generate the right wallet, containing all of your bitcoins (it should! just to make sure!)
Once you imported your seed (with Restore -> "name your "new" wallet" -> "Standard Wallet -> I already have a seed")
2. You should go to Wallet -> Information, and see if the MPK is updated. (I haven't looked into this, so it might not change, even after "restoring"..)

3. If not, you need to generate a new wallet (new seed.) (You can choose between Legacy and Segwit. Legacy is 1.., and segwit are the newer bc1... address, which lets you save on transaction fees.)
4. Then, check if the MPK is correct in the new wallet. (Either xpubXXXXX for a legacy wallet and zpubXXXXX for Segwit  (Actually, you can't use Segwit for multisig as it'll generate a zpub instead of the required Zpub (https://www.reddit.com/r/Electrum/comments/7f46ei/wrong_key_type_p2wpkh_when_creating_multisig/)), so, stick to generating a new legacy wallet.

5. and then transfer all of your bitcoins to the new wallet. (You don't actually need to do this. You can also just use the xpub + master private key for your multisig operandi (?).)

Don't delete any wallet files, or even uninstall Electrum, as i don't think that's the issue here.

What i don't understand is why you necessarily want the xpub to be from the wallet (master private key) where your bitcoins from your p2pkh “wallet” are stored in. ..Convenience? It doesn’t seem convenient to me at all.


I haven't asked, and perhaps it is none of my business, but what are you planning on using Multisig for? Or, why you even want to “update” the master public key of your p2pkh wallet, as you can also just create a new multisig wallet just as easily.




Title: Re: Master Public Key, no zpub prefix
Post by: BitMaxz on January 31, 2020, 11:04:51 PM
~snip~

According to the Reddit link above shared by AdolfinWolf it will work as a normal without the prefix.

So try to use that key without prefix by making a new standard wallet then choose "Use a Master key" and paste that MPC if it won't work well, better to create a new wallet as suggested above and send it to your new wallet.

4. Then, check if the MPK is correct in the new wallet. (Either xpubXXXXX for a legacy wallet and zpubXXXXX for Segwit  (Actually, you can't use Segwit for multisig as it'll generate a zpub instead of the required Zpub (https://www.reddit.com/r/Electrum/comments/7f46ei/wrong_key_type_p2wpkh_when_creating_multisig/)), so, stick to generating a new legacy wallet.

I created multisig wallet recently with segwit generated directly from Electrum and the 2nd consigner is legacy. No error and no issue it's working fine to me and the wallet information shows this below.

https://i.imgur.com/YBCRhaw.png

So I think he needs to generate segwit first while making multisig wallet then the 2nd consigner must be a legacy wallet.
There might be a bug on using 2 segwit wallets in multisig they don't allow me to put segwit wallet in 2nd consigner that is why I generated the legacy wallet to test if it will work.



Title: Re: Master Public Key, no zpub prefix
Post by: thenastynorth on January 31, 2020, 11:14:00 PM
Thanks for the help!
I'll give it a shot.

It kind of looks like that, but the version shows as 3.8.8.
The Key looks just like that.
I always just use the default wallet.
I guess I could uninstall and reinstall.
A little worried about losing bitcoin, but if I use my seed, it should be ok, right?
The wallet (software) version is/can be different from your wallet FILE version.

Also : there's no reason to delete/uninstall anything really.
Here's what you should try, in my opinion;

1. You should import your seed first to see if you actually generate the right wallet, containing all of your bitcoins (it should! just to make sure!)
Once you imported your seed (with Restore -> "name your "new" wallet" -> "Standard Wallet -> I already have a seed")
2. You should go to Wallet -> Information, and see if the MPK is updated. (I haven't looked into this, so it might not change, even after "restoring"..)

3. If not, you need to generate a new wallet (new seed.) (You can choose between Legacy and Segwit. Legacy is 1.., and segwit are the newer bc1... address, which lets you save on transaction fees.)
4. Then, check if the MPK is correct in the new wallet. (Either xpubXXXXX for a legacy wallet and zpubXXXXX for Segwit  (Actually, you can't use Segwit for multisig as it'll generate a zpub instead of the required Zpub (https://www.reddit.com/r/Electrum/comments/7f46ei/wrong_key_type_p2wpkh_when_creating_multisig/)), so, stick to generating a new legacy wallet.

5. and then transfer all of your bitcoins to the new wallet.

Don't delete any wallet files, or even uninstall Electrum, as i don't think that's the issue here.






Title: Re: Master Public Key, no zpub prefix
Post by: Abdussamad on February 01, 2020, 12:22:27 AM
You likely have a pre-bip32 wallet from before electrum 2.0. You can't use this to create a multisig wallet. In fact even if you had a bip32 wallet you wouldn't use it to create a multisig wallet. Creating a multisig wallet involves generating new seeds and all participants must use electrum. Don't try to create a multisig wallet with people using other software. There's a guide here (https://bitcoinelectrum.com/creating-a-multisig-wallet/) if you're interested in doing it right.

Also note that the latest electrum version is 3.3.8 not 3.8.8. If you're using 3.8.8 then you likely have a malware version of electrum. Details like these matter when it comes to bitcoin and computers in general.


Title: Re: Master Public Key, no zpub prefix
Post by: AdolfinWolf on February 01, 2020, 08:24:39 AM
I created multisig wallet recently with segwit generated directly from Electrum and the 2nd consigner is legacy. No error and no issue it's working fine to me and the wallet information shows this below.

https://i.imgur.com/YBCRhaw.png

So I think he needs to generate segwit first while making multisig wallet then the 2nd consigner must be a legacy wallet.
There might be a bug on using 2 segwit wallets in multisig they don't allow me to put segwit wallet in 2nd consigner that is why I generated the legacy wallet to test if it will work.
No, i think that with segwit there is a difference between P2WPKH mpk and P2WSH, (zpub v Zpub), which is why there’s an error. So yeah just generate 2 segwit P2WSH pubkeys and it works fine. Wheres p2pkh and P2SH are “identical” (xpub?)

https://bitcoin.stackexchange.com/questions/89261/why-does-importmulti-not-support-zpub-and-ypub
Although i still don’t get if that difference is something on a “protocol”(for a lack of better words) level, or just done to more easily recognize the address it’s supposed to generate.

Also, you’re telling me you used a P2WSH mpk (Zpub) with a legacy cosigner? Huh?


Title: Re: Master Public Key, no zpub prefix
Post by: BitMaxz on February 01, 2020, 08:04:20 PM
.Also, you’re telling me you used a P2WSH mpk (Zpub) with a legacy cosigner? Huh?
No, I didn't use the Master public key to make a MultiSig wallet the segwit wallet is directly generated from Electrum in MultiSig by choosing "Create a new seed" instead of "Use a master key".

https://i.imgur.com/bi5jXhM.png
Read the comments from here https://www.reddit.com/r/Electrum/comments/7gx4h6/multisig_and_segwit_wallets/
According to the comment, it is allowed to use segwit in multisig if you choose to generate seed on Electrum and it won't allow you to add more consigner with Segwit(I'm getting error "Wrong key type p2wpkh") that's why I generated a Legacy wallet as another consigner.


Title: Re: Master Public Key, no zpub prefix
Post by: Abdussamad on February 02, 2020, 01:48:27 AM
Read the comments from here https://www.reddit.com/r/Electrum/comments/7gx4h6/multisig_and_segwit_wallets/
According to the comment, it is allowed to use segwit in multisig if you choose to generate seed on Electrum and it won't allow you to add more consigner with Segwit(I'm getting error "Wrong key type p2wpkh") that's why I generated a Legacy wallet as another consigner.

That's not what that comment says at all. It just explains the upsides and downsides to bech32 addresses.

Segwit multisig wallets are possible in electrum. All cosigners must choose segwit or all of them must choose legacy. You can't mix and match the two types. That's all.