Skip to content

x/mfa — MFA module

The x/mfa module is the protocol’s on-chain multi-factor authentication layer. Accounts can enroll additional factors, and designated sensitive operations — account recovery among them — must satisfy an on-chain MFA policy before they execute.

Because the policy check happens in the state machine rather than in a client app, MFA cannot be stripped by a malicious interface: a transaction that doesn’t carry the required factors simply fails validation.

The module brings multi-factor authentication into consensus:

  • Factors are chain state. Accounts enroll additional authentication factors against the on-chain account, and the record lives in consensus — not in any single app’s settings.
  • Policy names the operations. Chain configuration designates which operations demand MFA, so higher-risk actions such as account recovery require satisfying the on-chain policy before they execute.
  • Clients cannot strip it. Because the check happens in the state machine rather than in a client app, MFA cannot be stripped by a malicious interface: a transaction that doesn’t carry the required factors simply fails validation.

Key compromise is the dominant failure mode of blockchain accounts. For a chain that carries identity records and payment streams, single-signature security is not enough — MFA enforced by the protocol itself closes the gap between wallet security and account security.

ConceptDefinition
Factor enrollmentRegistering an additional authentication factor against an on-chain account.
Step-up authenticationRequiring stronger factors for higher-risk operations like recovery.
  1. Enroll — Register factors. Additional authentication factors are enrolled against the on-chain account.
  2. Govern — Policy names operations. Chain configuration designates which operations demand MFA — recovery, privileged roles, and their kin.
  3. Step up — Sensitive flows challenge. High-risk operations require satisfying the on-chain policy before they execute.
  4. Fail closed — Missing factors fail. Non-compliant transactions fail validation regardless of which client submitted them.
MessagePurpose
MsgEnrollFactorEnrolls an additional authentication factor for an account.
MsgRevokeFactorRevokes a previously enrolled factor.
MsgCreateChallengeCreates an MFA challenge for a sensitive operation.
MsgVerifyChallengeSubmits the response that satisfies a challenge.
MsgIssueSessionIssues an authorization session after successful verification.
MsgRefreshSessionRefreshes an existing authorization session.
MsgRevokeSessionRevokes an authorization session.
MsgAddTrustedDeviceRegisters a trusted device for an account.
MsgRemoveTrustedDeviceRemoves a trusted device from an account.
MsgSetMFAPolicySets which operations demand MFA under the on-chain policy.
MsgUpdateSensitiveTxConfigUpdates configuration for designated sensitive transactions.
QueryPurpose
FactorEnrollment / FactorEnrollmentsOne factor enrollment, or all enrollments for lookup.
Challenge / PendingChallengesOne MFA challenge, or challenges still awaiting verification.
AuthorizationSession / AuthorizationSessionsOne authorization session, or active sessions as a list.
TrustedDevice / TrustedDevicesOne trusted device, or the trusted device set.
MFAPolicyThe current on-chain MFA policy.
MFARequiredWhether a given operation currently requires MFA.
SensitiveTxConfig / AllSensitiveTxConfigsSensitive transaction configuration, individually and as a list.
ParamsCurrent module parameters.
ModuleHow they interact
x/veidMFA layers on VEID identity for step-up verification on sensitive flows.
x/rolesRole-holding accounts can be required to authenticate with additional factors.
x/configWhich operations demand MFA is governed chain configuration.

Why put MFA on-chain instead of in wallets?

Section titled “Why put MFA on-chain instead of in wallets?”

Key compromise is the dominant account failure mode, and for a chain carrying identity records and payment streams, single-signature security is not enough. Protocol-enforced factors close the gap between wallet security and account security.

Requiring stronger factors for higher-risk operations like account recovery — the policy escalates with the stakes of the action.

MFA layers on VEID identity for step-up verification on sensitive flows, and privileged role-holding accounts can be required to carry stronger authentication. See the x/veid module.