Skip to content

feat: stage complete protocol client integration - #59

Draft
BitHighlander wants to merge 21 commits into
masterfrom
feat/clearsign-studio-ironwood
Draft

feat: stage complete protocol client integration#59
BitHighlander wants to merge 21 commits into
masterfrom
feat/clearsign-studio-ironwood

Conversation

@BitHighlander

@BitHighlander BitHighlander commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What changed

This is the full staged hdwallet integration branch for the current client/protocol work:

  • Zcash NU6.3 / Ironwood PCZT metadata and signing flow
  • Clearsign attestor client support
  • Solana KKSOLSC1 instruction-schema forwarding
  • Osmosis supported-denomination forwarding
  • firmware-reported EVM pre-image hash exposed as deviceSignedHash
  • XRP memo forwarding for THORChain swap routing
  • legacy PID 0x0001 cleanly skipped by Node WebUSB so HID fallback can handle it
  • exact published staging package: @keepkey/device-protocol aliases @bithighlander/device-protocol@7.17.0

This integration branch incorporates the focused work from #40, #42, #49, and #58 without carrying their stale base history. Those PRs remain available for focused review; this is the complete staged client pin for Vault.

Why

Vault needs one reviewable hdwallet commit that contains the complete staged protocol client before its submodule pin is advanced. Per the staging SOP, this consumes the BitHighlander npm publication; it does not build protocol source from a Git dependency and does not publish under the canonical @keepkey scope before upstream protocol merge.

The older focused PR failures were also resolved here from their actual GitHub Actions logs:

Validation

  • yarn install --frozen-lockfile
  • yarn build
  • yarn lint
  • yarn test --runInBand — 11 suites, 118 tests passed

The isolated Ironwood flow also has successful hardware/mainnet evidence: tx ac7f54975154f9c242a49fa151bcbc2badbb7591a8877ff9f75dbba305fdf2fd, confirmed in block 3430876.

Draft until this updated complete head receives canonical GitHub Actions and human review.

A schema describes how to read one program instruction — it names no amounts
and no transaction hash, so one signature covers every future call to that
program and the device decodes values from the bytes it signs.

The published @keepkey/device-protocol build predates SolanaSignTx fields 5-7,
so setSchemaPayload() and friends do not exist. Rather than block on a
protocol release, the fields are appended at the wire level: encoded protobuf
fields are order-independent and simply concatenate, so firmware's nanopb
decoder reads them by field number exactly as if the generator had emitted
them. transport.call() only needs serializeBinary(), so a Proxy wrapper adds
the bytes without mutating the original message.

Remove the shim once a device-protocol release ships the generated setters.

Verified on hardware: signer loaded, a Relay deposit signed through decoded
screens, the SAME schema signature reused for a second different transaction,
and an under-covering schema refused rather than blind-signed.
Restore the established @bithighlander/device-protocol npm flow at exact version 7.17.0 and remove the temporary Git dependency source-generation path.
@vercel

vercel Bot commented Jul 31, 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 Aug 3, 2026 4:41am

Request Review

BitHighlander and others added 6 commits July 31, 2026 03:12
…esponse

EthereumSignedTx (KeepKey custom proto) carries an optional `hash` field —
the keccak256 pre-image the firmware actually signed. Until now the SDK
ignored it, so the only way to verify which message bytes the device hashed
was to recover the signer client-side and compare to the expected address.

Surface the hash as `deviceSignedHash` on the returned signed tx so callers
can pin the exact firmware behavior in tests/diagnostics. Older firmware
doesn't populate the field; absence is non-fatal (try/catch, optional).

Motivating use case: EIP-1559 tx hash regression where ethers'
Transaction.from() reconstruction recovers the wrong signer — having the
firmware-reported hash narrows the divergence to RLP construction vs.
signing, instead of guessing.

Non-breaking: purely additive. Existing consumers see the same shape.
…d it

Review feedback on PR #40: the previous commit attached deviceSignedHash via a
local cast in hdwallet-keepkey, but ETHSignedTx in hdwallet-core didn't declare
the field — TypeScript callers couldn't read it without their own cast, which
defeated the diagnostic purpose.

Add deviceSignedHash?: string to ETHSignedTx (optional, KeepKey-only) and drop
the local cast. The shape is identical at runtime; this just makes the field
visible to consumers.
Forward tx.value.memo to the RippleSignTx protobuf message so the firmware
can include it in the XRPL Memos array of the signed transaction.
WebUSB can never serve a 0x0001 device — the TransportDelegate ctor
rejects any non-0x0002 PID with FirmwareUpdateRequired. Matching 0x0001
in the active pair filter only produced a doomed WebUSB attempt and a
misleading 'Firmware 6.1.0 required' error before the caller's HID
fallback. Old devices now skip WebUSB cleanly and pair over HID.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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