Skip to content

fix: register Ethereum and Tendermint in transport typeRegistry#34

Merged
BitHighlander merged 1 commit intomasterfrom
fix/type-registry-ethereum-zcash
Mar 25, 2026
Merged

fix: register Ethereum and Tendermint in transport typeRegistry#34
BitHighlander merged 1 commit intomasterfrom
fix/type-registry-ethereum-zcash

Conversation

@BitHighlander
Copy link
Collaborator

Summary

  • Add EthereumMessages and TendermintMessages to the transport type registry
  • Fixes ETH signing operations (signTx, signMessage, signTypedData) which silently fail because the transport can't deserialize device responses

Root cause

Same class of bug as #33 (Osmosis/Binance). The Ethereum proto module (messages-ethereum_pb) was imported in ethereum.ts for sending messages but never added to AllMessages in typeRegistry.ts. Device responses (EthereumAddress=57, EthereumTxRequest=59, EthereumMessageSignature=110, EthereumTypedDataSignature=113) couldn't be deserialized — the transport fabricates FAILURE("Unknown message type received").

Why ETH appeared to work

EvmAddressManager.initialize() wraps ethGetAddress() in try { } catch { continue } (evm-addresses.ts:170), silently swallowing the deserialization failure. Addresses load from SQLite cache instead. But signing has no such fallbackethSignTx() fails outright when the device responds with EthereumTxRequest (type 59).

Verified

Built and tested the compiled registry — all response types now resolve:

  57 (EthereumAddress): ✓
  59 (EthereumTxRequest): ✓
  110 (EthereumMessageSignature): ✓
  113 (EthereumTypedDataSignature): ✓
  1001 (TendermintAddress): ✓
  1003 (TendermintMsgRequest): ✓
  1006 (TendermintSignedTx): ✓

Coverage after this PR + #33

All 14 proto modules are now registered:

Module Registration
messages_pb (core) AllMessages (always was)
Binance AllMessages (#33)
Cosmos AllMessages (always was)
EOS AllMessages (always was)
Ethereum AllMessages (this PR)
Mayachain AllMessages (always was)
Nano AllMessages (always was)
Osmosis AllMessages (#33)
Ripple AllMessages (always was)
Tendermint AllMessages (this PR)
Thorchain AllMessages (always was)
Zcash AllMessages (always was)
Solana Self-registers (solana.ts)
TRON Self-registers (tron.ts)
TON Self-registers (ton.ts)

Test plan

  • ethGetAddress() returns address (not FAILURE)
  • ethSignTx() completes signing flow (EthereumTxRequest deserialized)
  • ethSignMessage() returns signature
  • ethSignTypedData() returns signature
  • Existing chains unaffected

…Registry

Ethereum response types (EthereumAddress=57, EthereumTxRequest=59,
EthereumMessageSignature=110, EthereumTypedDataSignature=113) were
never registered in the transport type registry. The device sends
valid responses but the transport can't deserialize them, fabricating
FAILURE("Unknown message type received") instead.

ETH getAddress appeared to work because EvmAddressManager silently
catches the error and falls back to cached addresses. But ETH signing
(signTx, signMessage, signTypedData) has no fallback and is broken.

Also registers Tendermint (1000-1011) for completeness — currently
unused but prevents future gaps.

Same bug class as Osmosis/Binance (fixed in #33).
@vercel
Copy link

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hdwallet-sandbox Ready Ready Preview, Comment Mar 25, 2026 5:45am

Request Review

@BitHighlander BitHighlander merged commit 2a58f8e into master Mar 25, 2026
4 checks passed
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