Skip to content

feat(sdk-core): add root-fetch detour in getUserPrv for safe child wallets - #9488

Merged
s84krish merged 1 commit into
masterfrom
sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync
Aug 17, 2026
Merged

feat(sdk-core): add root-fetch detour in getUserPrv for safe child wallets#9488
s84krish merged 1 commit into
masterfrom
sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync

Conversation

@s84krish

@s84krishs84krish commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Ticket: WCN-1200

Summary

  • Enable safe owner signing for child wallets whose user key has no encryptedPrv: fetch the root, decrypt with the safe passphrase, and hardened-derive the child (m/999999'/') via shared safeDerivation.ts.
  • Add a signing-side accessor (resolveSafeOwnerSigningPrv) with fail-closed multisig pub verification against the registered child pub.
  • Wire call sites (getUserPrv, hot-wallet signTransaction, getUserKeyAndSignTssTransaction, pending-approval TSS recreate) without detouring getPrv / getEncryptedUserKeychain (wallet sharing must not receive root material).
  • Preserve sharee and SMC behavior: sharees decrypt their child encryptedPrv as-is; soft deriveKeyWithSeed remains for non-safe SMC only.

Test plan

  • Unit: safe owner root fetch + hardened derive (not soft deriveKeyWithSeed)
  • Unit: pub mismatch aborts locally
  • Unit: sharee path — no root fetch, no soft derive (incl. explicit prv)
  • Unit: SMC coldDerivationSeed still applied for non-safe wallets
  • Unit: fetchRootKeychainForSafeChild rejects non-user root source
  • Unit: signing guards + pending-approval safe path use getUserPrv
  • Confirm wallet-share / getEncryptedUserKeychain still skips for safe owners (no root exposure)
  • E2E multisig send from a safe child (tracked with WCN-1187 / WCN-1206)

@linear-code

Copy link
Copy Markdown
Contributor

WCN-1200

@s84krish
s84krishforce-pushed the sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync branch from ebc1572 to a8653a5CompareAugust 13, 2026 15:34
@s84krish
s84krish marked this pull request as ready for review August 13, 2026 16:18
@s84krish
s84krish requested review from a team as code ownersAugust 13, 2026 16:18
@s84krish
s84krishforce-pushed the sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync branch from a8653a5 to fb3f9e8CompareAugust 13, 2026 17:57
Comment threadmodules/sdk-core/src/bitgo/pendingApproval/pendingApproval.ts Outdated
@s84krish
s84krishforce-pushed the sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync branch 2 times, most recently from 2a91432 to 8850785CompareAugust 14, 2026 16:24
pranavjain97
pranavjain97 previously approved these changes Aug 14, 2026
Comment threadmodules/sdk-core/src/bitgo/wallet/safeKeychain.ts
Comment threadmodules/sdk-core/src/bitgo/wallet/wallet.ts Outdated
@s84krish
s84krishforce-pushed the sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync branch from 8850785 to 82522a1CompareAugust 14, 2026 19:31
@s84krish
s84krishforce-pushed the sibikrishnan/wcn-1200-sdk-multisig-signing-root-fetch-detour-in-getuserprvasync branch from 82522a1 to b767ca2CompareAugust 14, 2026 19:32

@davidkaplanbitgodavidkaplanbitgo 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.

just a nit on a test

Comment threadmodules/sdk-core/test/unit/bitgo/wallet/safeGetUserPrv.ts
@s84krish
s84krish merged commit ce69e00 into masterAug 17, 2026
30 checks passed
Sign up for freeto 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

@s84krish@danielpeng1@pranavjain97@davidkaplanbitgo