{"id":"ERC-1271","name":"Standard Signature Validation for Contracts","status":"Final","chain":"both","category":{"id":"security","name":"Security & Trust","description":"Helping users verify, control, and protect their assets"},"journeyStages":[{"id":"authentication","name":"Authentication & Identity","description":"Proving who you are and logging in"}],"uxImpact":"Smart contract wallets (Safe, Argent) can sign messages like EOAs — unlocks gasless listings, off-chain voting for multisigs. Design implications: don't assume signer = EOA, show 'Wallet Type: Smart Contract' indicator, support signature verification loading states. Design decisions: how to handle async signature verification vs instant EOA checks — may need pending/confirming states in UI.","hasDetailedContent":true,"content":{"id":"ERC-1271","summary":"ERC-1271 lets smart contract wallets (like multisigs and account abstraction wallets) sign messages just like regular wallets. This enables \"Login with Smart Wallet\" and signature-based permissions for users who don't have traditional seed phrase wallets.","applicability":{"whenToUse":["Your product addresses: smart wallets can't sign messages for login.","Your product addresses: multisig users locked out of dApps.","The flow should deliver: any contract can implement isValidSignature() to verify signatures.","Connect flows must list wallets with names, icons, and explicit user choice."],"whenToAvoid":["Always check for contract code and support ERC-1271 verification.","Check EOA first, then fall back to isValidSignature() for contracts.","Display how many signatures collected vs required.","Wrong-address or approval mistakes are not recoverable in your product context."]},"designerTakeaways":["You can design UI that delivers any contract can implement isValidSignature() to verify signatures.","You can design UI that delivers multisigs implement ERC-1271 to validate collected signatures.","You can design UI that delivers contracts check ERC-1271 for smart wallet signatures."],"problemsSolved":[{"problem":"Smart wallets can't sign messages for login","oldWay":"Only EOAs (seed phrase wallets) could sign messages, excluding smart wallet users","newWay":"Any contract can implement isValidSignature() to verify signatures","impact":"critical"},{"problem":"Multisig users locked out of dApps","oldWay":"Gnosis Safe users couldn't use \"Sign-In with Ethereum\" or permit","newWay":"Multisigs implement ERC-1271 to validate collected signatures","impact":"critical"},{"problem":"Permit/gasless approvals don't work for smart wallets","oldWay":"ERC-2612 permit only worked with EOA ECDSA signatures","newWay":"Contracts check ERC-1271 for smart wallet signatures","impact":"high"},{"problem":"Off-chain order signing excludes smart wallet users","oldWay":"OpenSea, 0x orders required EOA signatures, excluding multisigs","newWay":"Marketplaces verify signatures via isValidSignature()","impact":"high"},{"problem":"Each smart wallet has different signature validation","oldWay":"Every multisig had its own signature scheme, apps couldn't support all","newWay":"Standard interface means one integration works for all smart wallets","impact":"medium"}],"uxPatterns":[{"name":"Smart Wallet Login","description":"Sign-in flow that works for both EOAs and smart wallets","mockup":"concept/siwe-sign-in","userFlow":["User connects smart wallet","App detects contract wallet (no code at EOA = EOA, code = smart wallet)","Shows appropriate signing flow (single vs multisig)","User initiates signature request","Other signers approve if needed","App verifies via isValidSignature()","User logged in"]},{"name":"Multisig Signature Progress","description":"Track signature collection for multisig operations","mockup":"concept/siwe-sign-in","userFlow":["Signature request created","First signer signs","Progress updates in real-time","Second signer notified","Threshold reached","Signature validated, action proceeds"]},{"name":"Gasless Listing (Permit + 1271)","description":"Create marketplace listings without gas for smart wallet users","mockup":"concept/permit-approval","userFlow":["User fills listing details","App checks wallet type","Gasless option available for all wallet types","User signs listing order","Smart wallet validates via 1271","Listing goes live without gas spent"]},{"name":"Universal Signature Verification","description":"Detect wallet type and verify appropriately","mockup":"concept/verify-safety","userFlow":["App receives signature from unknown wallet","Check if address has code (smart wallet) or not (EOA)","For EOA: use ecrecover","For smart wallet: call isValidSignature()","Check return value equals magic value","Display verification result"]}],"uiComponents":[{"name":"WalletTypeIndicator","description":"Show whether connected wallet is EOA or smart wallet","states":["eoa","smart-wallet","multisig","unknown"],"props":["walletAddress","walletType","walletName","threshold"]},{"name":"SignatureProgress","description":"Track multisig signature collection","states":["pending","partial","complete","expired"],"props":["collected","required","signers[]","deadline"]},{"name":"SmartWalletBadge","description":"Indicate smart wallet compatibility","states":["compatible","incompatible","checking"],"props":["walletType","supportedFeatures[]"]},{"name":"SignerList","description":"List multisig signers and their status","states":["waiting","signed","rejected"],"props":["signers[]","signedBy[]","requiredCount"]},{"name":"UniversalSignButton","description":"Sign button that adapts to wallet type","states":["ready","awaiting-signatures","complete","error"],"props":["message","walletType","onSign","signaturesNeeded"]}],"antiPatterns":[{"pattern":"Assuming all wallets are EOAs","why":"Smart wallet users get \"invalid signature\" errors and can't use your app","instead":"Always check for contract code and support ERC-1271 verification","severity":"critical"},{"pattern":"Only using ecrecover for signature validation","why":"Excludes multisigs, Argent, Safe, and all ERC-4337 wallets","instead":"Check EOA first, then fall back to isValidSignature() for contracts","severity":"critical"},{"pattern":"Not showing multisig signature progress","why":"Users don't know if their request is pending or failed","instead":"Display how many signatures collected vs required","severity":"high"},{"pattern":"Hiding wallet type from users","why":"Smart wallet users don't know why signing flow is different","instead":"Show \"Multisig detected\" and explain the multi-signer flow","severity":"high"},{"pattern":"Short signature timeouts for multisigs","why":"Multisigs need time to collect signatures from multiple parties","instead":"Allow longer validity periods or refreshable signatures","severity":"medium"},{"pattern":"Not providing reminder/notification for pending signatures","why":"Signatures stall because other signers don't know they're needed","instead":"Integrate with Safe notification API or provide reminder button","severity":"medium"}],"onMonad":[{"aspect":"Signature Verification Speed","ethereum":"isValidSignature() call can be slow (RPC latency)","monad":"Sub-second RPC responses make verification feel instant","designImplication":"Can verify signatures inline without loading states"},{"aspect":"Gas for Verification","ethereum":"On-chain verification in contracts costs significant gas","monad":"Lower gas costs make on-chain verification more viable","designImplication":"Can do on-chain signature checks in transaction flow"},{"aspect":"Smart Wallet Adoption","ethereum":"Smart wallets common for treasuries, less for consumers","monad":"EIP-7702 makes smart wallet features common on regular EOAs","designImplication":"More users will have contract code, always check 1271"},{"aspect":"Multisig Confirmation","ethereum":"Waiting for block confirmations adds latency","monad":"Fast finality means signature status updates nearly instantly","designImplication":"Real-time signature progress without polling delays"}],"keyTakeaways":["ERC-1271 = smart wallets can sign messages","Always support both ecrecover AND isValidSignature()","Check if address has code to detect smart wallets","Show multisig progress: \"2 of 3 signatures collected\"","Allow longer timeouts for multi-party signing"],"technicalNotes":"ERC-1271 defines a single function: isValidSignature(bytes32 hash, bytes signature) returns (bytes4). If valid, returns magic value 0x1626ba7e. To check if address is smart wallet: if (address.code.length > 0) use 1271, else use ecrecover. Most smart wallets (Safe, Argent, Sequence, etc.) implement this standard."},"sources":[{"label":"Official specification","url":"https://eips.ethereum.org/EIPS/eip-1271","type":"official-spec"},{"label":"Discussion","url":"https://ethereum-magicians.org/search?q=ERC-1271","type":"discussion"}],"urls":{"canonical":"https://www.eipsfordesigners.com/standards/ERC-1271","markdown":"https://www.eipsfordesigners.com/standards/ERC-1271/content.md","agent":"https://www.eipsfordesigners.com/standards/ERC-1271/agent.md","api":"https://www.eipsfordesigners.com/api/standards/ERC-1271","official":"https://eips.ethereum.org/EIPS/eip-1271","discussion":"https://ethereum-magicians.org/search?q=ERC-1271"},"freshness":{"lastReviewed":"2026-04-05","lastUpdated":"2026-04-05"}}