1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-23 07:58:09 +00:00
trezor-firmware/tools/codegen/get_trezor_keys.py

19 lines
495 B
Python
Raw Normal View History

2018-09-30 13:42:58 +00:00
#!/usr/bin/env python3
2017-10-04 12:27:13 +00:00
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:
2018-07-31 09:35:09 +00:00
raise Exception("No TREZOR found")
2017-10-04 12:27:13 +00:00
for i in [0, 1, 2]:
path = "m/10018'/%d'" % i
2018-07-31 09:35:09 +00:00
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())