1
0

trezor multisig: build xpub from pubkey

This commit is contained in:
ThomasV
2015-07-05 23:29:36 +02:00
parent ad9f7411d7
commit 15f592f022
2 changed files with 17 additions and 5 deletions

View File

@@ -714,6 +714,14 @@ def bip32_root(seed, testnet=False):
return EncodeBase58Check(xprv), EncodeBase58Check(xpub)
def xpub_from_pubkey(cK, testnet=False):
header_pub, header_priv = _get_headers(testnet)
assert cK[0] in ['\x02','\x03']
master_c = chr(0)*32
xpub = (header_pub + "00" + "00000000" + "00000000").decode("hex") + master_c + cK
return EncodeBase58Check(xpub)
def bip32_private_derivation(xprv, branch, sequence, testnet=False):
assert sequence.startswith(branch)
if branch == sequence: