diff --git a/python/.changelog.d/1026.added b/python/.changelog.d/1026.added deleted file mode 100644 index 808696d89..000000000 --- a/python/.changelog.d/1026.added +++ /dev/null @@ -1 +0,0 @@ -New exception type `DeviceIsBusy` indicates that the device is in use by another process. diff --git a/python/.changelog.d/1026.fixed b/python/.changelog.d/1026.fixed deleted file mode 100644 index a5b7dcc05..000000000 --- a/python/.changelog.d/1026.fixed +++ /dev/null @@ -1 +0,0 @@ -trezorctl will correctly report that device is in use. diff --git a/python/.changelog.d/1430.added b/python/.changelog.d/1430.added deleted file mode 100644 index 3d2d76614..000000000 --- a/python/.changelog.d/1430.added +++ /dev/null @@ -1 +0,0 @@ -Support payment requests and GetNonce command. diff --git a/python/.changelog.d/1430.added.1 b/python/.changelog.d/1430.added.1 deleted file mode 100644 index 252957564..000000000 --- a/python/.changelog.d/1430.added.1 +++ /dev/null @@ -1 +0,0 @@ -Add press_info() to DebugLink. diff --git a/python/.changelog.d/1970.added b/python/.changelog.d/1970.added deleted file mode 100644 index d091c6d5e..000000000 --- a/python/.changelog.d/1970.added +++ /dev/null @@ -1 +0,0 @@ -Add support for blind EIP-712 signing for Trezor One diff --git a/python/.changelog.d/2023.added b/python/.changelog.d/2023.added deleted file mode 100644 index 052d16562..000000000 --- a/python/.changelog.d/2023.added +++ /dev/null @@ -1 +0,0 @@ -Add ScriptUI for trezorctl, spawned by --script option diff --git a/python/.changelog.d/2036.fixed b/python/.changelog.d/2036.fixed deleted file mode 100644 index 16f663897..000000000 --- a/python/.changelog.d/2036.fixed +++ /dev/null @@ -1,2 +0,0 @@ -Allow passing empty `message_hash` for domain-only EIP-712 hashes -for Trezor T1 (i.e. when `primaryType`=`EIP712Domain`) diff --git a/python/.changelog.d/2093.added b/python/.changelog.d/2093.added deleted file mode 100644 index 958e24a1a..000000000 --- a/python/.changelog.d/2093.added +++ /dev/null @@ -1 +0,0 @@ -Support T1 screenshot saving in Debuglink diff --git a/python/.changelog.d/2100.added b/python/.changelog.d/2100.added deleted file mode 100644 index 554cbdad7..000000000 --- a/python/.changelog.d/2100.added +++ /dev/null @@ -1 +0,0 @@ -Support generating Electrum-compatible message signatures in CLI. diff --git a/python/.changelog.d/2114.added b/python/.changelog.d/2114.added deleted file mode 100644 index b2a06f4c0..000000000 --- a/python/.changelog.d/2114.added +++ /dev/null @@ -1 +0,0 @@ -Support Cardano Alonzo-era transaction items and --include-network-id flag diff --git a/python/.changelog.d/2123.changed b/python/.changelog.d/2123.changed deleted file mode 100644 index 49c572431..000000000 --- a/python/.changelog.d/2123.changed +++ /dev/null @@ -1 +0,0 @@ -Unify boolean arguments/options in trezorlib commands to on/off diff --git a/python/.changelog.d/2126.changed b/python/.changelog.d/2126.changed deleted file mode 100644 index 6ea3e552a..000000000 --- a/python/.changelog.d/2126.changed +++ /dev/null @@ -1 +0,0 @@ -Rename `normalize_nfc` to `prepare_message_bytes` in tools.py diff --git a/python/.changelog.d/2135.fixed b/python/.changelog.d/2135.fixed deleted file mode 100644 index 8c6563f4f..000000000 --- a/python/.changelog.d/2135.fixed +++ /dev/null @@ -1 +0,0 @@ -Fixed error when printing protobuf message with a missing required field. diff --git a/python/.changelog.d/2159.added b/python/.changelog.d/2159.added deleted file mode 100644 index 1db07480a..000000000 --- a/python/.changelog.d/2159.added +++ /dev/null @@ -1 +0,0 @@ -trezorctl: Bitcoin commands can detect script type from derivation path. diff --git a/python/.changelog.d/2199.fixed b/python/.changelog.d/2199.fixed deleted file mode 100644 index a70064110..000000000 --- a/python/.changelog.d/2199.fixed +++ /dev/null @@ -1 +0,0 @@ -Add compatibility with Click 8.1 diff --git a/python/.changelog.d/2219.changed b/python/.changelog.d/2219.changed deleted file mode 100644 index 6aa229ee3..000000000 --- a/python/.changelog.d/2219.changed +++ /dev/null @@ -1 +0,0 @@ -`trezorctl monero` network type arguments now accept symbolic names instead of numbers. diff --git a/python/.changelog.d/2230.added b/python/.changelog.d/2230.added deleted file mode 100644 index 55a400fc7..000000000 --- a/python/.changelog.d/2230.added +++ /dev/null @@ -1 +0,0 @@ -Add support for model R diff --git a/python/.changelog.d/2239.added b/python/.changelog.d/2239.added deleted file mode 100644 index 960c17ff3..000000000 --- a/python/.changelog.d/2239.added +++ /dev/null @@ -1 +0,0 @@ -Add firmware get-hash command. diff --git a/python/.changelog.d/2284.added b/python/.changelog.d/2284.added deleted file mode 100644 index d6fbe284e..000000000 --- a/python/.changelog.d/2284.added +++ /dev/null @@ -1 +0,0 @@ -Jump and stay in bootloader from firmware through SVC call reverse trampoline. diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md index 865c0285d..5bace671d 100644 --- a/python/CHANGELOG.md +++ b/python/CHANGELOG.md @@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.13.1] (2022-06-29) +[0.13.1]: https://github.com/trezor/trezor-firmware/compare/python/v0.13.0...python/v0.13.1 + +### Added +- New exception type `DeviceIsBusy` indicates that the device is in use by another process. [#1026] +- Support payment requests and GetNonce command. [#1430] +- Add press_info() to DebugLink. [#1430] +- Add support for blind EIP-712 signing for Trezor One [#1970] +- Add ScriptUI for trezorctl, spawned by --script option [#2023] +- Support T1 screenshot saving in Debuglink [#2093] +- Support generating Electrum-compatible message signatures in CLI. [#2100] +- Support Cardano Alonzo-era transaction items and --include-network-id flag [#2114] +- trezorctl: Bitcoin commands can detect script type from derivation path. [#2159] +- Add support for model R [#2230] +- Add firmware get-hash command. [#2239] +- Jump and stay in bootloader from firmware through SVC call reverse trampoline. [#2284] + +### Changed +- Unify boolean arguments/options in trezorlib commands to on/off [#2123] +- Rename `normalize_nfc` to `prepare_message_bytes` in tools.py [#2126] +- `trezorctl monero` network type arguments now accept symbolic names instead of numbers. [#2219] + +### Fixed +- trezorctl will correctly report that device is in use. [#1026] +- Allow passing empty `message_hash` for domain-only EIP-712 hashes + for Trezor T1 (i.e. when `primaryType`=`EIP712Domain`) [#2036] +- Fixed error when printing protobuf message with a missing required field. [#2135] +- Add compatibility with Click 8.1 [#2199] + + ## [0.13.0] - 2021-12-09 [0.13.0]: https://github.com/trezor/trezor-firmware/compare/python/v0.12.4...python/v0.13.0 @@ -564,6 +594,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#379]: https://github.com/trezor/trezor-firmware/pull/379 [#810]: https://github.com/trezor/trezor-firmware/pull/810 [#948]: https://github.com/trezor/trezor-firmware/pull/948 +[#1026]: https://github.com/trezor/trezor-firmware/pull/1026 [#1052]: https://github.com/trezor/trezor-firmware/pull/1052 [#1126]: https://github.com/trezor/trezor-firmware/pull/1126 [#1179]: https://github.com/trezor/trezor-firmware/pull/1179 @@ -576,6 +607,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#1266]: https://github.com/trezor/trezor-firmware/pull/1266 [#1296]: https://github.com/trezor/trezor-firmware/pull/1296 [#1363]: https://github.com/trezor/trezor-firmware/pull/1363 +[#1430]: https://github.com/trezor/trezor-firmware/pull/1430 [#1442]: https://github.com/trezor/trezor-firmware/pull/1442 [#1449]: https://github.com/trezor/trezor-firmware/pull/1449 [#1531]: https://github.com/trezor/trezor-firmware/pull/1531 @@ -602,3 +634,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#1896]: https://github.com/trezor/trezor-firmware/pull/1896 [#1959]: https://github.com/trezor/trezor-firmware/pull/1959 [#1967]: https://github.com/trezor/trezor-firmware/pull/1967 +[#1970]: https://github.com/trezor/trezor-firmware/pull/1970 +[#2023]: https://github.com/trezor/trezor-firmware/pull/2023 +[#2036]: https://github.com/trezor/trezor-firmware/pull/2036 +[#2093]: https://github.com/trezor/trezor-firmware/pull/2093 +[#2100]: https://github.com/trezor/trezor-firmware/pull/2100 +[#2114]: https://github.com/trezor/trezor-firmware/pull/2114 +[#2123]: https://github.com/trezor/trezor-firmware/pull/2123 +[#2126]: https://github.com/trezor/trezor-firmware/pull/2126 +[#2135]: https://github.com/trezor/trezor-firmware/pull/2135 +[#2159]: https://github.com/trezor/trezor-firmware/pull/2159 +[#2199]: https://github.com/trezor/trezor-firmware/pull/2199 +[#2219]: https://github.com/trezor/trezor-firmware/pull/2219 +[#2230]: https://github.com/trezor/trezor-firmware/pull/2230 +[#2239]: https://github.com/trezor/trezor-firmware/pull/2239 +[#2284]: https://github.com/trezor/trezor-firmware/pull/2284 diff --git a/python/README.md b/python/README.md index 42b158e0f..2257acde9 100644 --- a/python/README.md +++ b/python/README.md @@ -9,7 +9,7 @@ See for more information. ## Install -Python Trezor tools require Python 3.5 or higher, and libusb 1.0. The easiest +Python Trezor tools require Python 3.6 or higher, and libusb 1.0. The easiest way to install it is with `pip`. The rest of this guide assumes you have a working `pip`; if not, you can refer to [this guide](https://packaging.python.org/tutorials/installing-packages/). @@ -32,22 +32,12 @@ Current trezorlib version supports Trezor One version 1.8.0 and up, and Trezor T For firmware versions below 1.8.0 and 2.1.0 respectively, the only supported operation is "upgrade firmware". -Trezor One with firmware _older than 1.7.0_ (including firmware-less out-of-the-box -units) will not be recognized, unless you install HIDAPI support (see below). +Trezor One with firmware _older than 1.7.0_ and bootloader _older than 1.6.0_ +(including pre-2021 fresh-out-of-the-box units) will not be recognized, unless +you install HIDAPI support (see below). ### Installation options -* **Firmware-less Trezor One**: If you are setting up a brand new Trezor One without - firmware, you will need HIDAPI support. On Linux, you will need the following packages - (or their equivalents) as prerequisites: `python3-dev`, `cython3`, `libusb-1.0-0-dev`, - `libudev-dev`. - - Install with: - - ```sh - pip3 install trezor[hidapi] - ``` - * **Ethereum**: To support Ethereum signing from command line, additional packages are needed. Install with: @@ -62,6 +52,18 @@ units) will not be recognized, unless you install HIDAPI support (see below). pip3 install trezor[stellar] ``` +* **Firmware-less Trezor One**: If you are setting up a brand new Trezor One + manufactured before 2021 (with pre-installed bootloader older than 1.6.0), you will + need HIDAPI support. On Linux, you will need the following packages (or their + equivalents) as prerequisites: `python3-dev`, `cython3`, `libusb-1.0-0-dev`, + `libudev-dev`. + + Install with: + + ```sh + pip3 install trezor[hidapi] + ``` + To install all three, use `pip3 install trezor[hidapi,ethereum,stellar]`. ### Distro packages diff --git a/python/docs/OPTIONS.rst b/python/docs/OPTIONS.rst index 4db0b9d3e..f35847178 100644 --- a/python/docs/OPTIONS.rst +++ b/python/docs/OPTIONS.rst @@ -30,6 +30,7 @@ on one page here. -v, --verbose Show communication messages. -j, --json Print result as JSON object -P, --passphrase-on-host Enter passphrase on host. + -S, --script Use UI for usage in scripts. -s, --session-id HEX Resume given session ID. --version Show the version and exit. --help Show this message and exit. @@ -210,7 +211,7 @@ Device management commands - setup, recover seed, wipe, etc. reboot-to-bootloader Reboot device into bootloader mode. recover Start safe recovery workflow. sd-protect Secure the device with SD card protection. - self-test Perform a self-test. + self-test Perform a factory self-test. setup Perform device setup and generate new seed. wipe Reset device to factory defaults and remove all private data. @@ -251,12 +252,13 @@ Ethereum commands. --help Show this message and exit. Commands: - get-address Get Ethereum address in hex encoding. - get-public-node Get Ethereum public node of given path. - sign-message Sign message with Ethereum address. - sign-tx Sign (and optionally publish) Ethereum transaction. - sign-typed-data Sign typed data (EIP-712) with Ethereum address. - verify-message Verify message signed with Ethereum address. + get-address Get Ethereum address in hex encoding. + get-public-node Get Ethereum public node of given path. + sign-message Sign message with Ethereum address. + sign-tx Sign (and optionally publish) Ethereum transaction. + sign-typed-data Sign typed data (EIP-712) with Ethereum address. + sign-typed-data-hash Sign hash of typed data (EIP-712) with Ethereum address. + verify-message Verify message signed with Ethereum address. FIDO2, U2F and WebAuthN management commands. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -296,6 +298,8 @@ Firmware commands. Commands: download Download and save the firmware image. + extract Extract the firmware from the device. + get-hash Get a hash of the installed firmware combined with the optional challenge. update Upload new firmware to device. verify Verify the integrity of the firmware data stored in a file.