Sign messages
This guide will teach you how to sign messages using your Smart Wallet. Message signing is a key feature that allows users to authenticate and prove ownership of their wallet without spending gas.
Smart Wallets will generate signatures that can be validated using ERC-1271. If the wallet is an undeployed smart contract account (also known as a counterfactual address), then the signature will be wrapped according to ERC-6492.
Prerequisites
- API key from your dashboard
- A Smart Wallet with an associated signer
What is message signing?
Message signing allows users to:
- Authenticate without spending gas
- Prove ownership of their wallet
- Sign arbitrary data for offchain verification
- Interact with dApps that require signature-based authentication
Smart Wallets support EIP-191 message signing, which is the standard for Ethereum message signing. You may also see EIP-191 referred to as the personal_sign message format.
Text messages
React
JavaScript
Use the useSignMessage hook to sign text messages with your Smart Wallet.
Raw hex messages
React
JavaScript
Use the useSignMessage hook to sign raw hex messages with your Smart Wallet.
Next steps
Build more:
Troubleshooting: