Skip to content

feat(sdk-core): always upgrade to v2 on password change - #9416

Open
pranavjain97 wants to merge 2 commits into
masterfrom
pranavjain/wcn-1814-switch-to-argon2-on-password-change
Open

feat(sdk-core): always upgrade to v2 on password change#9416
pranavjain97 wants to merge 2 commits into
masterfrom
pranavjain/wcn-1814-switch-to-argon2-on-password-change

Conversation

@pranavjain97

@pranavjain97 pranavjain97 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Flip updateSingleKeychainPassword from preserving the source envelope version to always re-encrypting as v2 (Argon2id + AES-256-GCM). A password change is a natural upgrade point — v1 (SJCL) keychains
are transparently promoted; v2 stays v2.

Impact

  • Keychains.updatePassword collects the results and the SDK POSTs them to /user/changepassword (via BitGoAPI.changePassword → sdk-api/src/bitgoAPI.ts:2192), so the new v2 blobs are persisted server-side.
  • Effectively a silent bulk v1→v2 migration for every user who changes their password.
  • No behavior change for v2 users. No breaking API change.

TICKET: WCN-1814

@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

WCN-1814

updateSingleKeychainPassword now always re-encrypts as v2 (Argon2id),
regardless of the source envelope version. A password change is a natural
upgrade point, so v1 (SJCL) keychains are transparently promoted; v2 stays v2.

TICKET: WCN-1814
@pranavjain97
pranavjain97 force-pushed the pranavjain/wcn-1814-switch-to-argon2-on-password-change branch from fb2ce33 to f12d8da Compare August 4, 2026 18:57
Parameterize updateSingleKeychainPassword/updatePassword with an optional
encryptionVersion. Default stays at v2 (from the previous commit), so
callers get the Argon2 upgrade for free. Callers that still need v1
output (the UI until the Sept 15 breaking-change window closes) opt out
with encryptionVersion: 1.

TICKET: WCN-1814

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

CI failures but LGTM

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.

2 participants