Skip to content

feat(thorchain): any-denom MsgSend (TCY/RUJI) + refactor(eip712): eth-sig-util→eip-712#48

Merged
BitHighlander merged 2 commits into
masterfrom
fix/thorchain-any-denom
Jun 27, 2026
Merged

feat(thorchain): any-denom MsgSend (TCY/RUJI) + refactor(eip712): eth-sig-util→eip-712#48
BitHighlander merged 2 commits into
masterfrom
fix/thorchain-any-denom

Conversation

@BitHighlander

@BitHighlander BitHighlander commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Two ff-only commits on top of master (c5a4d79):

1. e39ff8c — feat(thorchain): allow any denom in MsgSend (TCY, RUJI, secured assets) — forwards non-rune denoms via ThorchainMsgSend.denom (device-protocol 7.16.0+). Verified live: TCY→RUJI mainnet swap signed + broadcast.

2. 25db446 — refactor(eip712): replace @metamask/eth-sig-util with eip-712 — ethSignTypedData used eth-sig-util only for TypedDataUtils.hashStruct (domain separator + message hash → firmware). eip-712.getStructHash is a byte-identical V4 replacement (verified across nested structs, V4 struct arrays, real Permit2) and hdwallet-core already depends on it. Drops @metamask/eth-sig-util + @metamask/utils (2.8MB) + its nested @ethereumjs@4 chain (a Windows MAX_PATH deep-path offender) + a redundant second EIP-712 lib. Top-level @ethereumjs@3 (tx signing) untouched. Signatures unchanged. Adds a known-answer regression test.

Pinned by keepkey-vault feature-ruji (PR #292).

Drop the hardcoded `denom !== 'rune'` rejection in the keepkey MsgSend
signer and forward non-rune denoms to the device via the
ThorchainMsgSend.denom proto field (device-protocol 7.16.0+).

Firmware defaults an unset denom to 'rune', so denom is only set when it
differs — existing RUNE sends keep byte-identical proto/signatures. TCY,
RUJI/Rujira and secured assets (e.g. btc-btc) now sign as MsgSend.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hdwallet-sandbox Ready Ready Preview, Comment Jun 27, 2026 12:06am

Request Review

@BitHighlander BitHighlander changed the title feat(thorchain): allow any denom in MsgSend (TCY, RUJI, secured assets) feat(thorchain): any-denom MsgSend (TCY/RUJI) + refactor(eip712): eth-sig-util→eip-712 Jun 26, 2026
…uct hashing

ethSignTypedData used @metamask/eth-sig-util's TypedDataUtils.hashStruct only
to compute the domain separator + message hash sent to the firmware (one
import, two call sites). eip-712's getStructHash is a byte-identical V4
replacement — verified across nested structs, V4 struct arrays (the one
V3/V4 divergence) and the real Permit2 payload — and hdwallet-core already
depends on eip-712.

Drops @metamask/eth-sig-util + @metamask/utils (2.8MB) + its NESTED
@ethereumjs@4/common chain (a Windows MAX_PATH deep-path offender) and a
redundant second EIP-712 lib. Top-level @ethereumjs@3 (tx signing) is
untouched. Signatures are unchanged (neutral to the open 7.14 EIP-712
signing incident — same hashes as before).

Adds a known-answer regression test pinning getStructHash output.
@BitHighlander BitHighlander force-pushed the fix/thorchain-any-denom branch from 25db446 to 91a9e9d Compare June 27, 2026 00:05
@BitHighlander BitHighlander merged commit 67563ba into master Jun 27, 2026
5 checks passed
@BitHighlander BitHighlander deleted the fix/thorchain-any-denom branch June 27, 2026 00:10
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