Skip to content

feat(signer-trezor): add TrezorTestnet derivation path preset - #4148

Open
mehmetkr-31 wants to merge 2 commits into
alloy-rs:mainfrom
mehmetkr-31:feat/trezor-derivation-testnet
Open

feat(signer-trezor): add TrezorTestnet derivation path preset#4148
mehmetkr-31 wants to merge 2 commits into
alloy-rs:mainfrom
mehmetkr-31:feat/trezor-derivation-testnet

Conversation

@mehmetkr-31

Copy link
Copy Markdown

Motivation

Closes #4140.

Trezor Suite previously used the testnet derivation path m/44'/1'/0'/0/<index> (coin type 1) for testnets like Sepolia, Goerli, and Holesky. While Trezor Suite recently updated Sepolia to use the standard Ethereum coin type (m/44'/60'/0'/0/<index>), previously created and funded accounts on the testnet path should still be easily accessible via a first-class derivation preset.

Solution

  1. Add DerivationType::TrezorTestnet(usize) corresponding to m/44'/1'/0'/0/<index> to alloy-signer-trezor.
  2. Derive PartialEq, Eq on DerivationType to align with alloy-signer-ledger.
  3. Add unit tests for DerivationType display formatting and TrezorSigner::convert_path BIP32 path derivation.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment thread crates/signer-trezor/src/types.rs Outdated
/// Formerly used by Trezor Suite for testnets (e.g. Sepolia, Goerli, Holesky).
/// Note: Trezor Suite now defaults Sepolia to the standard Ethereum path `m/44'/60'/0'/0/<index>`,
/// but accounts previously created with the testnet path use this derivation.
TrezorTestnet(usize),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe also call it TrezorLegacyTestnet and remove second part of the comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done in d624c33 — renamed to TrezorLegacyTestnet and updated the doc comment. Thanks!

Address review feedback from @53gur0:
- Rename DerivationType::TrezorTestnet to DerivationType::TrezorLegacyTestnet
- Simplify doc comment to focus on legacy testnet derivation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Update Trezor derivation paths

2 participants