chore(core): simplify EIP-712 domain confirmation flow
What changed, and why it matters
This commit simplifies how a Trezor hardware wallet asks the user to confirm details when signing Ethereum typed-data messages (EIP-712). Previously, the device first showed only the domain name and version and asked the user to press 'show more' to see the rest; now it always shows all domain fields. The change removes about 50 lines of caching and preview logic. There is no direct evidence in the commit that this fixes a security vulnerability; it reads as a user-interface simplification.
Treat as a benign UX refactor unless additional independent analysis or a vendor advisory identifies a concrete security issue. Reviewers may want to verify that removing the prefetch cache does not change the data fed into the domain hash and that all domain fields are still correctly displayed and confirmed.
Security signals we found
Removes user-controlled 'show more' gate for EIP712Domain fields
Eliminates prefetched/cached domain values that could diverge from later hashing path
Unconditionally displays all EIP712Domain fields during signing
No changelog entry and commit is tagged as chore
Evidence from the diff
The patch removes the should_show_domain helper and the _get_name_and_version_for_domain prefetch/caching logic from the Ethereum EIP-712 signing path. Instead of conditionally streaming the full EIP712Domain based on a user prompt, hash_struct is now called with show_data=True unconditionally. The prefetched_eip712_values dictionary is also removed. The test input flow is updated to remove the extra ‘show more’ confirmation step for the domain. The commit message frames this as a simplification, not a security fix.
Changed components
core/src/apps/ethereum/layout.pycore/src/apps/ethereum/sign_typed_data.pytests/input_flows.pyInspect captured patch +2 / −56
diff --git a/core/src/apps/ethereum/layout.py b/core/src/apps/ethereum/layout.py
index 32a7352f..9cf5d3f8 100644
--- a/core/src/apps/ethereum/layout.py
+++ b/core/src/apps/ethereum/layout.py
@@ -456,23 +456,6 @@ def confirm_empty_typed_message() -> Awaitable[None]:
)
-async def should_show_domain(name: AnyBytes, version: AnyBytes) -> bool:
- domain_name = decode_typed_data(name, "string")
- domain_version = decode_typed_data(version, "string")
-
- para = (
- (TR.ethereum__name_and_version, False),
- (domain_name, False),
- (domain_version, False),
- )
- return await should_show_more(
- TR.ethereum__title_confirm_domain,
- para,
- TR.ethereum__show_full_domain,
- "should_show_domain",
- )
-
-
async def should_show_struct(
description: str,
data_members: list[EthereumStructMember],
diff --git a/core/src/apps/ethereum/sign_typed_data.py b/core/src/apps/ethereum/sign_typed_data.py
index 7786c94c..e4f8fa90 100644
--- a/core/src/apps/ethereum/sign_typed_data.py
+++ b/core/src/apps/ethereum/sign_typed_data.py
@@ -83,7 +83,6 @@ async def _generate_typed_data_hash(
confirm_empty_typed_message,
confirm_message_hash,
confirm_typed_data_final,
- should_show_domain,
)
progress_obj = progress(indeterminate=True)
@@ -94,13 +93,10 @@ async def _generate_typed_data_hash(
)
await typed_data_envelope.collect_types(lambda p: progress_obj.report(int(p * 700)))
- name, version = await _get_name_and_version_for_domain(typed_data_envelope)
- show_domain = await should_show_domain(name, version)
-
domain_separator = await typed_data_envelope.hash_struct(
"EIP712Domain",
[0],
- show_domain,
+ True,
["EIP712Domain"],
lambda p: progress_obj.report(700 + int(p * 300)),
)
@@ -153,7 +149,6 @@ class TypedDataEnvelope:
) -> None:
self.primary_type = primary_type
self.metamask_v4_compat = metamask_v4_compat
- self.prefetched_eip712_values: dict[tuple[int, ...], AnyBytes] = {}
self.types: dict[str, EthereumTypedDataStructAck] = {}
async def collect_types(
@@ -379,14 +374,7 @@ class TypedDataEnvelope:
)
w.extend(arr_w.get_digest())
else:
- path_key = tuple(member_value_path)
- if (
- primary_type == "EIP712Domain"
- and path_key in self.prefetched_eip712_values
- ):
- value = self.prefetched_eip712_values[path_key]
- else:
- value = await get_value(field_type, member_value_path)
+ value = await get_value(field_type, member_value_path)
encode_field(w, field_type, value)
if show_data:
await confirm_typed_value(
@@ -563,24 +551,3 @@ async def get_value(
_validate_value(field=field, value=value)
return value
-
-
-async def _get_name_and_version_for_domain(
- typed_data_envelope: TypedDataEnvelope,
-) -> tuple[AnyBytes, AnyBytes]:
- domain_name = b"unknown"
- domain_version = b"unknown"
-
- domain_members = typed_data_envelope.types["EIP712Domain"].members
- member_value_path = [0, 0]
- for member_index, member in enumerate(domain_members):
- member_value_path[-1] = member_index
- if member.name in ("name", "version"):
- value = await get_value(member.type, member_value_path)
- path_key = tuple(member_value_path)
- typed_data_envelope.prefetched_eip712_values[path_key] = value
- if member.name == "name":
- domain_name = value
- elif member.name == "version":
- domain_version = value
- return domain_name, domain_version
diff --git a/tests/input_flows.py b/tests/input_flows.py
index 7de47f7a..bf621836 100644
--- a/tests/input_flows.py
+++ b/tests/input_flows.py
@@ -1643,10 +1643,6 @@ class InputFlowEIP712ShowMore(InputFlowBase):
yield # confirm address
self.debug.press_yes()
- yield # confirm domain
- self.debug.read_layout()
- self._confirm_show_more()
-
# confirm domain properties
for _ in range(4):
yield from swipe_if_necessary(self.debug) # EIP712 DOMAIN
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.