Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

ERC7093 proposes a social recovery mechanism with customizable recovery policies.

This article translates, summarizes, and expands on the following draft specification.

I also cover various EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

ERC7093 defines interfaces for standardizing social recovery in smart contract accounts. Social recovery lets someone who has lost their keys regain access to an account with help from trusted parties. In conventional mechanisms, recovery conditions and identity verification are tightly coupled to the account's smart contract. ERC7093 separates these responsibilities so users can choose and extend recovery policies.

A key concept is the guardian. A guardian is a party or entity that helps recover an account. Guardians need not be limited to blockchain accounts: the design can accommodate off-chain identity verification methods and NFTs, among other options.

This separation lets users change the recovery policy of an existing smart contract account and improve its security using methods suited to their needs.

The main features are summarized below.

Feature Description
Separation of identity verification and recovery Authentication methods and recovery procedures are independent and can be composed more flexibly.
Broad definition of guardians Guardians can include friends or family members without blockchain accounts, NFTs, and SBTs (non-transferable tokens).
Customizable recovery policies Users can configure the number and types of signatures required, among other conditions.
Extensibility without changing the smart contract New policies can be supported without upgrading the account contract itself.
Support for multiple recovery mechanisms Accounts can avoid dependence on a single recovery method and adopt more resilient configurations.

Motivation

Ethereum co-founder Vitalik Buterin has long advocated social recovery. Blockchain users always face the risk of losing their private keys, which can be particularly devastating for people unfamiliar with cryptography. This has created a need for mechanisms that let users regain control of their accounts with assistance from trusted people or services.

The basic social recovery process works as follows.

  1. Verify the identities of the user and the guardians. Guardians are the entities that help recover the account. They can be blockchain accounts, external identity verification services, or tokens, among other possibilities.
  2. Collect signatures or approvals from guardians. When multiple guardians sign, the account can be recovered once the applicable threshold is reached.
  3. Evaluate the types and combinations of signatures. More complex rules can require a particular guardian's signature or multiple signatures from members of a specific group.

In conventional systems, these rules are embedded in the account's smart contract. Supporting a new authentication method therefore requires updating the contract, limiting flexibility.

ERC7093 addresses this problem by separating the following responsibilities.

  • Identity verification (determining whether an entity qualifies as a guardian).
  • Recovery policy (defining signature requirements and thresholds).
  • Execution of the recovery procedure itself.

Making these responsibilities independent allows guardian types and policies to be extended separately. Users can consequently choose from a wider range of options to balance security and convenience.

For example, the design supports the following use cases.

  • Appoint friends or family members as guardians even if they do not have blockchain accounts.
  • Prove an identity using an NFT or SBT that only the account owner can hold.
  • Require one particular party's signature while allowing signatures from multiple other guardians to satisfy another condition.
  • Support new authentication methods without changing the account's smart contract.

In this way, ERC7093 aims to address the limitations of conventional social recovery designs by providing a more flexible and extensible recovery mechanism.

Specification

Four key concepts

ERC7093 defines four main components for implementing social recovery, grouping the account and module alternatives together. Their responsibilities are as follows.

Component Description
Identity Represents a guardian's identity. It includes account-based identities and any other form capable of producing signatures or proofs that can be verified on-chain.
PermissionVerifier Verifies signatures or proofs supplied by guardians. The design accommodates both on-chain and off-chain guardian identities.
RecoveryPolicyVerifier Verifies recovery conditions or policies. Implementations can configure signature thresholds, lock periods, and other conditions.
RecoveryAccount / RecoveryModule Core contracts that execute the account recovery process. The recovery functionality can also be provided through a module, depending on the architecture.

Identity supports a broad range of entities and authentication methods, including the following.

  • EOA / SCA (conventional blockchain accounts)
  • WebAuthn / passkeys
  • Email domain signatures (DKIM)
  • OpenID tokens
  • Zero-knowledge proofs (ZKPs)
  • NFTs / SBTs (non-transferable tokens)
  • Future authentication methods through extensions

This design allows social recovery mechanisms to evolve as new identity verification methods emerge.

DataTypes

Structs

Identity
javascript
struct Identity {
    address guardianVerifier;
    bytes signer;
}

A struct representing a guardian's identity. Identity defines how the guardian is authenticated. When signer is empty, the identity represents an EOA or SCA, and signature verification uses a secure ECDSA or ERC1271 verification mechanism with guardianVerifier as the actual signer. When signer is nonempty, the identity uses a non-account identification method, and verification is delegated through IPermissionVerifier to the contract at guardianVerifier.

Parameters

  • guardianVerifier
    • The guardian's account address for an account-based identity, or the address of the contract that verifies the signature or proof for a non-account identity.
  • signer
    • Guardian identification data. An empty value denotes an EOA or SCA.
GuardianInfo
javascript
struct GuardianInfo {
    Identity guardian;
    uint64 property;
}

A struct representing a guardian's properties. It associates properties with the guardian's identity. The properties are defined by the RecoveryPolicyVerifier and can be interpreted flexibly as weights, percentages, or role-specific weights, for example.

Parameters

  • guardian
    • The Identity representing the guardian.
  • property
    • The guardian's property value.
    • Examples include weights and percentages.
ThresholdConfig
javascript
struct ThresholdConfig {
    uint64 threshold;
    int48 lockPeriod;
}

A struct representing a threshold configuration. It defines the conditions needed for a recovery request. The threshold represents the required accumulated property value, and lockPeriod represents the waiting period before recovery execution.

Parameters

  • threshold
    • Total value required for recovery.
  • lockPeriod
    • Lock period before the recovery can be executed.
RecoveryConfigArg
javascript
struct RecoveryConfigArg {
    address policyVerifier;
    GuardianInfo[] guardianInfos;
    ThresholdConfig[] thresholdConfigs;
}

A struct representing a recovery configuration. An account can have multiple recovery configurations, each combining a guardian list with multiple threshold configurations. The policyVerifier is optional and can be omitted when it is not needed.

Parameters

  • policyVerifier
    • Contract responsible for policy verification.
  • guardianInfos
    • Array of guardian information.
  • thresholdConfigs
    • Array of threshold configurations.
Permission
javascript
struct Permission {
    Identity guardian;
    bytes signature;
}

A struct representing a guardian's signature information. It holds the signature produced by a guardian participating in a recovery request. These permissions are verified by startRecovery, and all supplied signatures must be valid.

Parameters

  • guardian
    • Guardian acting as the signer.
  • signature
    • Guardian's signature data.

IPermissionVerifier

An interface for verifying signatures or proofs from non-account guardians.

It is used when the signer field of an Identity is nonempty. It supports signer format validation and multiple-signature verification, providing a general extension point independent of the specific guardian authentication method.

javascript
/**
 * @dev Interface for no-account type identity signature/proof verification
 */
interface IPermissionVerifier {
    /**
     * @dev Check if the signer key format is correct
     */
    function isValidSigners(bytes[] signers) external returns (bool);

    /**
     * @dev Validate permission
     */
    function isValidPermission(
        bytes32 hash,
        bytes signer,
        bytes signature
    ) external returns (bool);

    /**
     * @dev Validate permissions
     */
    function isValidPermissions(
        bytes32 hash,
        bytes[] signers,
        bytes[] signatures
    ) external returns (bool);

    /**
     * @dev Return supported signer key information, format, signature format, hash algorithm, etc.
     * MAY TODO:using ERC-3668: ccip-read
     */
    function getGuardianVerifierInfo() public view returns (bytes memory);
}

IRecoveryPolicyVerifier

An interface for verifying recovery policies. It evaluates thresholds and guardian properties and returns whether verification succeeds and the accumulated value. The verification also covers conditions such as whether the guardians exist in the registered list and whether duplicate guardians are present.

javascript
/**
 * @dev Interface for recovery policy verification
 */
interface IRecoveryPolicyVerifier {
    /**
     * @dev Verify recovery policy and return verification success and lock period
     * Verification includes checking if guardians exist in the Guardians List
     */
    function verifyRecoveryPolicy( Permission[] memory permissions, uint64[] memory properties)
        external
        view
        returns (bool succ, uint64 weight);

    /**
     * @dev Returns supported policy settings and accompanying property definitions for Guardian.
     */
    function getPolicyVerifierInfo() public view returns (bytes memory);
}

IRecoveryAccount

javascript
interface IRecoveryAccount {
    modifier onlySelf() {
        require(msg.sender == address(this), "onlySelf: NOT_AUTHORIZED");
        _;
    }

    modifier InRecovering(address policyVerifyAddress) {
        (bool isRecovering, ) = getRecoveryStatus(policyVerifierAddress);
        require(isRecovering, "InRecovering: no ongoing recovery");
        _;
    }

    /**
     * @dev Events for updating guardians, starting for recovery, executing recovery, and canceling recovery
     */
    event RecoveryStarted(bytes newOwners, uint256 nonce, uint48 expiryTime);
    event RecoveryExecuted(bytes newOwners, uint256 nonce);
    event RecoveryCanceled(uint256 nonce);

    /**
     * @dev Return the domain separator name and version for signatures
     * Also return the domainSeparator for EIP-712 signature
     */

    /// @notice             Domain separator name for signatures
    function DOMAIN_SEPARATOR_NAME() external view returns (string memory);

    /// @notice             Domain separator version for signatures
    function DOMAIN_SEPARATOR_VERSION() external view returns (string memory);

    /// @notice             returns the domainSeparator for EIP-712 signature
    /// @return             the bytes32 domainSeparator for EIP-712 signature
    function domainSeparatorV4() external view returns (bytes32);

    /**
     * @dev Update /replace guardians and recovery policies
     * Multiple recovery policies can be set using an array of RecoveryConfigArg
     */
    function updateGuardians(RecoveryConfigArg[] recoveryConfigArgs) external onlySelf;

    // Generate EIP-712 message hash,
    // Iterate over signatures for verification,
    // Verify recovery policy,
    // Store temporary state or recover immediately based on the result returned by verifyRecoveryPolicy.
    function startRecovery(
        uint256 configIndex,
        bytes newOwner,
        Permission[] permissions
    ) external;

    /**
     * @dev Execute recovery
     * temporary state -> ownerKey rotation
     */
    function executeRecovery(uint256 configIndex) external;

    function cancelRecovery(uint256 configIndex) external onlySelf InRecovering(policyVerifier);

    function cancelRecoveryByGuardians(uint256 configIndex, Permission[] permissions)
        external
        InRecovering(policyVerifier);

    /**
     * @dev Get wallet recovery config, check if an identity is a guardian, get the nonce of social recovery, and get the recovery status of the wallet
     */
    function isGuardian(uint256 configIndex, identity guardian) public view returns (bool);

    function getRecoveryConfigs() public view returns (RecoveryConfigArg[] recoveryConfigArgs);

    function getRecoveryNonce() public view returns (uint256 nonce);

    function getRecoveryStatus(address policyVerifier) public view returns (bool isRecovering, uint48 expiryTime);
}

Modifiers

onlySelf
javascript
modifier onlySelf() {
    require(msg.sender == address(this), "onlySelf: NOT_AUTHORIZED");
    _;
}

A modifier restricting execution to calls made by the contract itself. It prevents direct external calls and helps avoid unauthorized updates.

InRecovering
javascript
modifier InRecovering(address policyVerifyAddress) {
    (bool isRecovering, ) = getRecoveryStatus(policyVerifierAddress);
    require(isRecovering, "InRecovering: no ongoing recovery");
    _;
}

A modifier restricting execution to an active recovery. It checks whether the account is currently recovering and rejects execution when that state does not match.

Events

RecoveryStarted
javascript
event RecoveryStarted(bytes newOwners, uint256 nonce, uint48 expiryTime);

An event emitted when recovery begins. It reports the proposed new owners, the time at which execution becomes possible, and the recovery nonce.

Parameters

  • newOwners
    • Proposed new owners.
  • nonce
    • Identifier of the recovery operation.
  • expiryTime
    • Time at which recovery can be executed.
RecoveryExecuted
javascript
event RecoveryExecuted(bytes newOwners, uint256 nonce);

An event emitted when recovery is completed. It indicates that the new owners have been established after execution.

Parameters

  • newOwners
    • Owners after the update.
  • nonce
    • Identifier of the corresponding recovery operation.
RecoveryCanceled
javascript
event RecoveryCanceled(uint256 nonce);

An event emitted when recovery is canceled. It indicates that the user or guardians canceled the recovery.

Parameters

  • nonce
    • Identifier of the corresponding recovery operation.

Functions

DOMAIN_SEPARATOR_NAME
javascript
function DOMAIN_SEPARATOR_NAME() external view returns (string memory);

Returns the domain name used for signature verification. It is used to identify the signing domain under EIP712.

For more on EIP712, see the following article.

[EIP712] Hashing and Signing Typed Structured Data

Return value

  • string
    • Domain name.
DOMAIN_SEPARATOR_VERSION
javascript
function DOMAIN_SEPARATOR_VERSION() external view returns (string memory);

Returns the version of the domain used for signature verification. This value helps maintain consistency between the signing and verification domains.

Return value

  • string
    • Version information.
domainSeparatorV4
javascript
function domainSeparatorV4() external view returns (bytes32);

Returns the EIP712 domain separator. The returned identifier is required when computing the signing digest.

Return value

  • bytes32
    • Domain separator.
updateGuardians
javascript
function updateGuardians(RecoveryConfigArg[] recoveryConfigArgs) external onlySelf;

Updates guardians and recovery configurations. Multiple recovery configurations can be registered together.

Arguments

  • recoveryConfigArgs
    • Array of recovery configurations.
startRecovery
javascript
function startRecovery(
    uint256 configIndex,
    bytes newOwner,
    Permission[] permissions
) external;

Starts the recovery process. The function verifies guardian signatures and recovery policy conditions. If the conditions are met, it stores the pending recovery state.

Arguments

  • configIndex
    • Index of the recovery configuration to use.
  • newOwner
    • Proposed new owner.
  • permissions
    • Guardian signature information.
executeRecovery
javascript
function executeRecovery(uint256 configIndex) external;

Finalizes the recovery process. It is executed after the lock period ends and replaces the owner.

Arguments

  • configIndex
    • Index of the corresponding recovery configuration.
cancelRecovery
javascript
function cancelRecovery(uint256 configIndex) external onlySelf InRecovering(policyVerifier);

Cancels the recovery process. It can be executed only by the contract itself and requires an active recovery.

Arguments

  • configIndex
    • Index of the corresponding recovery configuration.
cancelRecoveryByGuardians
javascript
function cancelRecoveryByGuardians(uint256 configIndex, Permission[] permissions)
    external
    InRecovering(policyVerifier);

Lets guardians cancel the recovery process. Cancellation is executed based on guardian signatures.

Arguments

  • configIndex
    • Index of the corresponding recovery configuration.
  • permissions
    • Guardian signature information.
isGuardian
javascript
function isGuardian(uint256 configIndex, identity guardian) public view returns (bool);

Checks whether the specified identity is a guardian. It returns whether the identity is included in the corresponding recovery configuration.

Arguments

  • configIndex
    • Index of the corresponding recovery configuration.
  • guardian
    • Identity to check.

Return value

  • bool
    • Whether the identity is a guardian.
getRecoveryConfigs
javascript
function getRecoveryConfigs() public view returns (RecoveryConfigArg[] recoveryConfigArgs);

Retrieves all recovery configurations. It returns the registered configurations as a list.

Return value

  • recoveryConfigArgs
    • All recovery configuration information.
getRecoveryNonce
javascript
function getRecoveryNonce() public view returns (uint256 nonce);

Retrieves the nonce for recovery operations. This nonce is managed separately from nonces used for asset operations.

Return value

  • nonce
    • Identifier of the recovery operation.
getRecoveryStatus
javascript
function getRecoveryStatus(address policyVerifier) public view returns (bool isRecovering, uint48 expiryTime);

Retrieves the recovery status. It returns the current recovery state and the time at which recovery can be executed.

Arguments

  • policyVerifier
    • Address of the corresponding policy verifier.

Return values

  • isRecovering
    • Whether recovery is in progress.
  • expiryTime
    • Time at which recovery can be executed.

Recovery Account Workflow

The following is an example of a recovery workflow.

  1. The user registers guardians and threshold configurations.
  2. Guardians review the EIP712 signing data and generate signatures.
  3. A bundler or relayer executes startRecovery.
  4. The account verifies the signatures and recovery policy.
  5. If the conditions are met, the pending recovery state is stored.
  6. After the lock period, executeRecovery is executed and the account owner is updated.

Additional considerations

Supporting different guardians and flexible recovery policies

ERC7093 is designed to accommodate a wider range of guardian types and enable flexible recovery policies. It separates the recovery process from verification logic. This lets implementations add or extend mechanisms without changing the account's core logic.

In conventional smart contract accounts, introducing a new authentication method could require upgrading the account contract. Moving verification logic to external components makes it possible to support new guardian types and authentication mechanisms without modifying the account itself.

Why verification uses external contracts

Verification logic is separated into external contracts to keep the RecoveryAccount's recovery logic simple. Because Verifier contracts expose a common calling interface, the risks of external verification can be managed within a well-defined integration boundary. Changing the verification logic does not require changing the RecoveryAccount, while retaining support for additional guardian types.

This structure gives verification contracts clearly defined responsibilities and helps maintain security without introducing unnecessary complexity. The interface alone does not guarantee that a particular verifier implementation is safe.

Securing recoveryConfigs

The recoveryConfigs values are critical configuration data for the RecoveryAccount. They contain recovery-related information such as the guardian list and thresholds, and must be stored and protected appropriately. Access and update permissions should be tightly controlled, and these configurations should be kept separate from unrelated state.

The proposal does not prescribe a particular number of configurations or storage layout, allowing implementations to adapt the design to their needs. An account can therefore support multiple recovery configurations in parallel.

Why recoveryNonce is necessary

The recoveryNonce is introduced to prevent replay attacks in which guardian signatures are reused without authorization. Using a different value for each recovery reduces the risk of someone executing another recovery using old signatures.

This gives recovery operations distinct identities and helps ensure that guardian signatures are used safely. Even when guardians have approved a recovery correctly, the nonce helps prevent those approvals from being reused in another recovery context.

References

John Zhang (@johnz1019), Davis Xiang (@xcshuan), Kyle Xu (@kylexyxu), George Zhang (@odysseus0), "ERC-7093: Social Recovery Interface [DRAFT]," Ethereum Improvement Proposals, no. 7093, May 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7093.

Conclusion

This article covered ERC7093, a proposal for social recovery with customizable recovery policies.

If you have questions, feel free to contact me via Twitter DM.

Twitter @cardene777

I also publish articles on the following platforms.