Repository navigation
feat(keyring-eth-money-mpc): add read-only mode for clients without MFA - #722
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
matthiasgeihs
marked this pull request as ready for review
December 1, 2026 11:09
ccharly
reviewed
Dec 1, 2026
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Co-authored-by: Cursor <cursoragent@cursor.com>
ccharly
previously approved these changes
Dec 1, 2026
…g-read-only Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # packages/keyring-eth-money-mpc/CHANGELOG.md
ccharly
approved these changes
Dec 1, 2026
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.
Today the extension can still instantiate the MPC money keyring, which means 2FA can be triggered even where the client doesn't support MFA. Following the Slack discussion, the client now tells the keyring whether MFA is available, and without it the keyring only exposes the account address.
The keyring takes a required
isMfaAvailableoption, derived from the client's MFA feature flag.With
isMfaAvailable: false(read-only):setupcallscheck-key-sharewith a profile token without 2FA and stores only the address derived from the returnedpublicKey. No relayer session, key share or mnemonic is involved.setupthrows when the profile has no active key. The backend returns the public key of the latest share, which may be pending, so it's only trusted together with anactiveEpoch. A pending share without an active epoch comes from an unfinished create, and a pending rotation keeps the public key.rotateKeyShares,checkKeyShareandsyncKeySharethrow before any network call.methodslist.Migrating from read-only to read/write: a keyring constructed with
isMfaAvailable: truethat loads an address-only state keeps returning the address, throws on signing untilsetupruns, and then imports the key share with 2FA. Import throws if the imported address differs from the stored one. The V2createAccountsnow always runs the innersetup(a no-op once set up) so this path is reachable.Depends on consensys-vertical-apps/va-mmcx-mpc-service-api#106, which adds
publicKeyto thecheck-key-shareresponse. Until that ships, read-onlysetupthrows "no MPC key for this profile".Examples
Clients construct the keyring with
new MpcMoneyKeyring({ ...opts, isMfaAvailable }), whereisMfaAvailablecomes from the MFA feature flag.