Once you’ve received the payloads from the API, you need to sign them to approve execution.
Signature Formats by Mode and Version
MEE v2.2.1 introduces EIP-712 typed data signing forsmart-account mode, providing better security and user experience through structured, human-readable signing requests.
| Mode | Account Version | Signature Format | Signing Method |
|---|---|---|---|
smart-account | v2.2.1 | EIP-712 Typed Data | eth_signTypedData_v4 |
smart-account | v2.1.0 (upgrade flow) | Personal Message | eth_sign / personal_sign |
eoa (Fusion) | Any | Permit / Onchain | Mode-specific |
eoa-7702 | v2.1.0 | Personal Message | eth_sign / personal_sign |
The API automatically returns the correct
payloadToSign format based on your account version and mode. Your signing code should detect and handle both formats.Quick Start: Copy-Paste Utilities
For TypeScript users: Copy the utilities below directly into your project.Not using TypeScript? Implement your own version following the same logic shown in the code.
How It Works: Three Signature Types
- The API returns an array of payloads to sign.
- In most cases this array has just one item.
- Each item in the payload is one of three signature types (simple, permit, onchain) depending on your execution mode and token support
- Simple
- Permit
- Onchain
Simple (Smart Account & EIP-7702)
What: Signs a message for smart account or EIP-7702 executionWhen:
smart-account mode or eoa-7702 modeResult: Off-chain signature
By default, v2.2.1 uses EIP-712 typed data for
smart-account mode. Personal message signing only occurs in two cases: eoa-7702 mode, or when upgrading legacy v2.1.0 smart accounts.EIP-712 Typed Data (Default for Smart Accounts)
For v2.2.1 smart accounts (the default), the payload contains EIP-712 structured data:Personal Message (EIP-7702 & Legacy Upgrade Only)
Foreoa-7702 mode and v2.1.0 accounts during upgrade, the payload contains a raw message:Detecting the Format
Use a type guard to automatically detect and sign the correct format:The Magic: Supertx Hash Embedding
For EOA mode, the API cleverly embeds the supertransaction hash into your signatures. This creates a cryptographic link between funding and execution, enabling single-signature cross-chain operations. For Permit: The supertx hash replaces thedeadline field
Usage by Execution Mode
- EOA
- EOA-7702
- Smart Account
Signature Requirements:
- One signature per funding token
- Type depends on token support (permit or onchain)
Summary
- Copy the utilities - They handle all signature types automatically
- Get a quote - The API returns the appropriate payload type
- Sign with utilities -
signQuoteSignablePayload()routes to the right method - Execute - Send signed payloads back to complete the supertransaction
Why EIP-712 Typed Data?
MEE v2.2.1 uses EIP-712 typed data signing forsmart-account mode for several benefits:
Human-Readable Signing
Human-Readable Signing
Wallets display structured data instead of opaque hex strings. Users can see transaction details like amounts, recipients, and deadlines before signing.
Phishing Resistance
Phishing Resistance
Users can verify transaction details in their wallet UI before signing, making it harder for malicious sites to trick users into signing harmful transactions.
Domain Separation
Domain Separation
Signatures are cryptographically bound to specific contracts and chains, preventing signature replay attacks across different applications or networks.
Type Safety
Type Safety
Structured types prevent signature malleability attacks and ensure data integrity throughout the signing process.
Migration Notes
When migrating from v2.1.0 to v2.2.1 or supporting both versions:- Update signing logic - Use the type guard to handle both payload formats
- Test with both formats - Ensure backward compatibility with legacy accounts
- No API changes needed - The API automatically returns the correct format based on account version
- Upgrade transactions use personal message - When upgrading a v2.1.0 account, the upgrade quote uses personal message signing (not EIP-712)