Skip to content

trezor: support Safe 7#10677

Open
romanz wants to merge 1 commit into
spesmilo:masterfrom
romanz:safe7
Open

trezor: support Safe 7#10677
romanz wants to merge 1 commit into
spesmilo:masterfrom
romanz:safe7

Conversation

@romanz

@romanz romanz commented May 30, 2026

Copy link
Copy Markdown
Contributor

Trezor Safe 7 is using Trezor-Host Protocol, for encrypted and authenticated communication.

Since it requires a pairing process before device features are available, an additional WCTrezorPair wizard step is introduced, allowing the user to enter 6-digit pairing code (as shown on the device).

TODOs:

Comment thread electrum/plugins/trezor/qt.py
Comment thread electrum/plugins/trezor/qt.py Outdated
Comment on lines +954 to +959
if self.wizard_data['wallet_exists']:
next_view = 'trezor_unlock'
else:
next_view = ['trezor_not_initialized', 'trezor_start'][client.features.initialized]

self.wizard_data['_after_pairing'] = next_view

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't determine the next view here. Instead, record state (paired, not paired), and determine next view in the plugin's wizard extension declaration.

@romanz romanz Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, record state (paired, not paired), and determine next view in the plugin's wizard extension declaration.

cff4a65 will keep initialization state in wizard_data['trezor_initialized'] and choose the next view using _after_pairing() callback at TrezorPlugin.

Please let me know if you have meant something else.

@romanz romanz marked this pull request as ready for review June 5, 2026 12:11
@romanz romanz marked this pull request as draft June 5, 2026 12:12
@romanz romanz marked this pull request as ready for review June 12, 2026 07:49
@romanz romanz marked this pull request as draft June 17, 2026 10:10
@romanz romanz marked this pull request as ready for review June 19, 2026 15:58
@romanz

romanz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@SomberNight would it be OK to allow cancellation only for non-THP devices (to avoid bumping trezorlib due to trezor/trezor-firmware#7112)?

Asking since the user can cancel the current flow also from the device itself.

Comment thread electrum/plugins/trezor/clientbase.py Outdated
Comment on lines +376 to +379
def button_request(self, br):
message = self.msg or MESSAGES.get(br.code) or MESSAGES['default']
self.handler.show_message(message.format(self.device), self.client.cancel)
on_cancel = self.transport.interrupt and self.transport.interrupt.request
self.handler.show_message(msg=message.format(self.device), on_cancel=on_cancel)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romanz

would it be OK to allow cancellation only for non-THP devices (to avoid bumping trezorlib due to trezor/trezor-firmware#7112)?

You can disable/hide the cancel functionality if you think that's the most practical approach.
I guess that's better than not having support for a device at all because of something like this :P

Just add a code comment to document the reasoning.

Asking since the user can cancel the current flow also from the device itself.

Was there no way to cancel on-device for the older devices?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there no way to cancel on-device for the older devices?

Yes - older devices also allow the flows to be cancelled via button click / screen touch.

In the worst case, it is also possible to disconnect the device from the host - cancelling the flow by shutting down the device :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trezor Safe 7 is using Trezor-Host Protocol, for encrypted and authenticated communication:
https://docs.trezor.io/trezor-firmware/common/thp/specification.html

Since it requires a pairing process before device features are available,
an additional `WCTrezorPair` wizard step is introduced, allowing the user
to enter 6-digit pairing code (as shown on the device).
@romanz

romanz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Squashed fixups into a single commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants