Skip to content

feat(kaspa): surface prev-tx-id mismatch under its own error code#841

Merged
ByteZhang1024 merged 1 commit into
onekeyfrom
feat/kaspa-prev-tx-id-mismatch
Jul 17, 2026
Merged

feat(kaspa): surface prev-tx-id mismatch under its own error code#841
ByteZhang1024 merged 1 commit into
onekeyfrom
feat/kaspa-prev-tx-id-mismatch

Conversation

@ByteZhang1024

Copy link
Copy Markdown
Contributor

The device recomputes each spent input's previous-transaction id from the refTxs the caller supplies and refuses to sign when it doesn't match the outpoint. The kaspa REST source that refTxs are built from omits some consensus fields (lockTime, per-input sequence), so they get defaulted and can be wrong, which surfaced only as a generic RuntimeError carrying the firmware's raw text.

Map that rejection to KaspaPrevTxIdMismatch (829) so the caller can act on it — rebuild the refTxs, or let the user confirm signing without on-device verification — instead of matching an English firmware string itself. The SDK deliberately does not retry without refTxs: dropping on-device input verification is the caller's decision to make, not a silent downgrade.

Scoped to the streaming flow, the only path that sends refTxs; legacy blind signing never requests a previous transaction. Only the mismatch text gets the new code — user cancellation and every other device error pass through untouched.

The device recomputes each spent input's previous-transaction id from the
refTxs the caller supplies and refuses to sign when it doesn't match the
outpoint. The kaspa REST source that refTxs are built from omits some
consensus fields (lockTime, per-input sequence), so they get defaulted and
can be wrong, which surfaced only as a generic RuntimeError carrying the
firmware's raw text.

Map that rejection to KaspaPrevTxIdMismatch (829) so the caller can act on
it — rebuild the refTxs, or let the user confirm signing without on-device
verification — instead of matching an English firmware string itself. The
SDK deliberately does not retry without refTxs: dropping on-device input
verification is the caller's decision to make, not a silent downgrade.

Scoped to the streaming flow, the only path that sends refTxs; legacy blind
signing never requests a previous transaction. Only the mismatch text gets
the new code — user cancellation and every other device error pass through
untouched.
@ByteZhang1024
ByteZhang1024 merged commit 3a4f979 into onekey Jul 17, 2026
11 checks passed
@ByteZhang1024
ByteZhang1024 deleted the feat/kaspa-prev-tx-id-mismatch branch July 17, 2026 08:57
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