Skip to content

trezor: support Safe 7#10677

Draft
romanz wants to merge 2 commits into
spesmilo:masterfrom
romanz:safe7
Draft

trezor: support Safe 7#10677
romanz wants to merge 2 commits into
spesmilo:masterfrom
romanz:safe7

Conversation

@romanz
Copy link
Copy Markdown
Contributor

@romanz romanz commented May 30, 2026

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:

  • handle pairing failure/cancellation
  • retest on all devices

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).
Comment on lines +928 to +933
class WCTrezorPair(WalletWizardComponent, Logger):
def __init__(self, parent, wizard):
WalletWizardComponent.__init__(self, parent, wizard, title=_('Trezor Pairing'))
Logger.__init__(self)
self.plugins = wizard.plugins
self._busy = True
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.

Since it requires a pairing process before device features are available, an additional WCTrezorPair wizard step is introduced

Oh. So it works differently from the previous devices. In that case I would like to ask for 2 or 3 samples we can use for manual testing in the future when refactoring code. Maybe during btcprague? Then shipping could be avoided.

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.

Copy link
Copy Markdown
Contributor Author

@romanz romanz Jun 5, 2026

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
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