1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-30 01:58:11 +00:00
trezor-firmware/mocks/trezor/crypto/HDNode.py

67 lines
1.6 KiB
Python
Raw Normal View History

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