implemented BIP32/BIP44: create extended hard private key & add separation/identification hardened and non-hardened keys
This commit is contained in:
parent
0cce0b70cc
commit
361a9ca90c
@ -146,6 +146,14 @@ def create_expanded_key(key, child_idx):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
# Создание усиленного расширенного приватного ключа
|
||||||
|
def create_expanded_hard_key(key, child_idx):
|
||||||
|
if isinstance(key, dict):
|
||||||
|
if key.get('is_private') and child_idx >= FIRST_HARDENED_CHILD:
|
||||||
|
seed = bytes([0]) + key['key'] + pack('I', child_idx)
|
||||||
|
return hmac_sha512(key['chain_code'], seed)
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def add_private_keys(ext_value, key):
|
def add_private_keys(ext_value, key):
|
||||||
ext_value_int = int.from_bytes(ext_value, byteorder="big")
|
ext_value_int = int.from_bytes(ext_value, byteorder="big")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user