Sign typed data
This guide will teach you how to sign EIP-712 typed data with your Smart Wallet. Typed data signing provides a more structured and secure way to sign complex data compared to plain text messages.
Prerequisites
- API key from your dashboard
- A Smart Wallet with an associated signer
What is typed data signing?
EIP-712 typed data signing allows users to:
- Sign structured data with clear type definitions
- Improve user experience with readable signature requests
- Enhance security through type safety and domain separation
Typed data follows the EIP-712 standard, which provides a way to encode structured data for signing.
Implementation
React
JavaScript
Required SDK version: ^v4.59.1
Use the useSignTypedData hook to sign typed data with your Smart Wallet.
signTypedData.tsx
Typed data structure
EIP-712 typed data consists of four main components:
Domain
The domain provides context and prevents signature reuse across different dApps:
Types
Define the structure of your data:
Primary type
Specify which type is the main type being signed:
Message
The actual data to sign:
Next steps
Build more:
Troubleshooting: