ERC-1271 Smart Contract Signatures: How Wallets Verify Authority
ERC-1271 lets smart contract wallets validate signatures with programmable rules. Learn how isValidSignature works, where compatibility breaks, and key risks.

A smart account may be controlled by several owners, a passkey, a recovery policy, or rules that change over time. So how can a dApp ask whether that account approved a message when there is no single private key behind the account address? ERC-1271 smart contract signatures answer that question by making signature validity something a contract can decide. It is a small but important part of practical crypto wallet security.
This guide explains the verification flow, why it differs from an ordinary wallet signature, and what users and developers should check. It is educational, not financial advice (NFA). Contract code, integrations, and signed permissions can fail or be abused, so verify current implementations and do your own research (DYOR).
What Problem Does ERC-1271 Solve?
An externally owned account (EOA) has a private key. When it signs a message, software can use elliptic-curve cryptography to recover the signing address and compare it with the expected address. A smart contract account is different: the contract address has no private key of its own.
Think of an EOA like a document accepted only when it carries one person's handwritten signature. A smart account is more like a company approval desk. The desk may accept a document only after two directors sign, a spending limit passes, or a designated device approves. You do not recover “the company’s pen.” You ask the company’s rules whether the approval is valid.
ERC-1271 standardizes that question. A contract exposes isValidSignature(bytes32 hash, bytes signature). If the contract considers the signature valid for that hash, it returns the four-byte magic value 0x1626ba7e. Otherwise it returns a different value or reverts.
The standard deliberately does not dictate the authorization policy. A contract can require one owner, a multisig threshold, an approved on-chain message, a passkey-backed verifier, or another rule. This flexibility is why ERC-1271 fits programmable account abstraction and smart wallets.
How ERC-1271 Verification Works
A typical application follows this path:
- It constructs the exact message or typed-data digest the user is expected to approve.
- The smart-account owners or authorized devices produce the proof required by that account.
- The application notices that the claimed signer address contains contract code.
- It calls
isValidSignatureon that contract with the hash and signature bytes. - It accepts the approval only if the contract returns the ERC-1271 magic value.
The signature is a flexible byte array. For one account it may contain a normal owner signature. For a multisig it may contain several signatures. Another implementation may interpret it differently. The verifier should not guess the format; the smart account owns that validation logic.
The method must not modify state. The specification requires a read-only check, allowing applications to query validity without turning verification into an account action. The ethereum.org ERC-1271 tutorial uses Safe to illustrate both off-chain owner signatures and messages approved on-chain after a multisig threshold is reached.
EOA Signatures vs Smart Contract Signatures
| Question | EOA signature | ERC-1271 contract signature |
|---|---|---|
| Who defines validity? | Fixed cryptographic recovery from a private key | Code at the smart-account address |
| Typical check | Recover an address from the signature | Call isValidSignature |
| Can rules be customized? | Very limited at the account layer | Yes: thresholds, modules, passkeys, policies |
| Can validity change later? | A valid signature generally stays cryptographically valid | It may change when owners, modules, or contract state change |
| Does checking require an EVM call? | Not necessarily | Usually yes, against the relevant chain state |
That last distinction matters. A contract signature is not always timeless. If a Safe changes owners or its threshold, a previously valid proof may no longer pass the current contract rules. Applications that cache results forever can therefore make a dangerous assumption.
Where ERC-1271 Is Used
Smart-account login and attestations
A service may ask a wallet to prove control of an address without sending a transaction. Supporting only ECDSA address recovery excludes contract accounts. ERC-1271 gives the service a standard contract path, although the service must still bind the message to the correct domain, purpose, nonce, and expiration.
Off-chain orders, votes, and permissions
Decentralized exchanges, governance systems, and token-permission flows often collect signatures off-chain and settle later. The verifier can accept an EOA signature or ask a contract wallet whether the same digest is valid. Uniswap Permit2, for example, documents contract-wallet support through ERC-1271; the authorization still deserves the same scrutiny as any Permit or Permit2 signature.
Multisig and programmable approvals
A contract can translate its own governance into one interoperable answer. A two-of-three multisig can check the threshold, while a policy wallet might reject an approval above a limit or after an expiry. ERC-1271 standardizes the interface, not the policy behind it.
Risks and Integration Failure Modes
Treating every signer as an EOA
An application that only runs ECDSA recovery may reject a legitimate smart account. Worse, improvised fallback logic can accept the wrong signer. OpenZeppelin's current SignatureChecker documentation provides a unified path for EOA and ERC-1271 validation, but developers still need to supply the correct signer, hash, and chain context.
Assuming a successful call is enough
The verifier must check the exact magic return value. A call that merely does not revert is not proof of validity. It should also handle malformed return data and contracts that consume unexpected gas without silently treating them as valid.
Replay across accounts, chains, or applications
ERC-1271 verifies what the account policy accepts; it does not automatically make a poorly designed message replay-safe. The message design should bind the approval to its intended application and scope, commonly with EIP-712 domain separation plus a nonce and deadline. OpenZeppelin's smart-account guidance additionally recommends ERC-7739 defensive rehashing to reduce replay across accounts controlled by the same signer.
Mutable rules and changing validity
Owners can rotate, modules can change, and account logic can be upgraded. A result valid at one block may not be valid later. A verifier should decide whether it needs validity at the current block, at a historical block, or at settlement, then query and record the appropriate context.
A valid signature can still authorize a bad action
Cryptographic validity answers “did this account approve this digest under its rules?” It does not answer “is the action beneficial or safe?” A phishing site can request a valid signature for a harmful permission. Users should rely on clear signing, verify the origin and scope, and reject prompts they cannot explain.
Caution
Never approve a message only because the wallet or dApp labels it an ERC-1271 request. The standard verifies authority; it does not certify the requesting site, contract, or economic outcome.
A Practical Verification Checklist
For users:
- Confirm the site and chain independently before connecting the smart account.
- Read the action, contract, assets, limits, nonce, and expiry shown by the wallet.
- Make sure the expected owners or devices approved—especially for threshold accounts.
- Reject blind or unexplained messages, even when no gas fee appears.
- Recheck pending approvals after owner, guardian, or module changes.
For developers:
- Detect contract signers using the chain state relevant to verification.
- Use ECDSA recovery for EOAs and the ERC-1271 call path for contract accounts.
- Require the exact
0x1626ba7eresult; fail closed on errors or malformed data. - Domain-separate messages and include a purpose-specific nonce and sensible expiry.
- Avoid permanent caching when account rules can change, and test multisig, upgraded, and reverted cases.
Frequently Asked Questions
Does a smart contract wallet have a private key?
The contract address itself does not. Owners or devices may have keys or passkeys, but the contract applies its programmed rules to decide whether their proof authorizes the account.
Is ERC-1271 the same as account abstraction?
No. Account abstraction is the broader model of programmable accounts. ERC-1271 is a focused interface that lets other software ask a contract account whether a message signature is valid.
Does calling isValidSignature cost the user gas?
A read-only off-chain call does not require the user to submit a transaction. Verification executed inside another on-chain transaction consumes computation as part of that transaction.
Can an ERC-1271 signature become invalid?
Yes. Contract validation can depend on current owners, thresholds, modules, approved-message state, or upgradeable logic. Applications should not assume the answer remains unchanged forever.
The Practical Takeaway
ERC-1271 lets a smart account say, in a standard way, whether it authorized a particular hash and proof. That simple interface allows multisigs and other programmable wallets to participate in logins, orders, votes, and permissions that would otherwise assume one EOA key.
The standard is not a safety seal. Correct message construction, exact return-value checks, replay protection, current chain state, and understandable wallet prompts still matter. Verify the action as well as the signature. This article is educational and not financial advice; smart-contract use can lead to total loss, so use only funds you can afford to lose and always DYOR.
Keep learning

Account Abstraction Explained: How Smart Wallets Work (2026)
Learn how account abstraction and ERC-4337 smart wallets work — seedless recovery, gasless transactions, and passkeys. A 2026 guide to smarter crypto wallets.

Multisig vs MPC Wallets: How Shared-Control Crypto Custody Works (2026)
A single seed phrase is one point of failure. Multisig and MPC wallets both fix that — very differently. How each works, who should use which, and the risks.

ERC-2612 Permit vs Permit2: How Signature-Based Token Approvals Work
ERC-2612 Permit and Uniswap Permit2 can simplify ERC-20 approvals, but signatures still carry risk. Compare their flows, scope, and safety checks.
Explore related topics

Pending Ethereum Transactions: Diagnose, Speed Up, or Cancel Safely
Learn why an Ethereum transaction stays pending, how nonce order and fees affect it, and when speeding up, canceling, or waiting is the safest response.

Ethereum Glamsterdam Upgrade: ePBS, 78% Gas Cuts and 10K TPS Explained
Glamsterdam is the most significant Ethereum upgrade since The Merge. Learn what ePBS, Block-Level Access Lists, and gas repricing change — plus key risks and what to watch before it ships.