2

When importing an zpub, for example, to a wallet, does the wallet understand it should recreate a set of addresses using the derivation path "m/84'/0'/0'" and the script type "p2wpkh" ?

So if I generate an zpub with correct script type but choose an arbitrary path like "m/77'/0'/0'", would it be conceptually wrong and can cause problems when exporting to other wallets ?

I am just trying to understanding if the concept of version bytes / prefixes in extended public keys are also path-dependent or can change just according script type.

The SLIP 0132 mentions the path for some prefixes. But the Electrum Docs don't.

le0
  • 187
  • 5

2 Answers2

2

It all depends on the wallet. There is no rule saying they should even accept these strings or know what they correspond to and there is no consensus among wallets.
Wallet A could accept zpub and know the desired path and script type while wallet B may accept the same zpub, ignore its version byte and use the default derivation path and a completely different script type while wallet C could simply reject the string because of "unexpected" starting character (z).

With that said most of the times wallets perform similarly as long as there is a BIP somewhere defining the algorithms.

Coding Enthusiast
  • 1,418
  • 4
  • 22
1

The zpub you get from electrum will be at that path itself (m/84'/0'/0'). It's not at m. You can't derive hardened paths from a zpub anyway. If you create a watch only wallet using the zpub electrum will treat it as m and derive public keys and addresses at m/j/i where j is 0 for external (receive) and 1 for change addresses and i is the index. In actuality the addresses will be at m/84'/0'/0'/j/i.

Abdussamad
  • 2,649
  • 12
  • 19