Skip to content

Feat/kaspa tx parse#839

Merged
ByteZhang1024 merged 5 commits into
onekeyfrom
feat/kaspa-tx-parse
Jul 16, 2026
Merged

Feat/kaspa tx parse#839
ByteZhang1024 merged 5 commits into
onekeyfrom
feat/kaspa-tx-parse

Conversation

@ByteZhang1024

Copy link
Copy Markdown
Contributor

No description provided.

- Sync protobuf messages from firmware e6ffa3157: prev-tx request flow
  (KaspaTxAckPrevMeta/PrevInput/PrevOutput, KASPA_TX_PREV_META,
  prev_tx_id on KaspaTxRequest) and required-field tightening.
- Add optional refTxs param; answer device prev-tx requests from it and
  reject them clearly when the referenced tx is missing, instead of
  silently answering with current-tx data.
- Pin TonSignData.timestamp to UintType via protobuf-patches so clean
  regenerations keep the published type (hand-edited in #778).
Absent optional message-type fields are not own properties of the
protobufjs-decoded instance, so messageToJSON recursed into undefined
and threw a raw TypeError. Surfaced by the Kaspa streaming flow: the
device's first KaspaTxRequest legitimately carries no signature yet.
Decode them to null, mirroring the optional primitive-field convention.
Streaming input verification needs the referenced previous transactions;
without refTxs the session would die on the device's first prev-tx
request. Send the plain legacy packet instead when blind signing is
available. A streaming-only tx (payload/gas or no scripts) still
streams — its only chance — and fails clearly if prev txs are requested.

Also condense comments and drop a redundant test case.
Replace `output.script ?? ''` (would silently hash an empty script into the sighash) and `input.output.script!` (crashes with an opaque TypeError) with explicit guards that throw CallMethodInvalidParameter. The supportsLegacy gate already guarantees scripts are present before serialize runs, so this never triggers today; it hardens the invariant against future gate changes.
@ByteZhang1024
ByteZhang1024 enabled auto-merge (squash) July 16, 2026 12:06
@ByteZhang1024
ByteZhang1024 merged commit 0cd0cf4 into onekey Jul 16, 2026
9 checks passed
@ByteZhang1024
ByteZhang1024 deleted the feat/kaspa-tx-parse branch July 16, 2026 12:08
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.

2 participants