Author

Topic: (Solved) Old xpub key to new format? (Read 268 times)

hero member
Activity: 994
Merit: 513
November 12, 2017, 09:38:33 AM
#6
…ok, I solved it. Still, I'm a little confused.

Here's what happened:

I installed Electrum when setting up my Laptop using apt-get install electrum.

Now, I installed it via pip3 install as recommended on the electrum site and it works just fine.


However, the two clients are extremely different and I wonder, what the package install client is from.



Thanks for the help.
hero member
Activity: 994
Merit: 513
November 12, 2017, 07:20:41 AM
#5
if it is the other way around and you used any version before Electrum V 3.x.x then you don't have SegWit by default. so your MPK should be the normal thing starting with xpub... maybe you copied the wrong thing?

this is the way to get the xpub which should work in any wallet (even wallets other than Electrum)



Yup, that's what I got, an xpub key. However, inserting it in the new Electrum version leads to an empty wallet file without addresses and history and a "TypeError: Odd-length string" in the terminal it runs in.

The TypeError indicates some letters it did not expect or newlines or stuff like that. I tried the xpub on a different wallet (also predating segwit), where it was just fine. I even trid it the other way around, generated a pubkey in the new Electrum version from a new wallet (which looks very different), but the old wallet handled it just fine.

Do you have a suggestion for a different wallet? I don't need to use electrum. Core is too big for my laptop, though.
legendary
Activity: 3472
Merit: 10611
November 12, 2017, 12:04:15 AM
#4
if it is the other way around and you used any version before Electrum V 3.x.x then you don't have SegWit by default. so your MPK should be the normal thing starting with xpub... maybe you copied the wrong thing?

this is the way to get the xpub which should work in any wallet (even wallets other than Electrum)

hero member
Activity: 994
Merit: 513
November 11, 2017, 11:48:38 PM
#3
most probably you are using a SegWit wallet with a SegWit master public key which is different than the legacy master public keys and that is why your wallet is not capable of recognizing it.

your only option is to also upgrade your watch only wallet so that it can "understand" the new format.

Thanks, that is probably it.

Although, I think it's the other way around; the pubkeys were generated on a wallet that predates segwit. The watch-only wallet was created on a segwit version.

Isn't there some backwards compatibility?
legendary
Activity: 3472
Merit: 10611
November 11, 2017, 11:40:47 PM
#2
most probably you are using a SegWit wallet with a SegWit master public key which is different than the legacy master public keys and that is why your wallet is not capable of recognizing it.

your only option is to also upgrade your watch only wallet so that it can "understand" the new format.
i have not done this myself though, last time i checked everyone had issues with their Trezor SegWit MPK with different wallets.
hero member
Activity: 994
Merit: 513
November 11, 2017, 11:22:28 PM
#1
Hello,

I tried the search function, but didn't find what I was looking for, so I'll try it this way:


I want to create a watch-only wallet. Thus, I created a new wallet file, then chose the watch-only option, then put in my master public key.


However, I run different versions and apparently, Electrum changed the formatting of Master Public Keys at some point. Now, I get a "TypeError: Odd-length string" message and the created wallet file basically consists of nochting more than the pubkey.

So, I checked and new public keys look very different.

What I have here, is a key, which starts with "xpub…". New public keys don't.

Is there a way to change the format?


And, I realize, that the TypeError COULD theoretically be due to some newlines or other excess input, but I ruled that out by testing and experimenting (including a different old Electrum version on a different computer, which created the wallet just fine).
Jump to: