Validate with Viem
Viem providesverifyMessage (EIP-191) and verifyTypedData (EIP-712). When you pass a PublicClient, Viem automatically validates contract wallet signatures via ERC-1271.
You can build the PublicClient directly from the active network with createPublicClientFromNetworkData so you don’t have to hardcode RPC URLs.
EIP-191 (message / personal_sign)
EIP-712 (typed data)
Manual validation
If you only need to compare against a known signer (no contract wallets), you can recover the address yourself.EIP-191
EIP-712
EIP-6492 (counterfactual smart accounts)
Smart accounts (e.g. Kernel via ZeroDev) may sign before the wrapper contract is deployed. EIP-6492 wraps the signature with a deploy-and-verify payload so verifiers can check it before the account exists on chain.@dynamic-labs-sdk/zerodev — verifyMessage alone won’t recognize the wrapped payload until the account is deployed.
Server-side validation
The verification helpers above are pure functions — you can run them server-side as long as the server has an RPC URL for the relevant chain. Build thePublicClient directly with viem’s createPublicClient rather than createPublicClientFromNetworkData if the server doesn’t have a Dynamic client instance.