feat(sdk-core): pass buildParams in /tx/send for UTXO and account-based coins#8233
Draft
feat(sdk-core): pass buildParams in /tx/send for UTXO and account-based coins#8233
Conversation
Verify that recipients appears at the top level of /tx/send request body for account-based coins (ETH) alongside halfSigned, confirming WP-8014 is covered by the coin-agnostic WP-8015 changes. Tests cover: - recipients at top level with server buildParams (ETH halfSigned) - recipients at top level via selectParams without server buildParams - nonce and other fields from server buildParams at top level WP-8014 TICKET: WP-8015
Contributor
KaustubhPatange
approved these changes
Mar 4, 2026
kaustubhbitgo
previously approved these changes
Mar 4, 2026
…tests Revert the production changes that forwarded server-returned buildParams through the prebuild→sign→send pipeline. Per BitGo security architecture (mutual distrust principle), the SDK must not forward WP-provided data back to WP — a compromised WP could rewrite recipients. Recipients already appear at the top level of /tx/send via selectParams (the user's original params) for both UTXO and account-based coins. New tests verify this existing behavior. WP-8015, WP-8014 TICKET: WP-8015
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
buildParamsfrom/tx/buildresponse through the prebuild→sign→send pipelinebuildParamsfields (e.g.recipients,feeRate,rbfTxIds,maxFee,feeMultiplier,nonce) in the/tx/sendrequest bodyChanges
modules/sdk-core/src/bitgo/wallet/wallet.tsprebuildTransaction(): CapturebuildResponse.buildParamsbeforeObject.assignoverwrites it. Instead of deletingbuildParams, preserve server-validated params (falling back to request params if server doesn't return them).prebuildAndSignTransaction(): After signing, attachbuildParamsfrom the prebuild to the signed transaction result so they flow through tosendMany().sendMany(): DestructurebuildParamsfrom the signed transaction and spread its fields into the final send params. UserselectParamstake precedence over serverbuildParamsfor any overlapping fields.modules/bitgo/test/v2/unit/wallet.tsUTXO coin tests (WP-8015):
prebuildTransactionpreserves server-returnedbuildParamson the resultprebuildTransactionfalls back to request params when server doesn't returnbuildParamssendManyincludesrecipientsfrom serverbuildParamsin/tx/sendrequestsendManyincludes RBF fields (rbfTxIds,maxFee,feeMultiplier) in/tx/sendrequestsendManyworks when server returns nobuildParams(backwards compat)sendManylets explicit user params override serverbuildParamsAccount-based coin tests (WP-8014):
/tx/sendhas top-levelrecipientsalongsidehalfSignedwith serverbuildParams/tx/sendhas top-levelrecipientsviaselectParamseven without serverbuildParams/tx/sendincludesnonceand other fields from serverbuildParamsat top levelmodules/sdk-coin-eth/test/unit/ethWallet.tsbuildParamson prebuild result (no longer deleted)Test plan
recipientsat top level alongsidehalfSigned/tx/sendrequest body containsrecipientsfor both UTXO and account-based sendMany callsWP-8015, WP-8014