1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-01 20:08:26 +00:00
trezor-firmware/tools/codegen/get_trezor_keys.py
2018-07-31 11:35:09 +02:00

19 lines
491 B
Python
Executable File

#!/usr/bin/python3
import binascii
from trezorlib.client import TrezorClient
from trezorlib.transport_hid import HidTransport
devices = HidTransport.enumerate()
if len(devices) > 0:
t = TrezorClient(devices[0])
else:
raise Exception("No TREZOR found")
for i in [0, 1, 2]:
path = "m/10018'/%d'" % i
pk = t.get_public_node(
t.expand_path(path), ecdsa_curve_name="ed25519", show_display=True
)
print(path, "=>", binascii.hexlify(pk.node.public_key).decode())