feat(sdk-core): getUserAndBackupSession + createKeychains retrofit wiring - #9482
Draft
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
Contributor
ralph-bitgo
Bot
force-pushed
the
WCI-1264-getUserAndBackupSession-createKeychains-retrofit
branch
from
August 12, 2026 08:49
800cab5 to
b1cb0e7
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1264-getUserAndBackupSession-createKeychains-retrofit
branch
from
August 12, 2026 09:38
b1cb0e7 to
6c7bcfa
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1264-getUserAndBackupSession-createKeychains-retrofit
branch
from
August 12, 2026 09:38
6c7bcfa to
47cfe16
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 12, 2026 10:53
cf3cb10 to
b5193dd
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 12, 2026 10:53
b5193dd to
fdf95f7
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 06:27
fdf95f7 to
d219ede
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 06:27
d219ede to
ce90652
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 07:24
58ebac8 to
8d67c7c
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 07:24
8d67c7c to
4055fe5
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 10:16
20b67fd to
9ade6eb
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
from
August 13, 2026 10:16
9ade6eb to
61fb76a
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1261-EddsaRetrofitData-DKG-constructor
branch
2 times, most recently
from
August 13, 2026 14:30
20a5005 to
6117b6d
Compare
…ring Wire the retrofit path into EddsaMPCv2Utils.createKeychains(). When a retrofit payload is supplied, getUserAndBackupSession() initialises user and backup DKG sessions with EddsaRetrofitData (via getMpcV2RetrofitDataFromMpcV1Keys) instead of fresh randomness. The R1 request body includes walletId so the server-side isRound1RetrofitDKG() detection kicks in. Changes: - Add retrofit?: DecryptedRetrofitPayload to createKeychains() params - Add private async getUserAndBackupSession() that branches on retrofit - Replace inline DKG construction with getUserAndBackupSession() call - Extend sendKeyGenerationRound1/BySender payload type to allow walletId - Spread walletId into R1 payload when retrofit.walletId is present - Tests for getUserAndBackupSession (no-retrofit and retrofit paths) and for walletId presence/absence in the captured R1 payload Follows the same pattern as ecdsaMPCv2.ts getUserAndBackupSession (line 639) and the walletId spread (line 126-129). Ticket: WCI-1264 Session-Id: 597157b8-fee3-4515-b21b-4030e08362e8 Task-Id: 15dfe9c9-d429-4559-b0fc-771ada5e3c3a
bitgo-ai-agent-dev
Bot
force-pushed
the
WCI-1264-getUserAndBackupSession-createKeychains-retrofit
branch
from
August 13, 2026 14:33
47cfe16 to
5965a4c
Compare
ralph-bitgo
Bot
force-pushed
the
WCI-1264-getUserAndBackupSession-createKeychains-retrofit
branch
from
August 13, 2026 14:33
5965a4c to
007e0c8
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
retrofit?: DecryptedRetrofitPayloadtoEddsaMPCv2Utils.createKeychains()paramsgetUserAndBackupSession(retrofit?)method that branches on the retrofit flag:EddsaRetrofitDatafrom MPCv1 key shares viagetMpcV2RetrofitDataFromMpcV1Keysand constructsDKGinstances with retrofit dataDKGinstances (existing behavior unchanged)new EddsaMPSDkg.DKG(...)calls increateKeychainswithgetUserAndBackupSessionsendKeyGenerationRound1/sendKeyGenerationRound1BySenderpayload types to allowwalletId?: stringwalletIdinto the R1 request body whenparams.retrofit?.walletIdis present, so server-sideisRound1RetrofitDKG()detection kicks ingetUserAndBackupSession(both paths) and forwalletIdpresence/absence in the captured R1 payloadWhy
walletIdin the R1 payload; without this wiring the server would treat every key-gen as a fresh creationecdsaMPCv2.ts(line 639getUserAndBackupSession, line 126-129walletIdspread)Test plan
EddsaMPCv2Utils.getUserAndBackupSession— returns plain DKG sessions when retrofit is undefinedEddsaMPCv2Utils.getUserAndBackupSession— returns retrofit-seeded DKG sessions when retrofit payload is suppliedEddsaMPCv2Utils.createKeychains with retrofit wiring—walletIdpresent in R1 payload when retrofit providedEddsaMPCv2Utils.createKeychains with retrofit wiring—walletIdabsent from R1 payload when no retrofitEddsaMPCv2Utilsunit tests continue to passStack
This PR is part 3 of 3 in a stacked series. Review and merge in order:
EddsaRetrofitDatatype +DKGretrofit constructor +getFirstMessagerouting (base:master)getMpcV2RetrofitDataFromMpcV1Keysfor EdDSA (base:WCI-1261-EddsaRetrofitData-DKG-constructor)getUserAndBackupSession+createKeychainsretrofit wiring (base:WCI-1261-EddsaRetrofitData-DKG-constructor) ← you are hereTicket: WCI-1264