Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat(keyring-eth-trezor)!: migrate to Trezor Connect 10 - #695

Draft
martykan wants to merge 2 commits into
MetaMask:mainfrom
martykan:feat/trezor-connect-v10
Draft

martykan wants to merge 2 commits into
MetaMask:mainfrom
martykan:feat/trezor-connect-v10

Conversation

@martykan

@martykan martykan commented Nov 4, 2026

Copy link
Copy Markdown

Updates @metamask/eth-trezor-keyring to @trezor/connect-web@^10.0.1. In Connect 10, calls go through Trezor Suite (desktop or web) instead of a self-hosted iframe and popup.

The two commits can be reviewed separately:

1. Migrate to Connect 10

  • TrezorBridge.getPublicKey is renamed to ethereumGetPublicKey, because Connect 10 only allows getPublicKey for bitcoin-like coins.
  • Failed responses are now { success: false, error: { message, code } }, so createErrorFromTrezorResponse and the keyring read error instead of payload.
  • @trezor/connect-web is ESM-only, so TrezorConnectBridge loads it with a dynamic import().
  • The device event listener and the lazyLoad setting are removed. Neither exists in Connect 10, so TrezorConnectBridge.model stays undefined.

2. Remove Connect 9 workarounds

  • @trezor/connect-plugin-ethereum is dropped, because Connect 10 computes the EIP-712 hashes itself. signTypedData still rejects non-V4 data with the same error.
  • The 1-second delay between unlocking and signing is removed. It only avoided overlapping Connect 9 popups.

Breaking changes: TrezorBridge implementations must provide ethereumGetPublicKey. ethereumSignTypedData no longer receives pre-computed hashes. createErrorFromTrezorResponse takes the response error.

martykan and others added 2 commits November 3, 2026 15:46
Bump `@trezor/connect-web` from `^9.6.0` to `^10.0.1`. Connect 10 runs
through Trezor Suite instead of the self-hosted iframe and popup.

- Rename `TrezorBridge.getPublicKey` to `ethereumGetPublicKey`, since
  Connect 10 restricts `getPublicKey` to bitcoin-like coins
- Read unsuccessful responses from `error` (`{ message, code }`) instead
  of `payload`
- Load the ESM-only `@trezor/connect-web` with a dynamic `import()` so it
  works from both the CJS and ESM builds
- Drop the device event listener (`on` throws in Connect 10) and the
  removed `lazyLoad` setting

BREAKING CHANGE: `TrezorBridge` implementations must provide
`ethereumGetPublicKey` instead of `getPublicKey`, and
`createErrorFromTrezorResponse` takes the response `error` instead of
its `payload`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Drop `@trezor/connect-plugin-ethereum`: Connect 10 computes the typed
  data hashes itself, so `TrezorBridge.ethereumSignTypedData` now takes
  `EthereumSignTypedData` params without `domain_separator_hash` and
  `message_hash`
- Reject non-V4 typed data explicitly, which the plugin used to do
- Remove the 1-second delay between unlocking and signing that avoided
  overlapping Connect 9 popups

BREAKING CHANGE: `TrezorBridge.ethereumSignTypedData` no longer receives
pre-computed typed data hashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@socket-security

socket-security Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​trezor/​connect-web@​9.6.1 ⏵ 10.0.1100 +110088 -398 -1100 +10

View full report

@socket-security

socket-security Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Environment variable access: npm @bufbuild/protobuf

Location: Package overview

From: packages/keyring-eth-trezor/package.json → npm/@trezor/connect-web@10.0.1 → npm/@bufbuild/protobuf@2.16.0

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@bufbuild/protobuf@2.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
Environment variable access: npm @bufbuild/protobuf reads BUF_BIGINT_DISABLE

Env Vars: BUF_BIGINT_DISABLE

Location: Package overview

From: packages/keyring-eth-trezor/package.json → npm/@trezor/connect-web@10.0.1 → npm/@bufbuild/protobuf@2.16.0

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@bufbuild/protobuf@2.16.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
Potential code anomaly (AI signal): npm ws is 75.0% likely to have a medium risk anomaly

Notes: The code implements a standard EventTarget-like mixin for wrapping event listeners and dispatching events to user callbacks. There are no suspicious patterns such as dynamic code execution, hardcoded secrets, or network activity. The risk is contingent on what the consumer does inside their handlers; the snippet itself does not introduce malware or data leakage mechanisms beyond normal event dispatch. Overall security risk is low in isolation.

Confidence: 0.75

Severity: 0.50

From: packages/keyring-eth-ledger-bridge/package.json → npm/@ledgerhq/device-signer-kit-ethereum@1.16.0 → npm/@ledgerhq/device-management-kit@1.7.1 → npm/@ledgerhq/context-module@2.3.1 → npm/@trezor/connect-web@10.0.1 → npm/jest-environment-jsdom@29.7.0 → npm/ws@8.22.1

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/ws@8.22.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@martykan
martykan force-pushed the feat/trezor-connect-v10 branch from 72e56ae to c862770 Compare November 4, 2026 15:29

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant