Skip to content

Add support for EIP-712 typed hash signatures for non-legacy devices#5286

Closed
mdehoog wants to merge 1 commit intotrezor:mainfrom
mdehoog:typed-hash
Closed

Add support for EIP-712 typed hash signatures for non-legacy devices#5286
mdehoog wants to merge 1 commit intotrezor:mainfrom
mdehoog:typed-hash

Conversation

@mdehoog
Copy link
Copy Markdown

@mdehoog mdehoog commented Jul 2, 2025

Fixes #5294, please see that issue for a more detailed rationale for this PR.

Screenshot 2025-07-02 at 2 57 15 PM Screenshot 2025-07-02 at 2 57 24 PM Screenshot 2025-07-02 at 2 57 31 PM Screenshot 2025-07-02 at 2 57 41 PM

#1835 added support for signing EIP-712 data payloads for Trezor T, but without support for signing EIP-712 data hashes.
#1970 added support for signing EIP-712 hashes for legacy Trezors, but not for newer models.

This PR adds support for signing data hashes to newer devices. This is useful for signing EIP-712 hashes directly, for example for (Gnosis) Safe signatures.

Context: we maintain https://github.com/base/eip712sign for signing typed hashes with hardware devices. We recently started work on adding Trezor support (see base/eip712sign#19).

@mdehoog mdehoog requested review from matejcik and prusnak as code owners July 2, 2025 05:07
"ethereum__title_confirm_message": "Confirm message",
"ethereum__title_confirm_struct": "Confirm struct",
"ethereum__title_confirm_typed_data": "Confirm typed data",
"ethereum__title_confirm_typed_hashes": "Confirm typed hashes",
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.

could alternatively remove this and just reuse ethereum__title_confirm_typed_data

@matejcik
Copy link
Copy Markdown
Contributor

matejcik commented Jul 2, 2025

This is useful for signing EIP-712 hashes where the data / domain cannot be customized, like for (Gnosis) Safe signatures.

i have no idea what that means. how can you not customize data/domain in an EIP712 payload?

This PR adds support for signing data hashes to newer devices.

absent a very good rationale, we don't want to introduce blind-signing unknown EIP712 payloads

@mdehoog
Copy link
Copy Markdown
Author

mdehoog commented Jul 3, 2025

@matejcik thanks very much for your reply... and apologies for not including a good rationale. I've opened #5294 which explains our use case better.

This is useful for signing EIP-712 hashes where the data / domain cannot be customized, like for (Gnosis) Safe signatures.

i have no idea what that means. how can you not customize data/domain in an EIP712 payload?

I incorrectly assumed we couldn't send domain separators that were compatible with Safe's transaction hash using the existing typed data struct messages; please ignore this comment (I've removed it from the PR text).

@mdehoog
Copy link
Copy Markdown
Author

mdehoog commented Jul 12, 2025

Replaced by #5344

@mdehoog mdehoog closed this Jul 12, 2025
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.

Add support for EthereumSignTypedHash to new firmware

2 participants