fix(sdk-coin-flr): support FLR C->P atomic TSS signing#9085
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Draft
fix(sdk-coin-flr): support FLR C->P atomic TSS signing#9085bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
FLR C-chain to P-chain export (and the matching P-chain import) fails during the MPC signing ceremony because: 1. sdk-coin-flr does not declare isSignablePreHashed, so the MPCv2 signing flow re-hashes the Avalanche atomic signableHex with keccak256. The signableHex is already SHA-256(txBody), so the user's signature share is computed over a different digest from BitGo's, surfacing as "Failed to combine signature shares" on the send-transaction endpoint. 2. The TSS recipient guard rejects intent types 'import' and 'importtoc' (Avalanche / Flare cross-chain atomic imports), even though those intents legitimately have no client-supplied recipients — the wallet imports its own UTXOs and the destination is the wallet itself. That surfaces as "Recipient details are required to verify this transaction before signing". Add isSignablePreHashed to Flr mirroring the Flrp implementation, and add 'import' / 'importtoc' to NO_RECIPIENT_TX_TYPES so the pre-signing verifier no longer blocks the flow. Ticket: WAL-1586 Session-Id: ed1da302-5a6d-427c-9cc8-9226e355d0ed Task-Id: d6c37b72-82ce-4927-b917-f88212aedf23
baf81ec to
8d4044e
Compare
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
isSignablePreHashedtoFlr(mirrors the existingFlrpimplementation) so the MPCv2 signing flow uses the Avalanche atomicsignableHex(alreadySHA-256(txBody)) directly instead of re-hashing it with keccak256.'import'and'importtoc'intent types toNO_RECIPIENT_TX_TYPESinsdk-coreso the pre-signing recipient guard does not reject Avalanche / Flare cross-chain atomic imports.Why
FLR export from C-Chain to P-Chain (and the subsequent import on FLRP) fails for TSS wallets:
Failed to combine signature shares— withoutisSignablePreHashed, the FLR coin falls through to the default DKLS hash path. For the atomic export tx the user signskeccak256(signableHex)while BitGo signssignableHex(already SHA-256 of the tx body), so the two shares cover different digests and never combine.Recipient details are required to verify this transaction before signing. Pass txParams with at least one recipient.— atomic imports legitimately carry no client-supplied recipients (the wallet imports its own UTXOs and the destination is the wallet itself), but the TSS pre-signing guard treated thoseintentTypevalues as missing-recipient errors.Reported by Wallets in WAL-1586 — request ID
bg-uicb6477a974fb49a60869-0008.Test plan
yarn unit-testinmodules/sdk-coin-flr— passes (60 tests, includes newisSignablePreHashedassertions for atomic vs RLP).yarn unit-testinmodules/sdk-core— passes (427 tests, includes new exempt-type assertions forimport/importtoc).yarn unit-testinmodules/sdk-coin-flrp— passes (no regressions).yarn unit-testinmodules/abstract-eth— passes (no regressions).yarn lintin the modified modules — clean.Ticket: WAL-1586