Skip to content

Instantly share code, notes, and snippets.

@SomberNight
Last active July 8, 2019 02:30
Show Gist options
  • Save SomberNight/7430aff37ca883fdabb2b46f40bb87b7 to your computer and use it in GitHub Desktop.
Save SomberNight/7430aff37ca883fdabb2b46f40bb87b7 to your computer and use it in GitHub Desktop.
convert xprv
import electrum
from electrum import bip32
initial_xprv = '.......' # TODO fill in
target_xtype = 'p2wpkh' # TODO change?
_, depth, fingerprint, child_number, c, cK = bip32.deserialize_xprv(initial_xprv)
target_xprv = bip32.serialize_xprv(target_xtype, c, cK, depth, fingerprint, child_number)
print(target_xprv)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment