I'm trying to generate bip32 addresses using the following (the PHP version).


The author provides a test MPK which I can get working that looks like this:


However, the MPK I export from electrum does not work. Its much shorter and looks like this:


The exact message I get is

pack(): Type H: illegal hex digit x

Any idea whats going on? Why does electrum's MPK not resemble the authors?

1 Answer 1


addrgen author here!

Addrgen was created before Electrum was BIP-0032 compatible and thus it used different master public keys and derivation method.

Please check the following PHP implementation which supports BIP-0032:

For python there are couple of implementations available, e.g.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.