Verifies a signature using EIP-6492 (universal signature verification).
Supports both deployed and counterfactual (not-yet-deployed) smart
wallets. For counterfactual signatures (signature ends with the 6492
magic suffix), the wallet's factory deployment data is embedded in
the signature itself and must be executed before isValidSignature
can be called. Two resolution paths:
If provider is a viem PublicClient (duck-typed by the presence
of a verifyMessage method), delegate to its native 6492 support
— viem uses the ERC-6492 "Universal Signature Validator" deployless
eth_call pattern so the wallet doesn't actually need to be
deployed to be verified.
Otherwise, throw with a clear message instructing the caller to
supply a viem PublicClient. A raw EIP-1193 provider is not
enough: deployless verification requires invoking the universal
validator bytecode, which we don't bundle (to avoid shipping a
couple of kilobytes of contract code and keep the optional viem
peer dependency the single source of truth for this logic).
Deployed (non-6492) signatures fall through to standard EIP-1271
verification via eth_call isValidSignature, which works on any
EIP-1193 provider.
Parameters
walletAddress: string
Wallet address (may be counterfactual)
messageHash: string
Hash of the message that was signed
signature: string
The signature (may include deployment data)
provider: unknown
Ethereum provider — viem PublicClient for 6492,
any EIP-1193 provider for plain 1271
Verifies a signature using EIP-6492 (universal signature verification).
Supports both deployed and counterfactual (not-yet-deployed) smart wallets. For counterfactual signatures (signature ends with the 6492 magic suffix), the wallet's factory deployment data is embedded in the signature itself and must be executed before
isValidSignaturecan be called. Two resolution paths:If
provideris a viemPublicClient(duck-typed by the presence of averifyMessagemethod), delegate to its native 6492 support — viem uses the ERC-6492 "Universal Signature Validator" deploylesseth_callpattern so the wallet doesn't actually need to be deployed to be verified.Otherwise, throw with a clear message instructing the caller to supply a viem
PublicClient. A raw EIP-1193 provider is not enough: deployless verification requires invoking the universal validator bytecode, which we don't bundle (to avoid shipping a couple of kilobytes of contract code and keep the optional viem peer dependency the single source of truth for this logic).Deployed (non-6492) signatures fall through to standard EIP-1271 verification via
eth_call isValidSignature, which works on any EIP-1193 provider.