Sign Messages
Sign and verify messages using ERC-1271 and ERC-6492 with smart accounts.
For the complete documentation index, see llms.txt.
Signing with a smart account is different from signing with an EOA. For EOAs, the address is derived from the signing key, so verification is just ecrecover + address match. Smart accounts are contracts, so there is no direct cryptographic link between the contract address and the signer. Verification must be done through ERC-1271, and for undeployed accounts you should use ERC-6492.
ERC-1271 and ERC-6492
ERC-1271 defines isValidSignature on the smart account contract. If the account is deployed, you can ask it to validate a signature against its internal rules (validator plugins, permissions, etc.).
ERC-6492 extends this by allowing the same validation flow even if the account is not deployed yet. It wraps the signature with deployment metadata so it can be verified counterfactually. In practice, ERC-6492 behaves like ERC-1271 for deployed accounts and adds support for undeployed accounts.
Recommendation: always use ERC-6492 for verification. It is strictly more capable and works in both deployed and undeployed states.
Usage
import { verifyEIP6492Signature } from "@namera-ai/sdk";
import { hashMessage } from "viem";
import { publicClient, smartAccountClient } from "./clients";
const message = "Hello World";
const signature = await smartAccountClient.signMessage({
message,
});
const isVerified = await verifyEIP6492Signature({
client: publicClient,
hash: hashMessage(message),
signature,
signer: smartAccountClient.account.address,
});
console.log(isVerified); // true