Skip to content

fix(sdk-coin-flrp): custody wallets no longer require a password#9121

Merged
ArunBala-Bitgo merged 1 commit into
masterfrom
fix/cecho-1451-flrp-custody-wallet-password
Jun 26, 2026
Merged

fix(sdk-coin-flrp): custody wallets no longer require a password#9121
ArunBala-Bitgo merged 1 commit into
masterfrom
fix/cecho-1451-flrp-custody-wallet-password

Conversation

@bitgo-ai-agent-dev

Copy link
Copy Markdown

What

  • Changed Flrp.getDefaultMultisigType() to return multisigTypes.tss (was multisigTypes.onchain)
  • Updated the corresponding unit test assertion in sdk-coin-flrp
  • Added a new test in the bitgo module verifying that FLRP custodial wallet generation succeeds without a passphrase

Why

  • FLRP (Flare P-Chain) is a TSS-only coin: its statics include CoinFeature.TSS and CoinFeature.MPCV2 but not CoinFeature.MULTISIG. The wallet platform also enforces this — it returns "Source FLR P wallet is not MPC (multisigType: onchain)" when an onchain-type FLRP wallet is created.
  • Because getDefaultMultisigType() returned 'onchain', calling generateWallet({ type: 'custodial' }) for FLRP silently defaulted to the onchain-custodial code path, producing a wallet the platform rejects and which could require a passphrase through unexpected signing paths.
  • Returning 'tss' as the default causes generateWallet({ type: 'custodial' }) to route through generateCustodialMpcWallet, which creates the wallet server-side and requires no passphrase — matching the behaviour of sdk-coin-flr (FLR C-Chain), which already works correctly.

Test plan

  • sdk-coin-flrp unit tests: 361 passing (all green)
  • bitgo module — Generate TSS wallet tests: 52 passing (includes new FLRP test)
  • New test: should create a new FLRP TSS custodial wallet without requiring a passphrase

Ticket: CECHO-1451

FLRP (Flare P-Chain) is a TSS-only coin — its statics define CoinFeature.TSS
and CoinFeature.MPCV2 but not CoinFeature.MULTISIG. Custody wallets for FLRP
must therefore be created with multisigType='tss', and signing is handled
server-side with no user key material on the client.

Previously, getDefaultMultisigType() returned 'onchain'. This caused
generateWallet({ type: 'custodial' }) to take the onchain-custodial code path
in wallets.ts (line 548), which creates a wallet object whose multisigType the
platform rejects ("Source FLR P wallet is not MPC (multisigType: onchain)").
Any caller that did pass multisigType:'tss' explicitly would correctly use
generateCustodialMpcWallet (no passphrase), but without a matching default the
omission silently produced a broken wallet.

Fix: return multisigTypes.tss from getDefaultMultisigType(), matching the
behaviour of sdk-coin-flr (FLR C-Chain), which correctly defaults to TSS and
has working custody wallets. With this default, generateWallet({ type:
'custodial' }) for FLRP now routes through generateCustodialMpcWallet, which
creates the wallet server-side and requires no passphrase.

Ticket: CECHO-1451
Session-Id: 7a278a4a-2a01-4004-b7bf-1ec86294141e
Task-Id: f3d71be2-ccd9-4342-a175-d342d5857ebe
@linear-code

linear-code Bot commented Jun 25, 2026

Copy link
Copy Markdown

CECHO-1451

@bitgo-ai-agent-dev bitgo-ai-agent-dev Bot force-pushed the fix/cecho-1451-flrp-custody-wallet-password branch from f91e58f to b73b34e Compare June 25, 2026 16:15
@manojkumar138

Copy link
Copy Markdown
Contributor

@claude please review

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Claude finished @manojkumar138's task —— View job


PR Review: fix(sdk-coin-flrp): custody wallets no longer require a password

Todo List:

  • Read repository setup instructions (CLAUDE.md)
  • Examine the three changed files
  • Analyze the core logic change (onchain → tss)
  • Review test changes and new test coverage
  • Check for potential issues or improvements
  • Provide comprehensive review feedback

✅ Review Summary

This PR successfully addresses the FLRP custody wallet issue by changing the default multisig type from onchain to tss. The changes are minimal, focused, and well-tested.

📋 Code Analysis

Core Change (flrp.ts:70-72)

/** inherited doc */
getDefaultMultisigType(): MultisigType {
  return multisigTypes.tss;  // ← Changed from multisigTypes.onchain
}

✅ Correctness: This change is appropriate because:

  • FLRP includes CoinFeature.TSS and CoinFeature.MPCV2 in its statics
  • FLRP does NOT include CoinFeature.MULTISIG
  • The platform rejects onchain-type FLRP wallets with error: "Source FLR P wallet is not MPC (multisigType: onchain)"

Test Updates

  1. Unit Test Update (flrp.ts:66-68)

    it('should return default multisig type', function () {
      basecoin.getDefaultMultisigType().should.equal('tss');  // ← Updated assertion
    });
  2. New Integration Test (wallets.ts:813-848)

    • Tests custodial wallet generation without passphrase
    • Verifies correct routing through generateCustodialMpcWallet
    • Confirms TSS settings are fetched properly
    • Validates wallet properties match expectations

🔍 Security & Architecture Review

✅ Strengths

  • Minimal surface area: Only changes the essential method
  • Backward compatibility: Existing TSS wallets continue to work
  • Proper test coverage: Both unit and integration tests updated
  • Follows existing patterns: Matches FLR C-Chain implementation
  • Clear reasoning: Well-documented in PR description

✅ Test Quality

  • Comprehensive coverage: Tests both the method change and end-to-end wallet generation
  • Realistic scenarios: Uses actual coin configuration (tflrp)
  • Proper mocking: Correctly mocks TSS settings endpoint
  • Assertion completeness: Verifies all expected wallet properties

🚀 Impact Assessment

Positive Impacts

  • Fixes the root issue: Custodial wallets no longer require unexpected passphrases
  • Consistent behavior: Aligns FLRP P-Chain with FLR C-Chain behavior
  • Platform compatibility: Matches wallet platform expectations
  • User experience: Eliminates confusing passphrase requirements for custodial flows

Risk Assessment

  • Low risk: Change is isolated and well-tested
  • No breaking changes: Existing functionality preserved
  • Clear rollback path: Simple to revert if issues arise

🔧 Recommendations

✅ Code Quality

  • Code follows repository conventions
  • Proper TypeScript types used
  • Conventional commit message format
  • Tests pass according to PR description

💡 Future Considerations

  • Consider documenting this behavior in the coin's README or docs
  • Monitor for any unexpected impacts on existing FLRP wallets

✅ Approval

This PR is approved for merge. The implementation correctly addresses the stated problem with minimal risk and proper test coverage.

Key strengths:

  • Precise problem identification and solution
  • Minimal, focused changes
  • Comprehensive test coverage
  • Clear documentation of reasoning
  • Follows established patterns

The change properly aligns FLRP's default behavior with its platform capabilities and user expectations.


🔗 Job run: https://github.com/BitGo/BitGoJS/actions/runs/12345678
🔗 Branch: fix/cecho-1451-flrp-custody-wallet-password

@manojkumar138 manojkumar138 marked this pull request as ready for review June 26, 2026 04:31
@manojkumar138 manojkumar138 requested review from a team as code owners June 26, 2026 04:31

@manojkumar138 manojkumar138 left a comment

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.

LG

@kisslove-dewangan kisslove-dewangan left a comment

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.

lgtm

@ArunBala-Bitgo ArunBala-Bitgo merged commit c10a5d7 into master Jun 26, 2026
24 checks passed
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.

4 participants