AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 27 Bitcoin

refactor(core): digest EIP-1559/EIP-7702 magic without RLP encoding

Public commit record

What the developer wrote

Authored by Roman Zeyde

93/100 · Strong
refactor(core): digest EIP-1559/EIP-7702 magic without RLP encoding

The [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702#behavior) spec defines the hashing process as:
```
msg = keccak(MAGIC || rlp([chain_id, address, nonce]))
```

It would make more sense to use `sha.append(_MAGIC)` --- this way we do not need to rely on the assumption that RLP encodes small integers to their byte representation.

Note that the same goes for [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559#specification):
```
keccak256(0x02 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list]))
```

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit is a small internal cleanup in Trezor's Ethereum signing code. It changes how two special 'magic' bytes (the transaction type markers for newer Ethereum transaction formats) are fed into the cryptographic hash. Previously the code used the general RLP encoder to write the single-byte marker; now it appends the raw byte directly. The commit message says this avoids relying on the assumption that RLP encodes small integers as a single byte. There is no direct evidence in the commit or supplied references that this fixes an exploitable vulnerability, but it removes a fragile assumption in security-critical hashing code.

Recommended action

Treat as a low-risk hardening change. Reviewers should verify that `sha.append(_MAGIC)` and `sha.append(_TX_TYPE)` produce exactly the same byte sequence as the previous RLP-based approach for the valid input ranges used by Trezor, and that no other code paths rely on the old `_MAGIC` byte-string type. No urgent user action is indicated by the available materials.

Security signals we found

01

Refactor of cryptographic hashing path for Ethereum transaction signing

02

Removal of implicit assumption that RLP encodes small integers as single bytes

03

Change affects EIP-1559 and EIP-7702 transaction type markers

04

No changelog entry; commit is labeled as refactor

05

No explicit vulnerability disclosure or CVE referenced in commit or supplied materials

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 5/15
Confidence 7/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.