feat: stage complete protocol client integration - #59
Draft
BitHighlander wants to merge 21 commits into
Draft
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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>
chore: pin portable canonical device protocol
feat(bitcoin): add KeepKey Taproot host support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This is the full staged hdwallet integration branch for the current client/protocol work:
deviceSignedHash0x0001cleanly skipped by Node WebUSB so HID fallback can handle it@keepkey/device-protocolaliases@bithighlander/device-protocol@7.17.0This 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
@keepkeyscope before upstream protocol merge.The older focused PR failures were also resolved here from their actual GitHub Actions logs:
RippleSignTx.setMemoabsent from the old protocol dependency; present in7.17.0developbaseValidation
yarn install --frozen-lockfileyarn buildyarn lintyarn test --runInBand— 11 suites, 118 tests passedThe 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.