Skip to content

feat: add needsXpubsForColdSigning capability method - #9430

Open
davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-1799-remove-xpubs-from-ovc-transaction-downloads-for-cold-utxo
Open

feat: add needsXpubsForColdSigning capability method#9430
davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-1799-remove-xpubs-from-ovc-transaction-downloads-for-cold-utxo

Conversation

@davidkaplanbitgo

Copy link
Copy Markdown
Contributor

Adds a coin-level capability so callers can check whether a built transaction requires xpubs/derivation paths for cold signing instead of sniffing tx format themselves. PSBT transactions carry BIP-32 derivation info inline, so xpubs are only needed for legacy UTXO txs.

TICKET: WCN-1799

@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

WCN-1799

@davidkaplanbitgo
davidkaplanbitgo marked this pull request as ready for review August 5, 2026 19:35
@davidkaplanbitgo
davidkaplanbitgo requested review from a team as code owners August 5, 2026 19:35
Comment on lines +247 to +255
/**
* Whether xpubs / xpub derivation paths must be included alongside a built
* transaction for cold (offline) signing.
* @param txHex The built transaction, hex-encoded
* @returns {boolean} True if xpubs are required, false otherwise
*/
needsXpubsForColdSigning(txHex: string): boolean {
return true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this necessary to include in baseCoin if its only applicable to abstractUtxoCoin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally could just call this function without needing to also check if it is a UTXO coin

lcovar
lcovar previously approved these changes Aug 5, 2026
@davidkaplanbitgo
davidkaplanbitgo force-pushed the davidkaplan/wcn-1799-remove-xpubs-from-ovc-transaction-downloads-for-cold-utxo branch from 48b4acc to 923e1c6 Compare August 5, 2026 20:33
Adds a coin-level capability so callers can check whether a built
transaction requires xpubs/derivation paths for cold signing instead
of sniffing tx format themselves. PSBT transactions carry BIP-32
derivation info inline, so xpubs are only needed for legacy UTXO txs.

TICKET: WCN-1799
@davidkaplanbitgo
davidkaplanbitgo force-pushed the davidkaplan/wcn-1799-remove-xpubs-from-ovc-transaction-downloads-for-cold-utxo branch from 923e1c6 to f9e5964 Compare August 5, 2026 20:33
* @param keychains The user/backup/bitgo keychains for this wallet, in that order
* @returns The txPrebuild JSON, augmented with `pubs` and `xpubsWithDerivationPath`
*/
prepareColdTransaction<T extends TransactionPrebuild>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the baseCoin need an implementation at all?

This base implementation assumes multisig, but most of our coins are MPC. For the base method I think we can just return back txPrebuild. For coins that actually need this step, they can override the method in their implementation.

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.

3 participants