fix(sdk-coin-xtz): preserve txid when re-parsing signed origination#8664
Merged
zahin-mohammad merged 1 commit intomasterfrom Apr 30, 2026
Merged
Conversation
263bf39 to
8b78899
Compare
The previous initFromSerializedTransaction relied on localForger.parse throwing on signed bytes (unsigned + 64-byte signature) to detect signed input — but the appended signature bytes are sometimes accidentally valid Michelson contents, so parse silently succeeds and the txid is left empty. wallet-platform then fails XTZ wallet creation with "unable to calculate the id of the deployment transaction" and "SendQueue validation failed: txid: Path \`txid\` is required" (COINFLP-116). Detect signed input by stripping the 64-byte suffix, parsing, and verifying the parsed result re-forges to those same bytes — a strict round-trip check rather than relying on parse to throw. Ticket: COINFLP-116 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8b78899 to
0bcfc61
Compare
benkelcher-bitgo
approved these changes
Apr 30, 2026
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.
Summary
Transaction.initFromSerializedTransactionassumedlocalForger.parsewould always throw on signed bytes (unsigned + 64-byte signature) and only computed the txid in the catch branch. Some signature suffixes are accidentally valid Michelson contents, so parse silently succeeds, the try branch runs, and_idis left as''. wallet-platform then fails withunable to calculate the id of the deployment transactionandSendQueue validation failed: txid: Path \txid` is required`.isValidSignaturebranch (which compared raw hex to base58-prefixed signatures) is removed.uint32 BE = 174) that produces a signed origination whose signature suffix parses as valid Michelson. Without the fix,reparsed.id === ''and the originated KT1 address is empty; with the fix the txid round-trips and the address derives correctly.Test plan
yarn unit-testinmodules/sdk-coin-xtz— 107 passing, including the new regression testyarn lintinmodules/sdk-coin-xtz— cleanTicket: COINFLP-116
🤖 Generated with Claude Code