feat: add Ethereum MPC keyring - #627
Conversation
Introduce a 2-party client/server MPC keyring with DKLS23 TSS, cloud backup sync, and vendored MFA wallet libs. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Replaces #440 with a cleaned history rebased onto |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1027e20. Configure here.
| return toEthSig(signature, hash, keyShare.publicKey); | ||
| } catch (error) { | ||
| this.#applyKeyState({ ...state, tssSetup: null }); | ||
| throw error; |
There was a problem hiding this comment.
Sign overwrites concurrent key updates
High Severity
#signHash snapshots #state and later writes that snapshot back with #applyKeyState. rotateKeyShares and syncKeyShare are not on #signQueue, so a rotation or sync that finishes during signing is overwritten with the stale keyShare and backupId, desynchronizing the client from the server.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 1027e20. Configure here.
| ...state, | ||
| keyShare, | ||
| backupId, | ||
| }); |
There was a problem hiding this comment.
Rotation can desynchronize key shares
High Severity
rotateKeyShares commits the new server share in the MPC session before the client persists that share. If storeKeyShareBackup fails afterward, #state still holds the old share while the server has the new one, and neither a retry nor syncKeyShare can repair the mismatch.
Reviewed by Cursor Bugbot for commit 1027e20. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pass convertV so recovery id 27|28 becomes yParity or EIP-155 v. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace backupId with shareEpoch so create/rotate append and activate epochs only after backup readiness, matching the robust MPC architecture. Co-authored-by: Cursor <cursoragent@cursor.com>




Summary
@metamask/eth-mpc-keyring: a 2-party client/server MPC keyring with DKLS23 TSS, cloud backup sync, and vendored MFA wallet libsmainTest plan
yarn workspace @metamask/eth-mpc-keyring testyarn workspace @metamask/eth-mpc-keyring buildMade with Cursor