ERC1271Module

The ERC1271Module allows you to verify signatures from smart contract wallets that implement the ERC-1271 standard. This module extends signature verification beyond EOAs (Externally Owned Accounts) t

When to use this module?

Use this module when you want to:

  • Support signature verification from smart contract wallets (e.g., Gnosis Safe, Argent, etc.)

  • Allow multisig wallets to authorize attestations

  • Enable account abstraction wallets to issue attestations

  • Support any wallet that implements the ERC-1271 standardarrow-up-right

This module is essential for portals that want to be compatible with the growing ecosystem of smart contract wallets and account abstraction.

When not to use this module?

Don't use this module if:

  • You only need to support EOA (regular wallet) signatures - use the ECDSAModule instead (it's simpler and uses less gas)

  • You don't care about signature verification at all

  • You need custom signature logic beyond standard ECDSA and ERC-1271

How is it different from ECDSAModule?

Feature
ECDSAModule
ERC1271Module

EOA signatures

βœ… Supported

βœ… Supported

Smart contract wallet signatures

❌ Not supported

βœ… Supported

Gas cost

Lower

Higher (additional contract call)

Use case

Simple signature verification

Smart wallet compatibility

The ERC1271Module first recovers the signer using ECDSA (like ECDSAModule), then additionally checks if the signer is a smart contract. If it is, the module calls the contract's isValidSignature function to verify the signature according to ERC-1271.

How to use this module?

1. Set authorized signers for your portal

Only the portal owner can authorize signers. Call the setAuthorizedSigners function:

Parameters:

  • portal: The address of your portal

  • signers: An array of signer addresses (can be EOAs or smart contract wallets)

  • authorizationStatus: An array of booleans (true to authorize, false to revoke)

Example:

2. Include the module when registering your portal

Add the ERC1271Module address to your portal's modules array.

3. Create attestations with signatures

When creating an attestation, pass the signature as the validationPayload:

  • The signature should be on the hash of the attestationPayload

  • For EOAs: Standard ECDSA signature (65 bytes)

  • For smart contract wallets: The signature format depends on the wallet implementation (e.g., Gnosis Safe uses a specific format)

The module will:

  1. Recover the signer from the signature

  2. Check if the signer is authorized for the portal

  3. If the signer is a contract, call isValidSignature to verify according to ERC-1271

How to check authorized signers?

The ERC1271Module exposes a public mapping:

You can query this mapping to check if a specific signer is authorized for a portal.

Important notes

circle-exclamation
circle-info

Smart contract wallet support: The signer address must implement the isValidSignature(bytes32 hash, bytes signature) function as defined in ERC-1271. Most modern smart contract wallets (Gnosis Safe, Argent, etc.) already implement this standard.

Example: Supporting Gnosis Safe

Last updated