Bitcoin Forum
May 10, 2024, 04:21:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: (Solved) Old xpub key to new format?  (Read 247 times)
ttookk (OP)
Hero Member
*****
Offline Offline

Activity: 994
Merit: 513


View Profile
November 12, 2017, 04:22:28 AM
Last edit: November 12, 2017, 02:35:13 PM by ttookk
 #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).
1715358073
Hero Member
*
Offline Offline

Posts: 1715358073

View Profile Personal Message (Offline)

Ignore
1715358073
Reply with quote  #2

1715358073
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715358073
Hero Member
*
Offline Offline

Posts: 1715358073

View Profile Personal Message (Offline)

Ignore
1715358073
Reply with quote  #2

1715358073
Report to moderator
1715358073
Hero Member
*
Offline Offline

Posts: 1715358073

View Profile Personal Message (Offline)

Ignore
1715358073
Reply with quote  #2

1715358073
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
November 12, 2017, 04:40:47 AM
 #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.

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

Activity: 994
Merit: 513


View Profile
November 12, 2017, 04:48:38 AM
 #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?
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
November 12, 2017, 05: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)


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

Activity: 994
Merit: 513


View Profile
November 12, 2017, 12:20:41 PM
 #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.
ttookk (OP)
Hero Member
*****
Offline Offline

Activity: 994
Merit: 513


View Profile
November 12, 2017, 02:38:33 PM
 #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.
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!