2016-10-07 11:27:43 +00:00
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def derive(index: int) -> None:
|
|
|
|
'''
|
|
|
|
Derive a BIP0032 child node in place.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def derive_path(path: list) -> None:
|
|
|
|
'''
|
|
|
|
Go through a list of indexes and iteratively derive a child node in place.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2017-06-12 16:02:32 +00:00
|
|
|
def serialize_public(version: int) -> str:
|
2016-10-07 11:27:43 +00:00
|
|
|
'''
|
|
|
|
Serialize the public info from HD node to base58 string.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2017-06-12 16:02:32 +00:00
|
|
|
def serialize_private(version: int) -> str:
|
2016-10-07 11:27:43 +00:00
|
|
|
'''
|
|
|
|
Serialize the private info HD node to base58 string.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-11-08 14:37:48 +00:00
|
|
|
def clone() -> HDNode:
|
|
|
|
'''
|
|
|
|
Returns a copy of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def depth() -> int:
|
|
|
|
'''
|
|
|
|
Returns a depth of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def fingerprint() -> int:
|
|
|
|
'''
|
|
|
|
Returns a fingerprint of the HD node (hash of the parent public key).
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def child_num() -> int:
|
|
|
|
'''
|
|
|
|
Returns a child index of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def chain_code() -> bytes:
|
|
|
|
'''
|
|
|
|
Returns a chain code of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-24 13:44:49 +00:00
|
|
|
def private_key() -> bytes:
|
|
|
|
'''
|
|
|
|
Returns a private key of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-07 11:27:43 +00:00
|
|
|
def public_key() -> bytes:
|
|
|
|
'''
|
|
|
|
Returns a public key of the HD node.
|
|
|
|
'''
|
|
|
|
|
2017-04-08 16:43:26 +00:00
|
|
|
# extmod/modtrezorcrypto/modtrezorcrypto-bip32.h
|
2016-10-24 13:44:49 +00:00
|
|
|
def address(version: int) -> str:
|
2016-10-07 11:27:43 +00:00
|
|
|
'''
|
2016-10-24 13:44:49 +00:00
|
|
|
Compute a base58-encoded address string from the HD node.
|
2016-10-07 11:27:43 +00:00
|
|
|
'''
|