-
-
Save openoms/4e8a527e4c9757162a53f2dc96e3d229 to your computer and use it in GitHub Desktop.
Convert xpub/xprv to zpub/zprv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base58 | |
x = 'xprv9s21ZrQH143K2f55zo5GiXiX16MiPzBgc2bEXNd77e1ooGsjxAyXjozyuniqiSB76VESjTW8s7vdsK3NFboha6tZgF9BzcDdNtUT6Aw99P2' | |
zp = b'\x04\xb2\x43\x0c' | |
base58.b58encode_check(zp + base58.b58decode_check(x)[4:]).decode('ascii') | |
# output: 'zprvAWgYBBk7JR8GjFTKfWeX8huXM2ecHEAgSFdg6AQssemZuUWCTVJeywKFxCe1iFUwumU4EQhFnSdjdtGVgzdjAaFmQvY3ARrbvLbjsLf6oNE' | |
# xprv = b'\x04\x88\xad\xe4' | |
# yprv = b'\x04\x9d\x78\x78' | |
# zprv = b'\x04\xb2\x43\x0c' | |
# xpub = b'\x04\x88\xb2\x1e' | |
# ypub = b'\x04\x9d\x7c\xb2' | |
# zpub = b'\x04\xb2\x47\x46' |
I just went through the steps to get an aezeed mnemonic to an Electrum-compatible zprv as well... I can't believe how complex this was!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needs:
pip install base58