Metadata-Version: 2.4
Name: hextreezorctl
Version: 0.1.1
Summary: A trezorctl old enough to talk to TREZOR One firmware 1.7.x
License-Expression: LGPL-3.0-or-later
Keywords: trezor,hardware wallet,embedded,firmware
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
License-File: AUTHORS-trezorlib
Requires-Dist: click<8,>=7
Requires-Dist: construct>=2.10
Requires-Dist: ecdsa>=0.9
Requires-Dist: libusb1>=1.6.4
Requires-Dist: mnemonic>=0.17
Requires-Dist: requests>=2.4.0
Requires-Dist: typing_extensions>=3.6
Provides-Extra: hidapi
Requires-Dist: hidapi>=0.7.99.post20; extra == "hidapi"
Dynamic: license-file

# hextreezorctl

A `trezorctl` old enough to talk to TREZOR One firmware **1.7.x**.

```sh
pipx install hextreezorctl
hextreezorctl list
hextreezorctl get-features
```

## Why this exists

trezorlib carries a floor on the device firmware it will speak to:

| trezorlib | released | minimum T1 firmware |
|---|---|---|
| 0.11.2 | 2019-02-27 | **1.6.1** |
| 0.11.3 | 2019-05-29 | 1.8.0 |
| everything since | | 1.8.0 or higher |

0.11.3 raised that floor to 1.8.0 and it never came back down, so a current
`trezorctl` refuses a 1.7.x device outright. 0.11.2 is the last release that
accepts one, and its protobuf definitions are the closest to what that firmware
was built against.

You cannot simply `pip install trezor==0.11.2` any more: it declares `pyblake2`,
an abandoned C extension that stopped compiling when CPython 3.11 made
`Py_TYPE()` non-assignable. That dependency only became conditional in 0.11.5,
by which point the firmware floor had already moved.

So this package carries 0.11.2 with that one import pointed at the standard
library, and exposes its command line tool under a name that will not collide
with a `trezorctl` you use for real devices.

Two other things had to move for it to run on a current Python. `construct` is
required at `>=2.10`, because 2.9 does `import imp` at module scope and `imp`
went away in 3.12. And the Stellar commands are dropped, because that module
needs `xdrlib`, which PEP 594 removed in 3.13 — nothing else in the tool wanted
it. Tested on CPython 3.9 through 3.14.

The vendored tree is generated by `tools/vendor.py`, which fetches the upstream
wheel and verifies its hash before applying those changes, so what is here can
be checked against PyPI. [NOTICE](NOTICE) lists every one of them.

## Install

`pipx` or `uv tool` keep it in an environment of its own, which is what you
want — it pins `click<8` and `construct<2.10`, and those pins should not be
imposed on anything else:

```sh
pipx install hextreezorctl
# or
uv tool install hextreezorctl
```

`pip install hextreezorctl` into a shared environment works too, but those pins
come with it.

On Linux you need the usual udev rules for the device to be reachable without
root. On macOS, `brew install libusb`.

## Use

Everything upstream 0.11.2 could do, under the new name:

```sh
hextreezorctl list
hextreezorctl get-features
hextreezorctl load-device -s                         # SLIP-0014 test seed
hextreezorctl reset-device -t 128 -p -l "my device"  # generate a seed
hextreezorctl recovery-device -w 12 -p -t matrix     # restore one
hextreezorctl get-address -n "m/44'/0'/0'/0/0" -d
hextreezorctl firmware-update -f firmware.bin
```

Everything upstream 0.11.2 offered is here except the two Stellar commands.

PIN entry is positional: the device shows a scrambled 3×3 grid and you type
*where* each digit is, using this layout.

```
7 8 9
4 5 6
1 2 3
```

## What this is for

Devices running TREZOR One firmware 1.7.x — original hardware that has not been
updated, and custom or reproduction boards built from the `legacy` tree. It is a
tool for working on that firmware, not a wallet you should trust with real
funds: 1.7.x is from 2018 and has had many security fixes since.

## Licence

LGPL-3.0-or-later, inherited from python-trezor. See [LICENSE](LICENSE),
[NOTICE](NOTICE) and [AUTHORS-trezorlib](AUTHORS-trezorlib).

trezorlib is Copyright (C) 2012-2019 SatoshiLabs and contributors. This package
is not affiliated with or endorsed by SatoshiLabs.
