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.

Background

ERC-7780 extends the ERC-7579 module system so smart accounts can separate signature verification from policy checks and compose the two as needed.

This article explains and expands on the proposal below.

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

Overview

ERC-7780 proposes six additional module types for ERC-7579. These include Policy, Signer, and StatelessValidator. Account implementations can choose whether to use them.

ERC-7579 specifies a modular architecture for smart accounts. ERC-7780 extends it so developers can separate and reuse signature verification and permission checks at a finer granularity.

The proposal has several features.

  • Adds six module types, including Policy, Signer, and StatelessValidator.
  • Allows signature verification and policy checks to run in different modules.
  • Allows a single module to implement multiple types.
  • Can reduce gas costs.

ERC-7579 standardizes a modular approach to smart accounts for account abstraction. It defines module types including validators, executors, and fallback handlers.

Motivation

The proposal responds to the need for more flexibility in composing signature verification and permission checks.

Composability

Under a conventional ERC-7579 design, a validator module can be responsible for both signature verification and policy decisions. Splitting these responsibilities into separate modules lets developers build and reuse each component independently.

For example, developers can implement signature verification for ECDSA, WebAuthn, or multisig separately from execution policies such as spending caps, time limits, or allowlists. They can then combine a signature verifier with the policy an account needs.

Gas efficiency

Stateless validators can reduce storage access and lower gas costs. A StatelessValidator has no internal state to read or write during verification.

Specification

Module types

ERC-7780 lists six new module types.

Type ID Name Purpose
5 Policy Determines whether a UserOperation may execute
6 Signer Verifies signatures
7 StatelessValidator Verifies signatures without relying on internal state
8 PreValidationHookERC1271 Runs before ERC-1271 signature verification
9 PreValidationHookERC4337 Runs before ERC-4337 validation
10 StatelessValidatorWithSender Performs stateless verification with sender context

IPolicy

A Policy module checks a UserOperation or signature against an account's policy. A module could check a daily spending limit or restrict access to specific contracts, for example.

The interface is as follows.

javascript
interface IPolicy is IModule {
    function checkUserOpPolicy(bytes32 id, PackedUserOperation calldata userOp)
        external payable returns (uint256);

    function checkSignaturePolicy(bytes32 id, address sender, bytes32 hash, bytes calldata sig)
        external view returns (uint256);
}
Functions
checkUserOpPolicy
javascript
function checkUserOpPolicy(bytes32 id, PackedUserOperation calldata userOp)
    external payable returns (uint256);

Checks whether a UserOperation complies with the policy.

The function evaluates the UserOperation against the account's rules and returns validation data indicating the result. The payable modifier allows the call to carry value, which the original article relates to flows that prepay gas during validation.

Arguments

  • id
    • A 32-byte policy identifier.
  • userOp
    • The PackedUserOperation to validate.

Return value

  • uint256
    • ERC-4337 validation data for the EntryPoint. The Japanese article summarizes the result as zero for success and nonzero for failure. In the general ERC-4337 encoding, validation data can also carry validity limits, so a nonzero value alone does not indicate failure.
checkSignaturePolicy
javascript
function checkSignaturePolicy(bytes32 id, address sender, bytes32 hash, bytes calldata sig)
    external view returns (uint256);

Checks whether a signature complies with the policy.

During ERC-1271-style verification, the policy evaluates whether the signature may be used in that context. Cryptographic verification is separate. As a view function, the check does not change state.

Arguments

  • id
    • A 32-byte policy identifier.
  • sender
    • The address associated with the request.
  • hash
    • The signed message hash.
  • sig
    • The signature data to validate.

Return value

  • uint256
    • ERC-4337 validation data. The original article gives the same zero/nonzero shorthand as above, with the same qualification.

ISigner

A Signer module performs cryptographic signature verification. It can implement schemes such as ECDSA, WebAuthn, or BLS.

The interface is as follows.

javascript
interface ISigner is IModule {
    function checkUserOpSignature(bytes32 id, PackedUserOperation calldata userOp, bytes32 userOpHash)
        external payable returns (uint256);

    function checkSignature(bytes32 id, address sender, bytes32 hash, bytes calldata sig)
        external view returns (bytes4);
}
Functions
checkUserOpSignature
javascript
function checkUserOpSignature(bytes32 id, PackedUserOperation calldata userOp, bytes32 userOpHash)
    external payable returns (uint256);

Verifies the signature on a UserOperation.

The function checks that an authorized signer produced the signature. It is used in ERC-4337 validation and reports the result to the EntryPoint.

Arguments

  • id
    • A 32-byte signer configuration identifier.
  • userOp
    • The PackedUserOperation to validate.
  • userOpHash
    • The UserOperation hash.

Return value

  • uint256
    • The signature check result returned to the EntryPoint. The original article describes 1 as delayed validation, but under ERC-4337, 1 denotes signature validation failure. Time restrictions are encoded in the validity fields of the validation data.
checkSignature
javascript
function checkSignature(bytes32 id, address sender, bytes32 hash, bytes calldata sig)
    external view returns (bytes4);

Verifies an ERC-1271 signature.

The function can verify a signature over an arbitrary message. It is intended to be called from the ERC-1271 isValidSignature flow and returns the ERC-1271 magic value 0x1626ba7e on success.

Arguments

  • id
    • A 32-byte signer configuration identifier.
  • sender
    • The sender associated with the signature request.
  • hash
    • The signed message hash.
  • sig
    • The signature data to verify.

Return value

  • bytes4
    • The ERC-1271 magic value 0x1626ba7e on success.

IStatelessValidator

A StatelessValidator verifies a signature without keeping internal state. The caller passes the data necessary for verification, which can avoid storage reads and lower gas costs.

The interface is as follows.

javascript
interface IStatelessValidator {
    function validateSignatureWithData(bytes32 hash, bytes calldata signature, bytes calldata data)
        external view returns (bool);

    function isModuleType(uint256 moduleTypeId)
        external view returns (bool);
}
Functions
validateSignatureWithData
javascript
function validateSignatureWithData(bytes32 hash, bytes calldata signature, bytes calldata data)
    external view returns (bool);

Verifies a signature against supplied data.

The function receives the information it needs in its arguments. For example, a caller can include a public key or other verification parameters in data, allowing verification without a storage lookup. ERC-7780 recommends that all ERC-7579 Validator modules also implement this interface.

Arguments

  • hash
    • The signed message hash.
  • signature
    • The signature data to verify.
  • data
    • Additional verification data, such as a public key.

Return value

  • bool
    • true if the signature is valid, or false otherwise.
isModuleType
javascript
function isModuleType(uint256 moduleTypeId)
    external view returns (bool);

Checks whether a module supports a given type.

The function reports whether the module supports the supplied type ID, such as 7 for StatelessValidator. A module that implements multiple types returns true for each applicable type ID.

Arguments

  • moduleTypeId
    • The module type ID to check.

Return value

  • bool
    • true if the module supports the requested type.

IPreValidationHookERC1271

PreValidationHookERC1271 runs before ERC-1271 signature verification. A module can use it to transform signature data or apply additional checks.

The interface is as follows.

javascript
interface IPreValidationHookERC1271 {
    function preValidationHookERC1271(address sender, bytes32 hash, bytes calldata data)
        external view returns (bytes32 hookHash, bytes memory hookSignature);
}
Functions
preValidationHookERC1271
javascript
function preValidationHookERC1271(address sender, bytes32 hash, bytes calldata data)
    external view returns (bytes32 hookHash, bytes memory hookSignature);

Performs preprocessing before ERC-1271 verification.

The hook runs before signature verification and can transform the hash or signature data. For instance, it could apply a domain separator or normalize the signature format. It returns the transformed hash and signature.

Arguments

  • sender
    • The address associated with the signature request.
  • hash
    • The original message hash.
  • data
    • Additional data passed to the hook.

Return values

  • hookHash
    • The transformed hash.
  • hookSignature
    • The transformed signature data.

IPreValidationHookERC4337

PreValidationHookERC4337 runs before ERC-4337 UserOperation validation.

The interface is as follows.

javascript
interface IPreValidationHookERC4337 {
    function preValidationHookERC4337(
        PackedUserOperation calldata userOp,
        uint256 missingAccountFunds,
        bytes32 userOpHash
    ) external returns (bytes32 hookHash, bytes memory hookSignature);
}
Functions
preValidationHookERC4337
javascript
function preValidationHookERC4337(
    PackedUserOperation calldata userOp,
    uint256 missingAccountFunds,
    bytes32 userOpHash
) external returns (bytes32 hookHash, bytes memory hookSignature);

Performs preprocessing before validating an ERC-4337 UserOperation.

The hook runs before UserOperation validation. It receives missingAccountFunds, the account's shortfall for prefunding the operation, so it can include logic relevant to prefunding. It can also update state because it is not a view function.

Arguments

  • userOp
    • The PackedUserOperation to validate.
  • missingAccountFunds
    • The amount the account is short for prefunding.
  • userOpHash
    • The UserOperation hash.

Return values

  • hookHash
    • The transformed hash.
  • hookSignature
    • The transformed signature data.

IStatelessValidatorWithSender

StatelessValidatorWithSender performs stateless verification with sender context. It extends the basic StatelessValidator approach with the caller's address.

The interface is as follows.

javascript
interface IStatelessValidatorWithSender {
    function validateSignatureWithDataWithSender(
        address sender,
        bytes32 hash,
        bytes calldata signature,
        bytes calldata data
    ) external view returns (bool);
}
Functions
validateSignatureWithDataWithSender
javascript
function validateSignatureWithDataWithSender(
    address sender,
    bytes32 hash,
    bytes calldata signature,
    bytes calldata data
) external view returns (bool);

Verifies a signature statelessly with sender context.

The function is a version of validateSignatureWithData that also takes the sender's address. This is useful when verification depends on the sender, for example when different senders are subject to different rules.

Arguments

  • sender
    • The address that called the account's isValidSignature function.
  • hash
    • The signed message hash.
  • signature
    • The signature data to verify.
  • data
    • Additional data needed for verification.

Return value

  • bool
    • true if the signature is valid, or false otherwise.

Additional notes

ERC-7780 recommends that ERC-7579 Validator modules implement the StatelessValidator interface. This can provide several benefits.

  • Better gas efficiency through fewer storage accesses.
  • Easier testing because verification does not depend on stored state.
  • Reuse across more contexts.

Supporting multiple types in one module

A single module can implement multiple interfaces. Possible combinations include the following.

Combination Purpose
Signer + StatelessValidator Also exposes a stateless signature verification path
Policy + PreValidationHook Combines policy checks and preprocessing
Signer + Policy Provides signature verification and policy checks in one module

Use isModuleType to check the types a module supports.

How the modules interact

The diagram shows an example of how modules can interact while validating a UserOperation.

sequenceDiagram
    participant EntryPoint
    participant Account
    participant PreHook as PreValidationHook
    participant Signer
    participant Policy

    EntryPoint->>Account: validateUserOp
    Account->>PreHook: preValidationHookERC4337
    PreHook-->>Account: (hookHash, hookSignature)
    Account->>Signer: checkUserOpSignature
    Signer-->>Account: validation result
    Account->>Policy: checkUserOpPolicy
    Policy-->>Account: policy result
    Account-->>EntryPoint: final result

The flow begins when the EntryPoint passes the UserOperation to the account and ends when validation finishes.

  1. The EntryPoint calls the account's validateUserOp.
  2. The account runs the pre-validation hook first and transforms the hash or signature data if needed.
  3. The Signer module verifies the signature cryptographically.
  4. If the signature is valid, the Policy module checks rules such as spending limits and access restrictions.
  5. The account reports success to the EntryPoint only if all checks succeed.

This separation lets developers implement, test, and reuse signature verification in the Signer independently of the Policy's business rules.

Compatibility

Relationship to ERC-7579

ERC-7780 extends ERC-7579 and is designed to maintain backward compatibility.

Standard Compatible Notes
ERC-7579 ✅ Existing module types 1–4 remain usable
ERC-4337 ✅ Uses the existing UserOperation structure
ERC-1271 ✅ Supports the standard signature verification interface

Existing ERC-7579 accounts can add the new module types as optional extensions. Accounts that do not use them retain their existing functionality.

Security considerations

The proposal marked its detailed security considerations as TBD at the time of writing. Check the latest specification when implementing it.

References

Conclusion

ERC-7780 extends the ERC-7579 module system with components that let account developers compose signature verification, policy checks, and pre-validation hooks.

Questions are welcome by direct message.

Twitter @cardene777

I also write at the following sites.