From c9882d7a8a0b7d186b95ddcef7f975efbf99b3c8 Mon Sep 17 00:00:00 2001 From: scgbckbone Date: Tue, 22 Oct 2024 10:22:51 +0200 Subject: [PATCH] save bytes drv_entro.py --- shared/drv_entro.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared/drv_entro.py b/shared/drv_entro.py index 3fad9dae..91ce4cef 100644 --- a/shared/drv_entro.py +++ b/shared/drv_entro.py @@ -56,32 +56,32 @@ still backed-up.''') def bip85_derive(picked, index): # implement the core step of BIP85 from our master secret - + path = "m/83696968h/" if picked in (0,1,2): # BIP-39 seed phrases (we only support English) num_words = stash.SEED_LEN_OPTS[picked] width = (16, 24, 32)[picked] # of bytes - path = "m/83696968h/39h/0h/{num_words}h/{index}h".format(num_words=num_words, index=index) + path += "39h/0h/%dh/%dh" % (num_words, index) s_mode = 'words' elif picked == 3: - # HDSeed for Bitcoin Core: but really a WIF of a private key, can be used anywhere + # HDSeed for Bitcoin Core: but really a WIF of a private key s_mode = 'wif' - path = "m/83696968h/2h/{index}h".format(index=index) + path += "2h/%dh" % index width = 32 elif picked == 4: # New XPRV - path = "m/83696968h/32h/{index}h".format(index=index) + path += "32h/%dh" % index s_mode = 'xprv' width = 64 elif picked in (5, 6): width = 32 if picked == 5 else 64 - path = "m/83696968h/128169h/{width}h/{index}h".format(width=width, index=index) + path += "128169h/%dh/%dh" % (width, index) s_mode = 'hex' elif picked == 7: width = 64 # hardcoded width for now # b"pwd".hex() --> 707764 - path = "m/83696968h/707764h/{pwd_len}h/{index}h".format(pwd_len=BIP85_PWD_LEN, index=index) + path += "707764h/%dh/%dh" % (BIP85_PWD_LEN, index) s_mode = 'pw' else: raise ValueError(picked)